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

Author: Rohan Garg <[email protected]>
Date:   Thu Jul 13 13:12:24 2023 +0200

anv: drop CFE state validation checks

anv no longer needs to track if the CFE state is valid since we ensure
that the state is valid at pipeline creation time.

Signed-off-by: Rohan Garg <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23934>

---

 src/intel/vulkan/anv_private.h     | 1 -
 src/intel/vulkan/genX_cmd_buffer.c | 8 +++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index b0d0e37a981..e341a04bef7 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2845,7 +2845,6 @@ struct anv_cmd_compute_state {
    struct anv_address num_workgroups;
 
    uint32_t scratch_size;
-   bool cfe_state_valid;
 };
 
 struct anv_cmd_ray_tracing_state {
diff --git a/src/intel/vulkan/genX_cmd_buffer.c 
b/src/intel/vulkan/genX_cmd_buffer.c
index b766dadd683..c8e882a5160 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -4056,7 +4056,6 @@ genX(CmdExecuteCommands)(
    primary->state.current_l3_config = NULL;
    primary->state.current_hash_scale = 0;
    primary->state.gfx.push_constant_stages = 0;
-   primary->state.compute.cfe_state_valid = false;
    vk_dynamic_graphics_state_dirty_all(&primary->vk.dynamic_graphics_state);
 
    /* Each of the secondary command buffers will use its own state base
@@ -5536,13 +5535,13 @@ genX(cmd_buffer_ensure_cfe_state)(struct anv_cmd_buffer 
*cmd_buffer,
 
    struct anv_cmd_compute_state *comp_state = &cmd_buffer->state.compute;
 
-   if (comp_state->cfe_state_valid &&
-       total_scratch <= comp_state->scratch_size)
+   if (total_scratch <= comp_state->scratch_size)
       return;
 
    const struct intel_device_info *devinfo = cmd_buffer->device->info;
    anv_batch_emit(&cmd_buffer->batch, GENX(CFE_STATE), cfe) {
-      cfe.MaximumNumberofThreads = devinfo->max_cs_threads * 
devinfo->subslice_total;
+      cfe.MaximumNumberofThreads =
+         devinfo->max_cs_threads * devinfo->subslice_total;
 
       uint32_t scratch_surf = 0xffffffff;
       if (total_scratch > 0) {
@@ -5565,7 +5564,6 @@ genX(cmd_buffer_ensure_cfe_state)(struct anv_cmd_buffer 
*cmd_buffer,
    }
 
    comp_state->scratch_size = total_scratch;
-   comp_state->cfe_state_valid = true;
 #else
    unreachable("Invalid call");
 #endif

Reply via email to