nvk: Drop block_size from the root descriptor table
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:32:02 +0000 (21:32 +0000)
It's unused because Vulkan doesn't support compute dispatches with an
unknown workgroup size.  If we ever do, we can add it back in. In case
it ever comes back, add an unreachable() to nvk_nir_lower_descriptors().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/vulkan/nvk_cmd_buffer.h
src/nouveau/vulkan/nvk_cmd_dispatch.c
src/nouveau/vulkan/nvk_nir_lower_descriptors.c

index 328bd44..d9c2683 100644 (file)
@@ -28,9 +28,8 @@ struct nvk_root_descriptor_table {
          uint32_t _pad[5];
       } draw;
       struct {
-         uint32_t block_size[3];
          uint32_t group_count[3];
-         uint32_t _pad[2];
+         uint32_t _pad[5];
       } cs;
    };
 
index 967ac1e..fad386f 100644 (file)
@@ -109,18 +109,12 @@ nvk_flush_compute_state(struct nvk_cmd_buffer *cmd,
                         uint64_t *root_desc_addr_out)
 {
    const struct nvk_compute_pipeline *pipeline = cmd->state.cs.pipeline;
-   const struct nvk_shader *shader =
-      &pipeline->base.shaders[MESA_SHADER_COMPUTE];
    const struct nvk_device *dev = nvk_cmd_buffer_device(cmd);
    struct nvk_descriptor_state *desc = &cmd->state.cs.descriptors;
    VkResult result;
 
    nvk_cmd_buffer_flush_push_descriptors(cmd, desc);
 
-   desc->root.cs.block_size[0] = shader->cp.block_size[0];
-   desc->root.cs.block_size[1] = shader->cp.block_size[1];
-   desc->root.cs.block_size[2] = shader->cp.block_size[2];
-
    /* pre Pascal the constant buffer sizes need to be 0x100 aligned. As we simply allocated a
     * buffer and upload data to it, make sure its size is 0x100 aligned.
     */
index 9288ced..ef30b8e 100644 (file)
@@ -233,6 +233,9 @@ lower_intrin(nir_builder *b, nir_intrinsic_instr *intrin,
    case nir_intrinsic_load_vulkan_descriptor:
       return lower_load_vulkan_descriptor(b, intrin, ctx);
 
+   case nir_intrinsic_load_workgroup_size:
+      unreachable("Should have been lowered by nir_lower_cs_intrinsics()");
+
    case nir_intrinsic_load_num_workgroups:
       return lower_num_workgroups(b, intrin, ctx);