[Mesa-dev] [PATCH 4/4] mesa: use special checksums for unset checksums and fixed-func shaders
Marek Olšák
maraeo at gmail.com
Tue Nov 22 01:20:35 UTC 2016
From: Marek Olšák <marek.olsak at amd.com>
for debugging
---
src/mesa/main/ff_fragment_shader.cpp | 1 +
src/mesa/main/shaderobj.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index e00eac5..2497108 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1195,20 +1195,21 @@ emit_instructions(texenv_fragment_program *p)
*/
static struct gl_shader_program *
create_new_program(struct gl_context *ctx, struct state_key *key)
{
texenv_fragment_program p;
unsigned int unit;
_mesa_glsl_parse_state *state;
p.mem_ctx = ralloc_context(NULL);
p.shader = _mesa_new_shader(0, MESA_SHADER_FRAGMENT);
+ p.shader->SourceChecksum = 0xf18ed; /* fixed */
p.shader->ir = new(p.shader) exec_list;
state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT,
p.shader);
p.shader->symbols = state->symbols;
p.top_instructions = p.shader->ir;
p.instructions = p.shader->ir;
p.state = key;
p.shader_program = _mesa_new_shader_program(0);
/* Tell the linker to ignore the fact that we're building a
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 167431d..3d0fbe8 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -102,20 +102,21 @@ _mesa_init_shader(struct gl_shader *shader)
* Allocate a new gl_shader object, initialize it.
*/
struct gl_shader *
_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Stage = stage;
shader->Name = name;
+ shader->SourceChecksum = 0xa110c; /* alloc */
_mesa_init_shader(shader);
}
return shader;
}
/**
* Allocate a new gl_linked_shader object.
* Called via ctx->Driver.NewShader()
*/
--
2.7.4
More information about the mesa-dev
mailing list