Module: Mesa
Branch: main
Commit: 8ad78671b334b1f1798d9aff48abdd543b2348bd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ad78671b334b1f1798d9aff48abdd543b2348bd

Author: Lionel Landwerlin <[email protected]>
Date:   Tue Mar 15 21:28:48 2022 +0200

anv: use local dynamic pointer more

Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

---

 src/intel/vulkan/gfx7_cmd_buffer.c | 13 +++++--------
 src/intel/vulkan/gfx8_cmd_buffer.c |  9 ++++-----
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/intel/vulkan/gfx7_cmd_buffer.c 
b/src/intel/vulkan/gfx7_cmd_buffer.c
index cf183429878..e75dd890f4f 100644
--- a/src/intel/vulkan/gfx7_cmd_buffer.c
+++ b/src/intel/vulkan/gfx7_cmd_buffer.c
@@ -136,9 +136,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer 
*cmd_buffer)
 
       if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                              
ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY)) {
-         VkPrimitiveTopology primitive_topology =
-            cmd_buffer->state.gfx.dynamic.primitive_topology;
-
+         VkPrimitiveTopology primitive_topology = d->primitive_topology;
          VkPolygonMode dynamic_raster_mode =
             genX(raster_polygon_mode)(cmd_buffer->state.gfx.pipeline,
                                       primitive_topology);
@@ -284,8 +282,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer 
*cmd_buffer)
                                           
ANV_CMD_DIRTY_DYNAMIC_COLOR_BLEND_STATE |
                                           
ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY)) {
       VkPolygonMode dynamic_raster_mode;
-      VkPrimitiveTopology primitive_topology =
-         cmd_buffer->state.gfx.dynamic.primitive_topology;
+      VkPrimitiveTopology primitive_topology = d->primitive_topology;
       dynamic_raster_mode =
          genX(raster_polygon_mode)(cmd_buffer->state.gfx.pipeline,
                                    primitive_topology);
@@ -308,14 +305,14 @@ genX(cmd_buffer_flush_dynamic_state)(struct 
anv_cmd_buffer *cmd_buffer)
    if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                           
ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
       genX(emit_multisample)(&cmd_buffer->batch,
-                             
cmd_buffer->state.gfx.dynamic.sample_locations.samples,
-                             
cmd_buffer->state.gfx.dynamic.sample_locations.locations);
+                             d->sample_locations.samples,
+                             d->sample_locations.locations);
    }
 
    if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                           
ANV_CMD_DIRTY_DYNAMIC_COLOR_BLEND_STATE |
                                           ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP)) {
-      const uint8_t color_writes = cmd_buffer->state.gfx.dynamic.color_writes;
+      const uint8_t color_writes = d->color_writes;
 
       uint32_t blend_dws[GENX(BLEND_STATE_length) +
                          MAX_RTS * GENX(BLEND_STATE_ENTRY_length)];
diff --git a/src/intel/vulkan/gfx8_cmd_buffer.c 
b/src/intel/vulkan/gfx8_cmd_buffer.c
index 8f30e1253a2..623cdd4bcfa 100644
--- a/src/intel/vulkan/gfx8_cmd_buffer.c
+++ b/src/intel/vulkan/gfx8_cmd_buffer.c
@@ -325,8 +325,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer 
*cmd_buffer)
 #if GFX_VER >= 11
    if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                           ANV_CMD_DIRTY_DYNAMIC_SHADING_RATE)) 
{
-      genX(emit_shading_rate)(&cmd_buffer->batch, pipeline,
-                              &cmd_buffer->state.gfx.dynamic);
+      genX(emit_shading_rate)(&cmd_buffer->batch, pipeline, d);
    }
 #endif /* GFX_VER >= 11 */
 
@@ -634,14 +633,14 @@ genX(cmd_buffer_flush_dynamic_state)(struct 
anv_cmd_buffer *cmd_buffer)
    if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                           
ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
       genX(emit_sample_pattern)(&cmd_buffer->batch,
-                                
cmd_buffer->state.gfx.dynamic.sample_locations.samples,
-                                
cmd_buffer->state.gfx.dynamic.sample_locations.locations);
+                                d->sample_locations.samples,
+                                d->sample_locations.locations);
    }
 
    if (anv_cmd_buffer_needs_dynamic_state(cmd_buffer,
                                           
ANV_CMD_DIRTY_DYNAMIC_COLOR_BLEND_STATE |
                                           ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP)) {
-      const uint8_t color_writes = cmd_buffer->state.gfx.dynamic.color_writes;
+      const uint8_t color_writes = d->color_writes;
       /* 3DSTATE_WM in the hope we can avoid spawning fragment shaders
        * threads.
        */

Reply via email to