KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
748 stars 400 forks source link

gpu: Add index cache for BDA check #8273

Closed spencer-lunarg closed 2 months ago

spencer-lunarg commented 2 months ago

For an app that are using BDA to just point to a single, large buffer

layout(buffer_reference) readonly buffer PerFrame {
    vec4 lots;
    uint of;
    mat4 data;
    uint to;
    int  get;
};

layout(push_constant, std430) uniform constants {
    PerFrame perFrame;
} pc;

we are constantly looping through 10's or 100's of ranges to find the same BDA range each time any item in PerFrame is accessed (because their address is different)

this adds a thread-local uint to hold the index into the BDA ranges so we can get some cache locality

for Tiny_MeshLarge this speeds things up from 4 fps to 23 fps

ci-tester-lunarg commented 2 months ago

CI Vulkan-ValidationLayers build queued with queue ID 216261.

ci-tester-lunarg commented 2 months ago

CI Vulkan-ValidationLayers build # 17054 running.

ci-tester-lunarg commented 2 months ago

CI Vulkan-ValidationLayers build queued with queue ID 216273.

ci-tester-lunarg commented 2 months ago

CI Vulkan-ValidationLayers build # 17055 running.

ci-tester-lunarg commented 2 months ago

CI Vulkan-ValidationLayers build # 17055 passed.