iris: Add helper to access use_tcs_multi_patch

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:40:41 -08:00 committed by Marge Bot
parent 634a8ece67
commit 947ef049df
3 changed files with 10 additions and 6 deletions

View file

@ -1324,6 +1324,7 @@ iris_cs_push_const_total_size(const struct iris_compiled_shader *shader,
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);
/* iris_disk_cache.c */

View file

@ -36,7 +36,6 @@
#include "util/u_inlines.h"
#include "util/u_transfer.h"
#include "util/u_upload_mgr.h"
#include "intel/compiler/brw_compiler.h"
#include "compiler/shader_info.h"
#include "iris_context.h"
#include "iris_defines.h"
@ -66,7 +65,6 @@ iris_update_draw_info(struct iris_context *ice,
{
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
const struct intel_device_info *devinfo = screen->devinfo;
const struct brw_compiler *compiler = screen->compiler;
if (ice->state.prim_mode != info->mode) {
ice->state.prim_mode = info->mode;
@ -87,7 +85,7 @@ iris_update_draw_info(struct iris_context *ice,
ice->state.dirty |= IRIS_DIRTY_VF_TOPOLOGY;
/* MULTI_PATCH TCS needs this for key->input_vertices */
if (compiler->use_tcs_multi_patch)
if (iris_use_tcs_multi_patch(screen))
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_UNCOMPILED_TCS;
/* Flag constants dirty for gl_PatchVerticesIn if needed. */

View file

@ -1761,7 +1761,6 @@ iris_update_compiled_tcs(struct iris_context *ice)
ice->shaders.uncompiled[MESA_SHADER_TESS_CTRL];
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
struct u_upload_mgr *uploader = ice->shaders.uploader_driver;
const struct brw_compiler *compiler = screen->compiler;
const struct intel_device_info *devinfo = screen->devinfo;
const struct shader_info *tes_info =
@ -1770,7 +1769,7 @@ iris_update_compiled_tcs(struct iris_context *ice)
.vue.base.program_string_id = tcs ? tcs->program_id : 0,
._tes_primitive_mode = tes_info->tess._primitive_mode,
.input_vertices =
!tcs || compiler->use_tcs_multi_patch ? ice->state.vertices_per_patch : 0,
!tcs || iris_use_tcs_multi_patch(screen) ? ice->state.vertices_per_patch : 0,
.quads_workaround = devinfo->ver < 9 &&
tes_info->tess._primitive_mode == TESS_PRIMITIVE_QUADS &&
tes_info->tess.spacing == TESS_SPACING_EQUAL,
@ -2857,7 +2856,7 @@ iris_create_shader_state(struct pipe_context *ctx,
* and output patches are the same size. This is a bad guess, but we
* can't do much better.
*/
if (screen->compiler->use_tcs_multi_patch)
if (iris_use_tcs_multi_patch(screen))
key.tcs.input_vertices = info->tess.tcs_vertices_out;
key_size = sizeof(key.tcs);
@ -3276,6 +3275,12 @@ iris_fs_barycentric_modes(const struct iris_compiled_shader *shader,
return wm_prog_data_barycentric_modes(brw, pushed_msaa_flags);
}
bool
iris_use_tcs_multi_patch(struct iris_screen *screen)
{
return screen->compiler->use_tcs_multi_patch;
}
static void
iris_shader_debug_log(void *data, unsigned *id, const char *fmt, ...)
{