state->modules[i] = zm->shader;
if (prog->modules[i] == zm->shader)
continue;
+ prog->optimal_keys &= !prog->shaders[i]->non_fs.is_generated;
variant_hash ^= prog->module_hash[i];
hash_changed = true;
default_variants &= zm->default_variant;
update_gfx_program_nonseamless(struct zink_context *ctx, struct zink_gfx_program *prog, bool has_nonseamless)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
- if (screen->driconf.inline_uniforms)
+ if (screen->driconf.inline_uniforms || prog->needs_inlining)
update_gfx_shader_modules(ctx, screen, prog,
ctx->dirty_gfx_stages & prog->stages_present, &ctx->gfx_pipeline_state,
true, has_nonseamless);
prog->ctx = ctx;
prog->gfx_hash = gfx_hash;
prog->base.removed = true;
+ prog->optimal_keys = screen->optimal_keys;
prog->has_edgeflags = prog->shaders[MESA_SHADER_VERTEX] &&
prog->shaders[MESA_SHADER_VERTEX]->has_edgeflags;
if (stages[i]) {
prog->shaders[i] = stages[i];
prog->stages_present |= BITFIELD_BIT(i);
+ prog->optimal_keys &= !prog->shaders[i]->non_fs.is_generated;
}
}
if (stages[MESA_SHADER_TESS_EVAL] && !stages[MESA_SHADER_TESS_CTRL]) {
bind_gfx_stage(ctx, MESA_SHADER_GEOMETRY,
ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type]);
+ ctx->is_generated_gs_bound = true;
}
} else if (ctx->gfx_stages[MESA_SHADER_GEOMETRY] &&
ctx->gfx_stages[MESA_SHADER_GEOMETRY]->non_fs.is_generated)
bind_gfx_stage(ctx, MESA_SHADER_GEOMETRY,
ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type]);
+ ctx->is_generated_gs_bound = true;
}
} else if (ctx->gfx_stages[MESA_SHADER_GEOMETRY] &&
ctx->gfx_stages[MESA_SHADER_GEOMETRY]->non_fs.is_generated)
unsigned inlined_variant_count[ZINK_GFX_SHADER_COUNT];
uint32_t default_variant_hash;
uint8_t inline_variants; //which stages are using inlined uniforms
+ bool needs_inlining; // whether this program requires some uniforms to be inlined
bool has_edgeflags;
+ bool optimal_keys;
/* separable */
struct zink_gfx_program *full_prog;
uint8_t dirty_gfx_stages; /* mask of changed gfx shader stages */
bool last_vertex_stage_dirty;
bool compute_dirty;
+ bool is_generated_gs_bound;
struct {
VkRenderingAttachmentInfo attachments[PIPE_MAX_COLOR_BUFS + 2]; //+depth, +stencil