nvk: Disable CBuf pushing when INDIRECT_BINDABLE_BIT is set
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31394>
This commit is contained in:
committed by
Marge Bot
parent
0e1545586d
commit
09ed607a37
@@ -57,6 +57,7 @@ struct lower_descriptors_ctx {
|
||||
bool use_bindless_cbuf;
|
||||
bool use_edb_buffer_views;
|
||||
bool clamp_desc_array_bounds;
|
||||
bool indirect_bind;
|
||||
nir_address_format ubo_addr_format;
|
||||
nir_address_format ssbo_addr_format;
|
||||
|
||||
@@ -421,6 +422,9 @@ build_cbuf_map(nir_shader *nir, struct lower_descriptors_ctx *ctx)
|
||||
};
|
||||
}
|
||||
|
||||
if (ctx->indirect_bind)
|
||||
return;
|
||||
|
||||
ctx->cbufs = nvk_cbuf_table_create(NULL);
|
||||
nir_shader_instructions_pass(nir, record_cbuf_uses_instr,
|
||||
nir_metadata_all, (void *)ctx);
|
||||
@@ -1545,6 +1549,7 @@ lower_ssbo_descriptor_instr(nir_builder *b, nir_instr *instr,
|
||||
bool
|
||||
nvk_nir_lower_descriptors(nir_shader *nir,
|
||||
const struct nvk_physical_device *pdev,
|
||||
VkShaderCreateFlagsEXT shader_flags,
|
||||
const struct vk_pipeline_robustness_state *rs,
|
||||
uint32_t set_layout_count,
|
||||
struct vk_descriptor_set_layout * const *set_layouts,
|
||||
@@ -1558,6 +1563,8 @@ nvk_nir_lower_descriptors(nir_shader *nir,
|
||||
rs->storage_buffers != VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT ||
|
||||
rs->uniform_buffers != VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT ||
|
||||
rs->images != VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT,
|
||||
.indirect_bind =
|
||||
shader_flags & VK_SHADER_CREATE_INDIRECT_BINDABLE_BIT_EXT,
|
||||
.ssbo_addr_format = nvk_ssbo_addr_format(pdev, rs),
|
||||
.ubo_addr_format = nvk_ubo_addr_format(pdev, rs),
|
||||
};
|
||||
|
||||
@@ -392,8 +392,9 @@ nir_has_image_var(nir_shader *nir)
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
|
||||
VkShaderCreateFlagsEXT shader_flags,
|
||||
const struct vk_pipeline_robustness_state *rs,
|
||||
bool is_multiview,
|
||||
uint32_t set_layout_count,
|
||||
@@ -480,7 +481,7 @@ nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
|
||||
};
|
||||
}
|
||||
|
||||
NIR_PASS(_, nir, nvk_nir_lower_descriptors, pdev, rs,
|
||||
NIR_PASS(_, nir, nvk_nir_lower_descriptors, pdev, shader_flags, rs,
|
||||
set_layout_count, set_layouts, cbuf_map);
|
||||
NIR_PASS(_, nir, nir_lower_explicit_io, nir_var_mem_global,
|
||||
nir_address_format_64bit_global);
|
||||
@@ -935,7 +936,7 @@ nvk_compile_shader(struct nvk_device *dev,
|
||||
/* TODO: Multiview with ESO */
|
||||
const bool is_multiview = state && state->rp->view_mask != 0;
|
||||
|
||||
nvk_lower_nir(dev, nir, info->robustness, is_multiview,
|
||||
nvk_lower_nir(dev, nir, info->flags, info->robustness, is_multiview,
|
||||
info->set_layout_count, info->set_layouts,
|
||||
&shader->cbuf_map);
|
||||
|
||||
|
||||
@@ -135,17 +135,11 @@ nvk_ssbo_addr_format(const struct nvk_physical_device *pdev,
|
||||
bool
|
||||
nvk_nir_lower_descriptors(nir_shader *nir,
|
||||
const struct nvk_physical_device *pdev,
|
||||
VkShaderCreateFlagsEXT shader_flags,
|
||||
const struct vk_pipeline_robustness_state *rs,
|
||||
uint32_t set_layout_count,
|
||||
struct vk_descriptor_set_layout * const *set_layouts,
|
||||
struct nvk_cbuf_map *cbuf_map_out);
|
||||
void
|
||||
nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
|
||||
const struct vk_pipeline_robustness_state *rs,
|
||||
bool is_multiview,
|
||||
uint32_t set_layout_count,
|
||||
struct vk_descriptor_set_layout * const *set_layouts,
|
||||
struct nvk_cbuf_map *cbuf_map_out);
|
||||
|
||||
VkResult
|
||||
nvk_compile_nir_shader(struct nvk_device *dev, nir_shader *nir,
|
||||
|
||||
Reference in New Issue
Block a user