aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-03-18 18:49:23 +0100
committerSamuel Pitoiset <[email protected]>2020-03-20 09:25:14 +0100
commit2d3223ca90ae946231c1bfbfd1b450e5e96106a3 (patch)
treeda2c31fc7ba222ca3e477875904c4433836ab165 /src
parentfdc603292862dd2663b75d18e9abc6096b8020ff (diff)
radv: fix optional pSizes parameter when binding streamout buffers
The Vulkan spec 1.2.135 says: "pSizes is an optional array of buffer sizes, specifying the maximum number of bytes to capture to the corresponding transform feedback buffer. If pSizes is NULL, or the value of the pSizes array element is VK_WHOLE_SIZE, then the maximum bytes captured will be the size of the corresponding buffer minus the buffer offset." Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2650 Fixes: b4eb029062a ("radv: implement VK_EXT_transform_feedback") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4232> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4232>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index b58b3541c80..81b705893f7 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -6026,7 +6026,12 @@ void radv_CmdBindTransformFeedbackBuffersEXT(
sb[idx].buffer = radv_buffer_from_handle(pBuffers[i]);
sb[idx].offset = pOffsets[i];
- sb[idx].size = pSizes[i];
+
+ if (!pSizes || pSizes[i] == VK_WHOLE_SIZE) {
+ sb[idx].size = sb[idx].buffer->size - sb[idx].offset;
+ } else {
+ sb[idx].size = pSizes[i];
+ }
radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs,
sb[idx].buffer->bo);