gen7/8/cmd_buffer: Allocate the correct ammount for COLOR_CALC_STATE
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Dec 2015 18:37:50 +0000 (10:37 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Dec 2015 18:37:57 +0000 (10:37 -0800)
We were allocating 6 bytes when we should have been allocating 6 dwords.

src/vulkan/gen7_cmd_buffer.c
src/vulkan/gen8_cmd_buffer.c

index 7fdef1027e2c5d00a31fda70d7087fc7fa1af283..feed3611805cea50e3f1d81e8e5ab51496e08b2e 100644 (file)
@@ -428,7 +428,8 @@ cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
                                   ANV_CMD_DIRTY_DYNAMIC_STENCIL_REFERENCE)) {
       struct anv_state cc_state =
          anv_cmd_buffer_alloc_dynamic_state(cmd_buffer,
-                                            GEN7_COLOR_CALC_STATE_length, 64);
+                                            GEN7_COLOR_CALC_STATE_length * 4,
+                                            64);
       struct GEN7_COLOR_CALC_STATE cc = {
          .BlendConstantColorRed = cmd_buffer->state.dynamic.blend_constants[0],
          .BlendConstantColorGreen = cmd_buffer->state.dynamic.blend_constants[1],
index d571f9c97e36dd8e920510ceda18c7ab1a99b419..9614da705e7f118a6964265581be115e2a81c373 100644 (file)
@@ -265,7 +265,8 @@ cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
                                   ANV_CMD_DIRTY_DYNAMIC_STENCIL_REFERENCE)) {
       struct anv_state cc_state =
          anv_cmd_buffer_alloc_dynamic_state(cmd_buffer,
-                                            GEN8_COLOR_CALC_STATE_length, 64);
+                                            GEN8_COLOR_CALC_STATE_length * 4,
+                                            64);
       struct GEN8_COLOR_CALC_STATE cc = {
          .BlendConstantColorRed = cmd_buffer->state.dynamic.blend_constants[0],
          .BlendConstantColorGreen = cmd_buffer->state.dynamic.blend_constants[1],
@@ -319,7 +320,8 @@ cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
    if (cmd_buffer->state.dirty & ANV_CMD_DIRTY_DYNAMIC_BLEND_CONSTANTS) {
       struct anv_state cc_state =
          anv_cmd_buffer_alloc_dynamic_state(cmd_buffer,
-                                            GEN9_COLOR_CALC_STATE_length, 64);
+                                            GEN9_COLOR_CALC_STATE_length * 4,
+                                            64);
       struct GEN9_COLOR_CALC_STATE cc = {
          .BlendConstantColorRed = cmd_buffer->state.dynamic.blend_constants[0],
          .BlendConstantColorGreen = cmd_buffer->state.dynamic.blend_constants[1],