mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
mesa: use pipe_screen::nir_options instead of NirOptions
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36094>
This commit is contained in:
parent
613b58e88f
commit
eba8f95805
13 changed files with 18 additions and 30 deletions
|
|
@ -985,7 +985,7 @@ _mesa_get_fixed_func_fragment_program(struct gl_context *ctx)
|
|||
return NULL;
|
||||
|
||||
const struct nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(ctx->st, MESA_SHADER_FRAGMENT);
|
||||
ctx->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
nir_shader *s =
|
||||
create_new_program(&key, prog, options);
|
||||
|
|
|
|||
|
|
@ -1374,7 +1374,7 @@ _mesa_get_fixed_func_vertex_program(struct gl_context *ctx)
|
|||
return NULL;
|
||||
|
||||
const struct nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(ctx->st, MESA_SHADER_VERTEX);
|
||||
ctx->screen->nir_options[MESA_SHADER_VERTEX];
|
||||
|
||||
nir_shader *s =
|
||||
create_new_program( &key, prog,
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ struct nir_shader *
|
|||
prog_to_nir(const struct gl_context *ctx, const struct gl_program *prog)
|
||||
{
|
||||
const struct nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(ctx->st, prog->info.stage);
|
||||
ctx->screen->nir_options[prog->info.stage];
|
||||
struct ptn_compile *c;
|
||||
struct nir_shader *s;
|
||||
gl_shader_stage stage = prog->info.stage;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ make_drawpix_z_stencil_program_nir(struct st_context *st,
|
|||
bool write_stencil)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT);
|
||||
st->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, options,
|
||||
"drawpixels %s%s",
|
||||
|
|
@ -184,7 +184,7 @@ make_drawpix_zs_to_color_program_nir(struct st_context *st,
|
|||
bool rgba)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT);
|
||||
st->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, options,
|
||||
"copypixels ZStoC");
|
||||
|
|
|
|||
|
|
@ -979,9 +979,3 @@ st_destroy_context(struct st_context *st)
|
|||
_mesa_make_current(save_ctx, save_drawbuffer, save_readbuffer);
|
||||
}
|
||||
}
|
||||
|
||||
const struct nir_shader_compiler_options *
|
||||
st_get_nir_compiler_options(struct st_context *st, gl_shader_stage stage)
|
||||
{
|
||||
return st->ctx->Const.ShaderCompilerOptions[stage].NirOptions;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -484,10 +484,6 @@ st_save_zombie_shader(struct st_context *st,
|
|||
void
|
||||
st_context_free_zombie_objects(struct st_context *st);
|
||||
|
||||
const struct nir_shader_compiler_options *
|
||||
st_get_nir_compiler_options(struct st_context *st, gl_shader_stage stage);
|
||||
|
||||
|
||||
void st_invalidate_state(struct gl_context *ctx);
|
||||
void st_set_background_context(struct gl_context *ctx,
|
||||
struct util_queue_monitoring *queue_info);
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ static void *
|
|||
hw_select_create_gs(struct st_context *st, union state_key state)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_GEOMETRY);
|
||||
st->screen->nir_options[MESA_SHADER_GEOMETRY];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_GEOMETRY, options,
|
||||
"hw select GS");
|
||||
|
|
|
|||
|
|
@ -1840,13 +1840,11 @@ void st_init_extensions(struct pipe_screen *screen,
|
|||
screen->caps.allow_draw_out_of_order;
|
||||
consts->GLThreadNopCheckFramebufferStatus = options->glthread_nop_check_framebuffer_status;
|
||||
|
||||
const struct nir_shader_compiler_options *nir_options =
|
||||
consts->ShaderCompilerOptions[MESA_SHADER_FRAGMENT].NirOptions;
|
||||
|
||||
if (screen->shader_caps[PIPE_SHADER_FRAGMENT].integers &&
|
||||
extensions->ARB_stencil_texturing &&
|
||||
screen->caps.doubles &&
|
||||
!(nir_options->lower_doubles_options & nir_lower_fp64_full_software))
|
||||
!(screen->nir_options[MESA_SHADER_FRAGMENT]->lower_doubles_options &
|
||||
nir_lower_fp64_full_software))
|
||||
extensions->NV_copy_depth_to_color = true;
|
||||
if (screen->caps.device_protected_surface || screen->caps.device_protected_context)
|
||||
extensions->EXT_protected_textures = true;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ st_link_glsl_to_nir(struct gl_context *ctx,
|
|||
for (unsigned i = 0; i < num_shaders; i++) {
|
||||
struct gl_linked_shader *shader = linked_shader[i];
|
||||
const nir_shader_compiler_options *options =
|
||||
st->ctx->Const.ShaderCompilerOptions[shader->Stage].NirOptions;
|
||||
ctx->screen->nir_options[shader->Stage];
|
||||
struct gl_program *prog = shader->Program;
|
||||
|
||||
shader->Program->info.separate_shader = shader_program->SeparateShader;
|
||||
|
|
@ -515,7 +515,7 @@ st_link_glsl_to_nir(struct gl_context *ctx,
|
|||
st_glsl_to_nir_post_opts(st, shader->Program, shader_program);
|
||||
|
||||
if (prev_info &&
|
||||
ctx->Const.ShaderCompilerOptions[shader->Stage].NirOptions->unify_interfaces) {
|
||||
ctx->screen->nir_options[shader->Stage]->unify_interfaces) {
|
||||
prev_info->outputs_written |= info->inputs_read &
|
||||
~(VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER);
|
||||
info->inputs_read |= prev_info->outputs_written &
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ st_nir_make_passthrough_vs(struct st_context *st,
|
|||
unsigned sysval_mask)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_VERTEX);
|
||||
st->screen->nir_options[MESA_SHADER_VERTEX];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_VERTEX, options,
|
||||
"%s", shader_name);
|
||||
|
|
@ -138,7 +138,7 @@ void *
|
|||
st_nir_make_clearcolor_shader(struct st_context *st)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT);
|
||||
st->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, options,
|
||||
"clear color FS");
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ void *
|
|||
st_pbo_create_vs(struct st_context *st)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_VERTEX);
|
||||
st->screen->nir_options[MESA_SHADER_VERTEX];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_VERTEX, options,
|
||||
"st/pbo VS");
|
||||
|
|
@ -325,7 +325,7 @@ void *
|
|||
st_pbo_create_gs(struct st_context *st)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_GEOMETRY);
|
||||
st->screen->nir_options[MESA_SHADER_GEOMETRY];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_GEOMETRY, options,
|
||||
"st/pbo GS");
|
||||
|
|
@ -396,7 +396,7 @@ create_fs(struct st_context *st, bool download,
|
|||
bool need_layer)
|
||||
{
|
||||
const nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT);
|
||||
st->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT, options,
|
||||
download ?
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ do_shader_conversion(nir_builder *b, nir_def *pixel,
|
|||
static nir_shader *
|
||||
create_conversion_shader(struct st_context *st, enum pipe_texture_target target, unsigned num_components)
|
||||
{
|
||||
const nir_shader_compiler_options *options = st_get_nir_compiler_options(st, MESA_SHADER_COMPUTE);
|
||||
const nir_shader_compiler_options *options = st->screen->nir_options[MESA_SHADER_COMPUTE];
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_COMPUTE, options, "%s", "convert");
|
||||
b.shader->info.workgroup_size[0] = target != PIPE_TEXTURE_1D ? 8 : 64;
|
||||
b.shader->info.workgroup_size[1] = target != PIPE_TEXTURE_1D ? 8 : 1;
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ get_nir_shader(struct st_context *st, struct gl_program *prog, bool is_draw)
|
|||
|
||||
struct blob_reader blob_reader;
|
||||
const struct nir_shader_compiler_options *options =
|
||||
is_draw ? &draw_nir_options : st_get_nir_compiler_options(st, prog->info.stage);
|
||||
is_draw ? &draw_nir_options : st->screen->nir_options[prog->info.stage];
|
||||
|
||||
if (is_draw && st->ctx->Const.PackedDriverUniformStorage &&
|
||||
(!prog->shader_program || prog->shader_program->data->LinkStatus != LINKING_SKIPPED)) {
|
||||
|
|
@ -989,7 +989,7 @@ st_translate_fragment_program(struct st_context *st,
|
|||
prog->nir = prog_to_nir(st->ctx, prog);
|
||||
} else if (prog->ati_fs) {
|
||||
const struct nir_shader_compiler_options *options =
|
||||
st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT);
|
||||
st->screen->nir_options[MESA_SHADER_FRAGMENT];
|
||||
|
||||
assert(!prog->nir);
|
||||
prog->nir = st_translate_atifs_program(prog->ati_fs, prog, options);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue