Skip to content

Conversation

@RenfengLiu
Copy link
Collaborator

No description provided.

RenfengLiu and others added 30 commits August 14, 2024 15:46
Since the OpenXR SDK has been updated, this is not a problem anymore.
When the graphics queue was distinct from the compute queue, access &
stage bits could be incorrectly computed. This was caused by the command
type not being linked to each queue, and some invalid condition in an
utility function designed to derive access & stage bits from an access
type.

Tested on my local machine, all sampled except one (push_descriptor)
passes. This failure already exists on main.

Signed-off-by: Nathan Gauër <brioche@google.com>
In order to add uint8 index buffer support to Geometry, I need to touch
many functions. To ensure that these functions continue to work, I would
like to add some unit tests.
Add support for creating buffers that the GPU can accept if
IndexTypeUint8Supported(). The client must decide which index type to
use depending on the supported features of the API and GPU; it is
possible to create a Uint8 buffer which i.e. is not accepted by DX12.

This is required for google#453
Calling GetElementCount for index type UNDEFINED is an odd corner case
that exposed a division by 0. If the mElementSize is 0 then we can't
meaningfully calculate the element count so return 0.
While reviewing scene_gltf_loader.cpp, I found some functions that
weren't being used. These have been removed.
There's an early return with error if `IsNull(pGltfPrimitive->indices)`
so genTopology will never be `true`. This can be reverted as part of
issue google#474. Until then, it's confusing and creates a burden for
refactoring.
The unlit material extension name is unused. This is probably because
cgltf already looks for this extension and exposes it as
`cgltf_material::unlit`; we don't need to look for the extension
ourselves.
`cgltf_data*` is never meaningfully used inside the function body. It
can be removed.
Upon inspection, ToString(Result) was missing several cases.
Default enum value was not a valid enum value, which caused issue with
asan. This fixed unit tests with this sanitizer enabled.

Signed-off-by: Nathan Gauër <brioche@google.com>
Since v3 is going to be deprecated soon.
This was used by run-benchmarks.py but that script was removed in google#62.
This doesn't seem to serve a purposes anymore so can be removed.
This demonstrates the scene renderer for basic materials

---------

Co-authored-by: Hai Nguyen <chaoticbob@users.noreply.github.com>
Co-authored-by: Aliya Pazylbekova <apazylbe@users.noreply.github.com>
Introduce a KnobFlag for specifying which GLTF scene to load. This is
relative to the asset path. This allows us to load additional scenes
without recompiling.
Otherwise with certain flags it fails to build because of ToApi()
function convertiong vk::Device to Device as it does not know that
vk::Device inherits from Device.
Load scenes that contain 8-bit index buffers. How the index buffer ends
up being packed depends on the capabilities of the device:

- On Vulkan with `VK_KHR_index_type_uint8` extension, the UINT8 indices
can be packed into a `INDEX_TYPE_UINT8` buffer. This is the optimal case
as it doesn't require additional memory.
- Otherwise, the UINT8 indices need to be repacked into UINT16 indices.
This comes at the cost of a larger GPU buffer.

This allows us to load more Khronos
[glTF-Sample-Assets](https://github.com/KhronosGroup/glTF-Sample-Assets)
like
[TextureCoordinateTest](https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/TextureCoordinateTest).


![image](https://github.com/user-attachments/assets/70985607-ed30-4354-9991-436187db4337)

Fixes google#453
Allow loading scenes without a camera. If there is no camera then
provide one that the user can interact with. As someone validating GLTF
support, I find this preferable to a static camera so that I can look at
the scene from any angle at runtime.

Fixes google#456
We can use glTF-Sample-Assets to verify our level of glTF support.

test_gltf_sample_assets.py iterates through all glTF-Sample-Assets and
tries to render them.

make_gltf_sample_assets_report.py will take the output of
test_gltf_sample_assets.py and try to make a report website for
triaging.

generate_gltf_report.sh handles the entire process end-to-end
…oogle#543)

No sample mismatch the image format and imageview format, meaning this
feature is not used. In addition, specifying this bit prevents the
driver to make some assumptions, and this can degrade performances
Ubuntu 20.04 has been removed as a runner, causing checks to fail on
PRs.

Ubuntu 24.04 was chosen in the hopes that we won't have to think about
it for a few more years than if we were to choose Ubuntu 22.04.

This required additional changes:

- Linux build requires `convert` so make sure imagemagick is installed.
- clang-format was pinned to `clang-format-12` but this package is not
in 24.04. The oldest version that 24.04 offers is `clang-format-14`. I'm
worried about pushing this too high, having it change how it wants code
formatted, and creating churn for PR authors. Though maybe I'm
overthinking this.

Fixes google#555
added a new knob `alu-instruction-count`. The sample can be run with
following knobs:
 "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Solid_Color",
    "fullscreen-quads-single-renderpass": true,
    "alu-instruction-count": 200
The test cases add a new knob `texture-count`, and can be run with 

```
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Texture",
    "fullscreen-quads-single-renderpass": true,
    "vs-alu-instruction-count": 100,
    "texture-count": 2
}
```
Added knob `disable-ps-output` to disable PS output.
For test case 3, use ` "fullscreen-quads-type": "Solid_Color"` and for
test case 4 use ` "fullscreen-quads-type": "Texture"`
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Texture",
    "fullscreen-quads-single-renderpass": true,
    "vs-alu-instruction-count": 100,
    "texture-count": 2,
    "disable-ps-output": true
}
)

Using Knob `fullscreen-quads-texture-path` to switch between texture
files, available files are
```
 "benchmarks/textures/tiger_1x1.jpg"
 "benchmarks/textures/tiger_591x720.jpg"
 "benchmarks/textures/tiger_1182x1440.jpg"
 "benchmarks/textures/tiger_2364x2880.jpg"
```

Full knob list:
```
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Texture",
    "fullscreen-quads-single-renderpass": true,
    "vs-alu-instruction-count": 100,
    "texture-count": 2,
    "disable-ps-output": true,
    "fullscreen-quads-texture-path": "benchmarks/textures/tiger_2364x2880.jpg"
}

```
RenfengLiu and others added 20 commits May 12, 2025 18:33
Added new knob `viewport_height_scale` and `viewport_width_scale`,
avaiable values are "1", "1/2", "1/4".

Full knob list 
```
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Solid_Color",  // "Texture" for mem-fetch
    "fullscreen-quads-single-renderpass": true,
    "vs-alu-instruction-count": 100,
    "texture-count": 2,
    "disable-ps-output": false,
    "fullscreen-quads-texture-path": "benchmarks/textures/tiger_2364x2880.jpg",
    "viewport_height_scale": "1/2",
    "viewport_width_scale": "1/4"
}
```
Added new knob `quad_blend_mode` with value "none", "alpha",
"disable_output". This also replaced the previews knob
`disable-ps-output`, which now can be set as
`"quad_blend_mode":"disable_output"`


```
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Texture",
    "fullscreen-quads-single-renderpass": true,
    "vs-alu-instruction-count": 100,
    "texture-count": 2,
    "disable-ps-output": false,
    "fullscreen-quads-texture-path": "benchmarks/textures/tiger_2364x2880.jpg",
    "viewport_height_scale": "1",
    "viewport_width_scale": "1",
    "quad_blend_mode": "alpha"
}
```
`sphere-count` and `drawcall-count` are used to define the number of
sphere and drawcalls.
```
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": true,
    "enable-metrics": false,
    "vs-alu-instruction-count": 1,
    "texture-count": 1,
    "fullscreen-quads-texture-path": "benchmarks/textures/tiger_2364x2880.jpg",
    "viewport_height_scale": "1",
    "viewport_width_scale": "1",
    "quad_blend_mode": "none",
    "sphere-count": 125,
    "drawcall-count": 1
}
```
Framebuffer format can be tested with the `offscreen-framebuffer-format`
knob.

Texture can be defined with knob `fullscreen-quads-texture-path`, the
noise and pure white texture are added.

a sample configuration could be: 
```
{
    "deterministic": true,
    "enable-skybox": false,
    "enable-spheres": false,
    "enable-metrics": false,
    "vs-alu-instruction-count": 1,
    "texture-count": 1,
    "fullscreen-quads-texture-path": "benchmarks/textures/tiger_2364x2880.jpg",
    "viewport_height_scale": "1",
    "viewport_width_scale": "1",
    "quad_blend_mode": "none",
    "fullscreen-quads-count": 1,
    "fullscreen-quads-type": "Solid_Color",
    "enable-offscreen-rendering": true,
    "offscreen-framebuffer-format": "R16G16B16A16_UNORM"
}
```
Bigwheels currently not support 64bit format.
For the Quad render.
Uniforms (constant) were only passed correctly in the case of type
noise.
Adding the knob for the ALU ocuppancy test
The fixed 20.f scale makes the sphere out of scence if there's only 1
sphere.
@google-cla
Copy link

google-cla bot commented May 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@apazylbe
Copy link
Collaborator

Do we intend to merge the changes from power measurement branch into the main branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants