iris: Add helper for indirect_ubos_use_sampler

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27646>
This commit is contained in:
Caio Oliveira 2024-02-07 21:45:55 -08:00 committed by Marge Bot
parent 947ef049df
commit 880e452abf
4 changed files with 11 additions and 5 deletions

View file

@ -1325,6 +1325,7 @@ uint32_t
iris_fs_barycentric_modes(const struct iris_compiled_shader *shader,
enum intel_msaa_flags pushed_msaa_flags);
bool iris_use_tcs_multi_patch(struct iris_screen *screen);
bool iris_indirect_ubos_use_sampler(struct iris_screen *screen);
/* iris_disk_cache.c */

View file

@ -185,7 +185,6 @@ iris_emit_buffer_barrier_for(struct iris_batch *batch,
enum iris_domain access)
{
const struct intel_device_info *devinfo = batch->screen->devinfo;
const struct brw_compiler *compiler = batch->screen->compiler;
const bool access_via_l3 = iris_domain_is_l3_coherent(devinfo, access);
@ -213,7 +212,7 @@ iris_emit_buffer_barrier_for(struct iris_batch *batch,
[IRIS_DOMAIN_VF_READ] = PIPE_CONTROL_VF_CACHE_INVALIDATE,
[IRIS_DOMAIN_SAMPLER_READ] = PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE,
[IRIS_DOMAIN_PULL_CONSTANT_READ] = PIPE_CONTROL_CONST_CACHE_INVALIDATE |
(compiler->indirect_ubos_use_sampler ?
(iris_indirect_ubos_use_sampler(batch->screen) ?
PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE :
PIPE_CONTROL_DATA_CACHE_FLUSH),
};

View file

@ -411,7 +411,7 @@ iris_upload_ubo_ssbo_surf_state(struct iris_context *ice,
struct iris_bo *surf_bo = iris_resource_bo(surf_state->res);
surf_state->offset += iris_bo_offset_from_base_address(surf_bo);
const bool dataport = ssbo || !screen->compiler->indirect_ubos_use_sampler;
const bool dataport = ssbo || !iris_indirect_ubos_use_sampler(screen);
isl_buffer_fill_state(&screen->isl_dev, map,
.address = res->bo->address + res->offset +
@ -3281,6 +3281,12 @@ iris_use_tcs_multi_patch(struct iris_screen *screen)
return screen->compiler->use_tcs_multi_patch;
}
bool
iris_indirect_ubos_use_sampler(struct iris_screen *screen)
{
return screen->devinfo->ver < 12;
}
static void
iris_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
{
@ -3326,5 +3332,5 @@ iris_compiler_init(struct iris_screen *screen)
screen->compiler->shader_debug_log = iris_shader_debug_log;
screen->compiler->shader_perf_log = iris_shader_perf_log;
screen->compiler->supports_shader_constants = true;
screen->compiler->indirect_ubos_use_sampler = screen->devinfo->ver < 12;
screen->compiler->indirect_ubos_use_sampler = iris_indirect_ubos_use_sampler(screen);
}

View file

@ -9342,7 +9342,7 @@ batch_mark_sync_for_pipe_control(struct iris_batch *batch, uint32_t flags)
/* Technically, to invalidate IRIS_DOMAIN_PULL_CONSTANT_READ, we need
* both "Constant Cache Invalidate" and either "Texture Cache Invalidate"
* or "Data Cache Flush" set, depending on the setting of
* compiler->indirect_ubos_use_sampler.
* iris_indirect_ubos_use_sampler().
*
* However, "Data Cache Flush" and "Constant Cache Invalidate" will never
* appear in the same PIPE_CONTROL command, because one is bottom-of-pipe