mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 20:24:30 +08:00
gallium: use struct nir_shader * type in finalize_nir instead of void *
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32175>
This commit is contained in:
parent
6cd302dc39
commit
7717e458f1
@ -489,7 +489,7 @@ dd_screen_memobj_destroy(struct pipe_screen *_screen,
|
||||
*/
|
||||
|
||||
static char *
|
||||
dd_screen_finalize_nir(struct pipe_screen *_screen, void *nir)
|
||||
dd_screen_finalize_nir(struct pipe_screen *_screen, struct nir_shader *nir)
|
||||
{
|
||||
struct pipe_screen *screen = dd_screen(_screen)->screen;
|
||||
|
||||
|
@ -602,7 +602,7 @@ static const void *noop_get_compiler_options(struct pipe_screen *pscreen,
|
||||
return screen->get_compiler_options(screen, ir, shader);
|
||||
}
|
||||
|
||||
static char *noop_finalize_nir(struct pipe_screen *pscreen, void *nir)
|
||||
static char *noop_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *nir)
|
||||
{
|
||||
struct pipe_screen *screen = ((struct noop_pipe_screen*)pscreen)->oscreen;
|
||||
|
||||
|
@ -655,7 +655,7 @@ void trace_dump_transfer_ptr(struct pipe_transfer *_transfer)
|
||||
}
|
||||
}
|
||||
|
||||
void trace_dump_nir(void *nir)
|
||||
void trace_dump_nir(struct nir_shader *nir)
|
||||
{
|
||||
if (!dumping)
|
||||
return;
|
||||
|
@ -41,6 +41,7 @@ struct pipe_resource;
|
||||
struct pipe_surface;
|
||||
struct pipe_transfer;
|
||||
struct pipe_box;
|
||||
struct nir_shader;
|
||||
|
||||
/*
|
||||
* Low level dumping controls.
|
||||
@ -107,7 +108,7 @@ void trace_dump_ptr(const void *value);
|
||||
/* will turn a wrapped object into the real one and dump ptr */
|
||||
void trace_dump_surface_ptr(struct pipe_surface *_surface);
|
||||
void trace_dump_transfer_ptr(struct pipe_transfer *_transfer);
|
||||
void trace_dump_nir(void *nir);
|
||||
void trace_dump_nir(struct nir_shader *nir);
|
||||
|
||||
void trace_dump_trigger_active(bool active);
|
||||
void trace_dump_check_trigger(void);
|
||||
|
@ -1179,7 +1179,7 @@ trace_screen_get_timestamp(struct pipe_screen *_screen)
|
||||
}
|
||||
|
||||
static char *
|
||||
trace_screen_finalize_nir(struct pipe_screen *_screen, void *nir)
|
||||
trace_screen_finalize_nir(struct pipe_screen *_screen, struct nir_shader *nir)
|
||||
{
|
||||
struct pipe_screen *screen = trace_screen(_screen)->screen;
|
||||
|
||||
|
@ -492,7 +492,7 @@ ir3_fixup_shader_state(struct pipe_context *pctx, struct ir3_shader_key *key)
|
||||
}
|
||||
|
||||
static char *
|
||||
ir3_screen_finalize_nir(struct pipe_screen *pscreen, void *nir)
|
||||
ir3_screen_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *nir)
|
||||
{
|
||||
struct fd_screen *screen = fd_screen(pscreen);
|
||||
|
||||
|
@ -253,10 +253,8 @@ i915_check_control_flow(nir_shader *s)
|
||||
}
|
||||
|
||||
static char *
|
||||
i915_finalize_nir(struct pipe_screen *pscreen, void *nir)
|
||||
i915_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *s)
|
||||
{
|
||||
nir_shader *s = nir;
|
||||
|
||||
if (s->info.stage == MESA_SHADER_FRAGMENT)
|
||||
i915_optimize_nir(s);
|
||||
|
||||
|
@ -3700,10 +3700,9 @@ iris_bind_cs_state(struct pipe_context *ctx, void *state)
|
||||
}
|
||||
|
||||
static char *
|
||||
iris_finalize_nir(struct pipe_screen *_screen, void *nirptr)
|
||||
iris_finalize_nir(struct pipe_screen *_screen, struct nir_shader *nir)
|
||||
{
|
||||
struct iris_screen *screen = (struct iris_screen *)_screen;
|
||||
struct nir_shader *nir = (struct nir_shader *) nirptr;
|
||||
const struct intel_device_info *devinfo = screen->devinfo;
|
||||
|
||||
NIR_PASS_V(nir, iris_fix_edge_flags);
|
||||
|
@ -678,9 +678,8 @@ static const struct nir_shader_compiler_options gallivm_nir_options = {
|
||||
|
||||
static char *
|
||||
llvmpipe_finalize_nir(struct pipe_screen *screen,
|
||||
void *nirptr)
|
||||
struct nir_shader *nir)
|
||||
{
|
||||
struct nir_shader *nir = (struct nir_shader *)nirptr;
|
||||
lp_build_opt_nir(nir);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -272,10 +272,8 @@ r300_check_control_flow(nir_shader *s)
|
||||
}
|
||||
|
||||
char *
|
||||
r300_finalize_nir(struct pipe_screen *pscreen, void *nir)
|
||||
r300_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *s)
|
||||
{
|
||||
nir_shader *s = nir;
|
||||
|
||||
r300_optimize_nir(s, pscreen);
|
||||
|
||||
/* st_program.c's parameter list optimization requires that future nir
|
||||
|
@ -151,7 +151,7 @@ needs_fs_trig_input_fixup(UNUSED struct hash_table *ht, const nir_alu_instr *ins
|
||||
|
||||
bool r300_is_only_used_as_float(const nir_alu_instr *instr);
|
||||
|
||||
char *r300_finalize_nir(struct pipe_screen *pscreen, void *nir);
|
||||
char *r300_finalize_nir(struct pipe_screen *pscreen, struct nir_shader *nir);
|
||||
|
||||
extern bool r300_transform_vs_trig_input(struct nir_shader *shader);
|
||||
|
||||
|
@ -24,10 +24,9 @@
|
||||
#include <iostream>
|
||||
|
||||
char *
|
||||
r600_finalize_nir(pipe_screen *screen, void *shader)
|
||||
r600_finalize_nir(pipe_screen *screen, struct nir_shader *nir)
|
||||
{
|
||||
auto rs = container_of(screen, r600_screen, b.b);
|
||||
auto nir = static_cast<nir_shader *>(shader);
|
||||
r600_finalize_nir_common(nir, rs->b.gfx_level);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
char *
|
||||
r600_finalize_nir(struct pipe_screen *screen, void *shader);
|
||||
r600_finalize_nir(struct pipe_screen *screen, struct nir_shader *nir);
|
||||
|
||||
int
|
||||
r600_shader_from_nir(struct r600_context *rctx,
|
||||
|
@ -1067,7 +1067,7 @@ void si_lower_mediump_io(struct nir_shader *nir);
|
||||
bool si_alu_to_scalar_packed_math_filter(const struct nir_instr *instr, const void *data);
|
||||
void si_nir_opts(struct si_screen *sscreen, struct nir_shader *nir, bool first);
|
||||
void si_nir_late_opts(struct nir_shader *nir);
|
||||
char *si_finalize_nir(struct pipe_screen *screen, void *nirptr);
|
||||
char *si_finalize_nir(struct pipe_screen *screen, struct nir_shader *nir);
|
||||
|
||||
/* si_state_shaders.cpp */
|
||||
unsigned si_shader_num_alloc_param_exports(struct si_shader *shader);
|
||||
|
@ -426,10 +426,9 @@ static bool si_mark_divergent_texture_non_uniform(struct nir_shader *nir)
|
||||
return divergence_changed;
|
||||
}
|
||||
|
||||
char *si_finalize_nir(struct pipe_screen *screen, void *nirptr)
|
||||
char *si_finalize_nir(struct pipe_screen *screen, struct nir_shader *nir)
|
||||
{
|
||||
struct si_screen *sscreen = (struct si_screen *)screen;
|
||||
struct nir_shader *nir = (struct nir_shader *)nirptr;
|
||||
|
||||
nir_lower_io_passes(nir, false);
|
||||
NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_shader_in | nir_var_shader_out, NULL);
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
void *si_create_shader_state(struct si_context *sctx, nir_shader *nir)
|
||||
{
|
||||
sctx->b.screen->finalize_nir(sctx->b.screen, (void*)nir);
|
||||
sctx->b.screen->finalize_nir(sctx->b.screen, nir);
|
||||
return pipe_shader_from_nir(&sctx->b, nir);
|
||||
}
|
||||
|
||||
|
@ -6453,10 +6453,9 @@ zink_shader_init(struct zink_screen *screen, struct zink_shader *zs)
|
||||
}
|
||||
|
||||
char *
|
||||
zink_shader_finalize(struct pipe_screen *pscreen, void *nirptr)
|
||||
zink_shader_finalize(struct pipe_screen *pscreen, struct nir_shader *nir)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(pscreen);
|
||||
nir_shader *nir = nirptr;
|
||||
|
||||
nir_lower_tex_options tex_opts = {
|
||||
.lower_invalid_implicit_lod = true,
|
||||
|
@ -79,7 +79,7 @@ void
|
||||
zink_shader_init(struct zink_screen *screen, struct zink_shader *zs);
|
||||
|
||||
char *
|
||||
zink_shader_finalize(struct pipe_screen *pscreen, void *nirptr);
|
||||
zink_shader_finalize(struct pipe_screen *pscreen, struct nir_shader *nir);
|
||||
|
||||
void
|
||||
zink_shader_free(struct zink_screen *screen, struct zink_shader *shader);
|
||||
|
@ -67,6 +67,7 @@ struct u_transfer_helper;
|
||||
struct pipe_screen;
|
||||
struct util_queue_fence;
|
||||
struct pipe_video_buffer;
|
||||
struct nir_shader;
|
||||
|
||||
typedef struct pipe_vertex_state *
|
||||
(*pipe_create_vertex_state_func)(struct pipe_screen *screen,
|
||||
@ -640,7 +641,7 @@ struct pipe_screen {
|
||||
* The driver may return a non-NULL string to trigger GLSL link failure
|
||||
* and logging of that message in the GLSL linker log.
|
||||
*/
|
||||
char *(*finalize_nir)(struct pipe_screen *screen, void *nir);
|
||||
char *(*finalize_nir)(struct pipe_screen *screen, struct nir_shader *nir);
|
||||
|
||||
/*Separated memory/resource allocations interfaces for Vulkan */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user