summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorNicolas Koch <[email protected]>2016-09-20 17:37:36 +0200
committerJason Ekstrand <[email protected]>2016-09-23 00:20:16 -0700
commitf17948a30a339b4196806de795c25a29058ecdc2 (patch)
tree263ecd3a2e19dd23bac12b311084f9ead6aa36e7 /src/intel
parent6b21728c4a4f89754a79fe754e0c8496c25d9b66 (diff)
anv: Check for VK_WHOLE_SIZE in anv_CmdFillBuffer
From the Vulkan spec: Size is the number of bytes to fill, and must be either a multiple of 4, or VK_WHOLE_SIZE to fill the range from offset to the end of the buffer. If VK_WHOLE_SIZE is used and the remaining size of the buffer is not a multiple of 4, then the nearest smaller multiple is used. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_meta_clear.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_meta_clear.c b/src/intel/vulkan/anv_meta_clear.c
index ed4d1db9d45..fd0797f31d7 100644
--- a/src/intel/vulkan/anv_meta_clear.c
+++ b/src/intel/vulkan/anv_meta_clear.c
@@ -1012,6 +1012,12 @@ void anv_CmdFillBuffer(
meta_clear_begin(&saved_state, cmd_buffer);
+ if (fillSize == VK_WHOLE_SIZE) {
+ fillSize = dst_buffer->size - dstOffset;
+ /* Make sure fillSize is a multiple of 4 */
+ fillSize -= fillSize & 3;
+ }
+
VkFormat format;
int bs;
if ((fillSize & 15) == 0 && (dstOffset & 15) == 0) {