summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h7
-rw-r--r--src/mesa/main/ff_fragment_shader.cpp3
-rw-r--r--src/mesa/main/uniform_query.cpp3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index a91e8083f21..e6a1e68cb25 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -399,6 +399,13 @@ struct dd_function_table {
GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
struct gl_program *prog);
+ /**
+ * Notify driver that the sampler uniforms for the current program have
+ * changed. On some drivers, this may require shader recompiles.
+ */
+ void (*SamplerUniformChange)(struct gl_context *ctx, GLenum target,
+ struct gl_program *prog);
+
/** Query if program can be loaded onto hardware */
GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
struct gl_program *prog);
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index f743ce109fd..e850d47dd80 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1363,7 +1363,8 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
_mesa_associate_uniform_storage(ctx, p.shader_program, fp->Parameters);
_mesa_update_shader_textures_used(p.shader_program, fp);
- (void) ctx->Driver.ProgramStringNotify(ctx, fp->Target, fp);
+ if (ctx->Driver.SamplerUniformChange)
+ ctx->Driver.SamplerUniformChange(ctx, fp->Target, fp);
if (!p.shader_program->LinkStatus)
_mesa_problem(ctx, "Failed to link fixed function fragment shader: %s\n",
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 816c2779cf3..bddb8f95e14 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -809,7 +809,8 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
sizeof(shProg->SamplerUnits));
_mesa_update_shader_textures_used(shProg, prog);
- (void) ctx->Driver.ProgramStringNotify(ctx, prog->Target, prog);
+ if (ctx->Driver.SamplerUniformChange)
+ ctx->Driver.SamplerUniformChange(ctx, prog->Target, prog);
}
}
}