anv: reenable ANV_ALWAYS_BINDLESS
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27504> (cherry picked from commit 27a7c5447ddd3cf344ace982ba9a1b8beb58fb0c)
This commit is contained in:
parent
2128a8a07b
commit
71442fdd6f
2 changed files with 31 additions and 3 deletions
|
|
@ -2694,7 +2694,7 @@
|
||||||
"description": "anv: reenable ANV_ALWAYS_BINDLESS",
|
"description": "anv: reenable ANV_ALWAYS_BINDLESS",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -1975,6 +1975,34 @@ add_push_entry(struct anv_pipeline_push_map *push_map,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
binding_should_use_surface_binding_table(const struct apply_pipeline_layout_state *state,
|
||||||
|
const struct anv_descriptor_set_binding_layout *binding)
|
||||||
|
{
|
||||||
|
if ((binding->data & ANV_DESCRIPTOR_BTI_SURFACE_STATE) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (state->pdevice->always_use_bindless &&
|
||||||
|
(binding->data & ANV_DESCRIPTOR_SURFACE))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
binding_should_use_sampler_binding_table(const struct apply_pipeline_layout_state *state,
|
||||||
|
const struct anv_descriptor_set_binding_layout *binding)
|
||||||
|
{
|
||||||
|
if ((binding->data & ANV_DESCRIPTOR_BTI_SAMPLER_STATE) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (state->pdevice->always_use_bindless &&
|
||||||
|
(binding->data & ANV_DESCRIPTOR_SAMPLER))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
anv_nir_apply_pipeline_layout(nir_shader *shader,
|
anv_nir_apply_pipeline_layout(nir_shader *shader,
|
||||||
const struct anv_physical_device *pdevice,
|
const struct anv_physical_device *pdevice,
|
||||||
|
|
@ -2146,7 +2174,7 @@ anv_nir_apply_pipeline_layout(nir_shader *shader,
|
||||||
state.set[set].binding[b].surface_offset = BINDLESS_OFFSET;
|
state.set[set].binding[b].surface_offset = BINDLESS_OFFSET;
|
||||||
state.set[set].binding[b].sampler_offset = BINDLESS_OFFSET;
|
state.set[set].binding[b].sampler_offset = BINDLESS_OFFSET;
|
||||||
|
|
||||||
if (binding->data & ANV_DESCRIPTOR_BTI_SURFACE_STATE) {
|
if (binding_should_use_surface_binding_table(&state, binding)) {
|
||||||
if (map->surface_count + array_size * array_multiplier > MAX_BINDING_TABLE_SIZE ||
|
if (map->surface_count + array_size * array_multiplier > MAX_BINDING_TABLE_SIZE ||
|
||||||
anv_descriptor_requires_bindless(pdevice, binding, false) ||
|
anv_descriptor_requires_bindless(pdevice, binding, false) ||
|
||||||
brw_shader_stage_requires_bindless_resources(shader->info.stage)) {
|
brw_shader_stage_requires_bindless_resources(shader->info.stage)) {
|
||||||
|
|
@ -2177,7 +2205,7 @@ anv_nir_apply_pipeline_layout(nir_shader *shader,
|
||||||
assert(map->surface_count <= MAX_BINDING_TABLE_SIZE);
|
assert(map->surface_count <= MAX_BINDING_TABLE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (binding->data & ANV_DESCRIPTOR_BTI_SAMPLER_STATE) {
|
if (binding_should_use_sampler_binding_table(&state, binding)) {
|
||||||
if (map->sampler_count + array_size * array_multiplier > MAX_SAMPLER_TABLE_SIZE ||
|
if (map->sampler_count + array_size * array_multiplier > MAX_SAMPLER_TABLE_SIZE ||
|
||||||
anv_descriptor_requires_bindless(pdevice, binding, true) ||
|
anv_descriptor_requires_bindless(pdevice, binding, true) ||
|
||||||
brw_shader_stage_requires_bindless_resources(shader->info.stage)) {
|
brw_shader_stage_requires_bindless_resources(shader->info.stage)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue