mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
st/mesa: don't call ProgramStringNotify in glsl_to_nir
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
5a714531f7
commit
e8f0a39d45
2 changed files with 16 additions and 13 deletions
|
|
@ -114,6 +114,9 @@ st_program_string_notify( struct gl_context *ctx,
|
|||
struct st_context *st = st_context(ctx);
|
||||
struct st_program *stp = (struct st_program *) prog;
|
||||
|
||||
/* GLSL-to-NIR should not end up here. */
|
||||
assert(!stp->shader_program);
|
||||
|
||||
if (target == GL_FRAGMENT_PROGRAM_ARB ||
|
||||
target == GL_FRAGMENT_SHADER_ATI) {
|
||||
if (target == GL_FRAGMENT_SHADER_ATI) {
|
||||
|
|
@ -124,18 +127,15 @@ st_program_string_notify( struct gl_context *ctx,
|
|||
}
|
||||
|
||||
st_release_fp_variants(st, stp);
|
||||
if (!stp->shader_program && /* not GLSL->NIR */
|
||||
!st_translate_fragment_program(st, stp))
|
||||
if (!st_translate_fragment_program(st, stp))
|
||||
return false;
|
||||
} else if (target == GL_VERTEX_PROGRAM_ARB) {
|
||||
st_release_vp_variants(st, stp);
|
||||
if (!stp->shader_program && /* not GLSL->NIR */
|
||||
!st_translate_vertex_program(st, stp))
|
||||
if (!st_translate_vertex_program(st, stp))
|
||||
return false;
|
||||
} else {
|
||||
st_release_common_variants(st, stp);
|
||||
if (!stp->shader_program && /* not GLSL->NIR */
|
||||
!st_translate_common_program(st, stp))
|
||||
if (!st_translate_common_program(st, stp))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -790,11 +790,12 @@ st_link_nir(struct gl_context *ctx,
|
|||
continue;
|
||||
|
||||
struct gl_program *prog = shader->Program;
|
||||
struct st_program *stp = st_program(prog);
|
||||
st_glsl_to_nir_post_opts(st, prog, shader_program);
|
||||
|
||||
/* Initialize st_vertex_program members. */
|
||||
if (i == MESA_SHADER_VERTEX)
|
||||
st_prepare_vertex_program(st_program(prog));
|
||||
st_prepare_vertex_program(stp);
|
||||
|
||||
/* Get pipe_stream_output_info. */
|
||||
if (i == MESA_SHADER_VERTEX ||
|
||||
|
|
@ -804,12 +805,14 @@ st_link_nir(struct gl_context *ctx,
|
|||
|
||||
st_store_ir_in_disk_cache(st, prog, true);
|
||||
|
||||
if (!ctx->Driver.ProgramStringNotify(ctx,
|
||||
_mesa_shader_stage_to_program(i),
|
||||
prog)) {
|
||||
_mesa_reference_program(ctx, &shader->Program, NULL);
|
||||
return false;
|
||||
}
|
||||
if (prog->info.stage == MESA_SHADER_VERTEX)
|
||||
st_release_vp_variants(st, stp);
|
||||
else if (prog->info.stage == MESA_SHADER_FRAGMENT)
|
||||
st_release_fp_variants(st, stp);
|
||||
else
|
||||
st_release_common_variants(st, stp);
|
||||
|
||||
st_finalize_program(st, prog);
|
||||
|
||||
/* The GLSL IR won't be needed anymore. */
|
||||
ralloc_free(shader->ir);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue