diff options
author | Jason Ekstrand <[email protected]> | 2015-11-06 13:32:52 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-11-06 13:32:52 -0800 |
commit | 612e35b2c65c99773b73e53d0e6fd112b1a7431f (patch) | |
tree | 32ba8f5964b6cb28fdad912c1fe80d5abd10b144 /src/vulkan/anv_device.c | |
parent | f8052351ac1cce196b99a78114d513695fbca4d6 (diff) |
anv: Do range-checking in the shader for dynamic buffers
Diffstat (limited to 'src/vulkan/anv_device.c')
-rw-r--r-- | src/vulkan/anv_device.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index c5bea7253ed..9483816b53f 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -1777,6 +1777,13 @@ void anv_UpdateDescriptorSets( .offset = write->pDescriptors[j].bufferInfo.offset, .range = write->pDescriptors[j].bufferInfo.range, }; + + /* For buffers with dynamic offsets, we use the full possible + * range in the surface state and do the actual range-checking + * in the shader. + */ + if (bind_layout->dynamic_offset_index >= 0) + desc[j].range = buffer->size - desc[j].offset; } default: |