summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-09 23:38:46 +1100
committerTimothy Arceri <[email protected]>2017-01-06 11:21:42 +1100
commitf584f3821426955b94f36c77191edcfe1b1cc7d5 (patch)
tree043484b6571b8ab26fde0f128b98e245d67cec49 /src/compiler/glsl
parent2784128398e405405f0263d318ebe4121d1baf4c (diff)
st/mesa/glsl: add new is_arb_asm flag in gl_program
Set the flag via the _mesa_init_gl_program() and NewProgram() helpers. In i965 we currently check for the existance of gl_shader_program to decide if this is an ARB assembly style program or not. Adding a flag makes the code clearer and will help removes a dependency on gl_shader_program in the i965 codegen functions. Also this will allow use to skip initialising sampler units for linked shaders, we currently memset it to zero again during linking. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/linker.cpp2
-rw-r--r--src/compiler/glsl/standalone.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 38cbbfa680f..327b7be8006 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2202,7 +2202,7 @@ link_intrastage_shaders(void *mem_ctx,
struct gl_program *gl_prog =
ctx->Driver.NewProgram(ctx,
_mesa_shader_stage_to_program(shader_list[0]->Stage),
- prog->Name);
+ prog->Name, false);
if (!gl_prog) {
prog->data->LinkStatus = false;
_mesa_delete_linked_shader(ctx, linked);
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 69d86c705fc..e93e9afcbfa 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -100,12 +100,13 @@ private:
};
void
-init_gl_program(struct gl_program *prog, GLenum target)
+init_gl_program(struct gl_program *prog, GLenum target, bool is_arb_asm)
{
mtx_init(&prog->Mutex, mtx_plain);
prog->RefCount = 1;
prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
+ prog->is_arb_asm = is_arb_asm;
/* default mapping from samplers to texture units */
for (int i = 0; i < MAX_SAMPLERS; i++)
@@ -113,7 +114,7 @@ init_gl_program(struct gl_program *prog, GLenum target)
}
struct gl_program *
-new_program(struct gl_context *ctx, GLenum target, GLuint id)
+new_program(struct gl_context *ctx, GLenum target, GLuint id, bool is_arb_asm)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
@@ -123,7 +124,7 @@ new_program(struct gl_context *ctx, GLenum target, GLuint id)
case GL_FRAGMENT_PROGRAM_ARB:
case GL_COMPUTE_PROGRAM_NV: {
struct gl_program *prog = rzalloc(NULL, struct gl_program);
- init_gl_program(prog, target);
+ init_gl_program(prog, target, is_arb_asm);
return prog;
}
default: