summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2019-08-15 22:17:26 -0700
committerVasily Khoruzhick <[email protected]>2019-08-17 11:14:40 -0700
commit0e394cda0db60ce8b584aac37913b793847ad518 (patch)
tree22a45ab4d021546b8b5e3cbe96b0cc88a89b824c /src/compiler/glsl
parent16edd02bfa872c9af8725f732d81760c948d76e8 (diff)
glsl/standalone: init shader stage in init_gl_program()
Otherwise lima standalone compiler fails when trying to compile fragment shader with: lima_compiler: ../src/compiler/nir/nir.c:55: nir_shader_create: Assertion `si->stage == stage' failed Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/standalone.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 7b3d358ca96..b32fb626ef6 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -44,6 +44,7 @@
#include "builtin_functions.h"
#include "opt_add_neg_to_sub.h"
#include "main/mtypes.h"
+#include "program/program.h"
class dead_variable_visitor : public ir_hierarchical_visitor {
public:
@@ -98,11 +99,12 @@ private:
};
static void
-init_gl_program(struct gl_program *prog, bool is_arb_asm)
+init_gl_program(struct gl_program *prog, bool is_arb_asm, GLenum target)
{
prog->RefCount = 1;
prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
prog->is_arb_asm = is_arb_asm;
+ prog->info.stage = (gl_shader_stage)_mesa_program_enum_to_shader_stage(target);
}
static struct gl_program *
@@ -117,7 +119,7 @@ new_program(UNUSED struct gl_context *ctx, GLenum target,
case GL_FRAGMENT_PROGRAM_ARB:
case GL_COMPUTE_PROGRAM_NV: {
struct gl_program *prog = rzalloc(NULL, struct gl_program);
- init_gl_program(prog, is_arb_asm);
+ init_gl_program(prog, is_arb_asm, target);
return prog;
}
default: