anv: move push constant allocation tracking into gfx pipeline state
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sat, 8 Aug 2020 09:05:36 +0000 (12:05 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 28 Aug 2020 06:58:43 +0000 (09:58 +0300)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6183>

src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c

index 8ff28bcc34adbf4ce0d3ff5290223409a2967c9c..a600db566cb3192082408be2900bd48571206e22 100644 (file)
@@ -2829,6 +2829,8 @@ struct anv_cmd_graphics_state {
    struct anv_vb_cache_range vb_bound_ranges[33];
    struct anv_vb_cache_range vb_dirty_ranges[33];
 
+   VkShaderStageFlags push_constant_stages;
+
    struct anv_dynamic_state dynamic;
 
    uint32_t primitive_topology;
@@ -2879,7 +2881,6 @@ struct anv_cmd_state {
    struct anv_vertex_binding                    vertex_bindings[MAX_VBS];
    bool                                         xfb_enabled;
    struct anv_xfb_binding                       xfb_bindings[MAX_XFB_BUFFERS];
-   VkShaderStageFlags                           push_constant_stages;
    struct anv_push_constants                    push_constants[MESA_SHADER_STAGES];
    struct anv_state                             binding_tables[MESA_SHADER_STAGES];
    struct anv_state                             samplers[MESA_SHADER_STAGES];
index 09b91415784bf245d3fd7203c98c9cc77d7e1bdc..c5faba1a2a86e6ffcc152394e7680fc79a7d762c 100644 (file)
@@ -2362,7 +2362,7 @@ cmd_buffer_alloc_push_constants(struct anv_cmd_buffer *cmd_buffer)
     */
    stages |= VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_VERTEX_BIT;
 
-   if (stages == cmd_buffer->state.push_constant_stages)
+   if (stages == cmd_buffer->state.gfx.push_constant_stages)
       return;
 
 #if GEN_GEN >= 8
@@ -2402,7 +2402,7 @@ cmd_buffer_alloc_push_constants(struct anv_cmd_buffer *cmd_buffer)
       alloc.ConstantBufferSize = push_constant_kb - kb_used;
    }
 
-   cmd_buffer->state.push_constant_stages = stages;
+   cmd_buffer->state.gfx.push_constant_stages = stages;
 
    /* From the BDW PRM for 3DSTATE_PUSH_CONSTANT_ALLOC_VS:
     *