struct gl_shader_program *shader_program,
struct gl_linked_shader *shader)
{
+ struct st_context *st = st_context(ctx);
struct gl_program *prog;
validate_ir_tree(shader->ir);
return NULL;
}
+ struct st_common_program *st_comm_prog = (struct st_common_program *)prog;
+ nir_shader *nir = st_glsl_to_nir(st, prog, shader_program, shader->Stage);
+ st_comm_prog->tgsi.type = PIPE_SHADER_IR_NIR;
+ st_comm_prog->tgsi.ir.nir = nir;
+
return prog;
}
}
if (stvp->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &stvp->Base, stvp->shader_program,
- MESA_SHADER_VERTEX);
-
- stvp->tgsi.type = PIPE_SHADER_IR_NIR;
- stvp->tgsi.ir.nir = nir;
-
struct gl_program *prog = stvp->shader_program->last_vert_prog;
if (prog) {
st_translate_stream_output_info2(prog->sh.LinkedTransformFeedback,
}
}
- if (stfp->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &stfp->Base, stfp->shader_program,
- MESA_SHADER_FRAGMENT);
-
- stfp->tgsi.type = PIPE_SHADER_IR_NIR;
- stfp->tgsi.ir.nir = nir;
-
+ /* We have already compiler to NIR so just return */
+ if (stfp->shader_program)
return true;
- }
ureg = ureg_create_with_screen(PIPE_SHADER_FRAGMENT, st->pipe->screen);
if (ureg == NULL)
{
struct ureg_program *ureg;
- if (sttcp->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &sttcp->Base, sttcp->shader_program,
- MESA_SHADER_TESS_EVAL);
-
- sttcp->tgsi.type = PIPE_SHADER_IR_NIR;
- sttcp->tgsi.ir.nir = nir;
-
+ /* We have already compiler to NIR so just return */
+ if (sttcp->shader_program)
return true;
- }
ureg = ureg_create_with_screen(PIPE_SHADER_TESS_CTRL, st->pipe->screen);
if (ureg == NULL)
{
struct ureg_program *ureg;
- if (sttep->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &sttep->Base, sttep->shader_program,
- MESA_SHADER_TESS_EVAL);
-
- sttep->tgsi.type = PIPE_SHADER_IR_NIR;
- sttep->tgsi.ir.nir = nir;
-
+ /* We have already compiler to NIR so just return */
+ if (sttep->shader_program)
return true;
- }
ureg = ureg_create_with_screen(PIPE_SHADER_TESS_EVAL, st->pipe->screen);
if (ureg == NULL)
struct pipe_shader_state prog;
if (stcp->shader_program) {
- nir_shader *nir = st_glsl_to_nir(st, &stcp->Base, stcp->shader_program,
- MESA_SHADER_COMPUTE);
-
/* no compute variants: */
- st_finalize_nir(st, &stcp->Base, stcp->shader_program, nir);
-
- stcp->tgsi.ir_type = PIPE_SHADER_IR_NIR;
- stcp->tgsi.prog = nir;
+ st_finalize_nir(st, &stcp->Base, stcp->shader_program,
+ (struct nir_shader *) stcp->tgsi.prog);
return true;
}