mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 04:20:18 +01:00
nir/glsl: Take a gl_shader_program and a stage rather than a gl_shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
30c6357113
commit
cd1ae6ebfa
3 changed files with 9 additions and 5 deletions
|
|
@ -129,9 +129,13 @@ private:
|
|||
}; /* end of anonymous namespace */
|
||||
|
||||
nir_shader *
|
||||
glsl_to_nir(struct gl_shader *sh, const nir_shader_compiler_options *options)
|
||||
glsl_to_nir(const struct gl_shader_program *shader_prog,
|
||||
gl_shader_stage stage,
|
||||
const nir_shader_compiler_options *options)
|
||||
{
|
||||
nir_shader *shader = nir_shader_create(NULL, sh->Stage, options);
|
||||
struct gl_shader *sh = shader_prog->_LinkedShaders[stage];
|
||||
|
||||
nir_shader *shader = nir_shader_create(NULL, stage, options);
|
||||
|
||||
nir_visitor v1(shader);
|
||||
nir_function_visitor v2(&v1);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
nir_shader *glsl_to_nir(struct gl_shader *sh,
|
||||
nir_shader *glsl_to_nir(const struct gl_shader_program *shader_prog,
|
||||
gl_shader_stage stage,
|
||||
const nir_shader_compiler_options *options);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -103,13 +103,12 @@ brw_create_nir(struct brw_context *brw,
|
|||
static const nir_lower_tex_options tex_options = {
|
||||
.lower_txp = ~0,
|
||||
};
|
||||
struct gl_shader *shader = shader_prog ? shader_prog->_LinkedShaders[stage] : NULL;
|
||||
bool debug_enabled = INTEL_DEBUG & intel_debug_flag_for_shader_stage(stage);
|
||||
nir_shader *nir;
|
||||
|
||||
/* First, lower the GLSL IR or Mesa IR to NIR */
|
||||
if (shader_prog) {
|
||||
nir = glsl_to_nir(shader, options);
|
||||
nir = glsl_to_nir(shader_prog, stage, options);
|
||||
} else {
|
||||
nir = prog_to_nir(prog, options);
|
||||
nir_convert_to_ssa(nir); /* turn registers into SSA */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue