summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-01-14 06:50:18 -0800
committerJason Ekstrand <[email protected]>2016-01-14 07:30:46 -0800
commit08735ba91c9aa2cdfe138fdc314f8071cb0b5617 (patch)
treeeac83efc8bd64c1b5b4adaabb801158673340956 /src/vulkan
parented4fe3e9ba9018e68afe6fdd4f267218a537fdaa (diff)
anv/cmd_buffer: Fix setting of viewport/scissor count
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/anv_cmd_buffer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c
index ae33822b633..3df34a511eb 100644
--- a/src/vulkan/anv_cmd_buffer.c
+++ b/src/vulkan/anv_cmd_buffer.c
@@ -383,7 +383,10 @@ void anv_CmdSetViewport(
{
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
- cmd_buffer->state.dynamic.viewport.count = viewportCount;
+ const uint32_t total_count = firstViewport + viewportCount;
+ if (cmd_buffer->state.dynamic.viewport.count < total_count);
+ cmd_buffer->state.dynamic.viewport.count = total_count;
+
memcpy(cmd_buffer->state.dynamic.viewport.viewports + firstViewport,
pViewports, viewportCount * sizeof(*pViewports));
@@ -398,7 +401,10 @@ void anv_CmdSetScissor(
{
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
- cmd_buffer->state.dynamic.scissor.count = scissorCount;
+ const uint32_t total_count = firstScissor + scissorCount;
+ if (cmd_buffer->state.dynamic.scissor.count < total_count);
+ cmd_buffer->state.dynamic.scissor.count = total_count;
+
memcpy(cmd_buffer->state.dynamic.scissor.scissors + firstScissor,
pScissors, scissorCount * sizeof(*pScissors));