summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 17:22:09 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit670c4dd3957efe0022a3ac36074fd89a5873d953 (patch)
tree13668237b0a6a149a43204f608ce817c8614f9dd /src/mesa/main/state.c
parent0b70d6ec568a2c5d7b2ff814e6e26b6d1379c829 (diff)
mesa: don't flag _NEW_PROGRAM_CONSTANTS for non-GLSL programs for st/mesa
This has the benefit that we get to set up constants for exactly the shader stage that needs it. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 2b4d8d46ea0..7aec98e5784 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -230,7 +230,12 @@ update_program_constants(struct gl_context *ctx)
const struct gl_program_parameter_list *params =
ctx->FragmentProgram._Current->Parameters;
if (params && params->StateFlags & ctx->NewState) {
- new_state |= _NEW_PROGRAM_CONSTANTS;
+ if (ctx->DriverFlags.NewShaderConstants[MESA_SHADER_FRAGMENT]) {
+ ctx->NewDriverState |=
+ ctx->DriverFlags.NewShaderConstants[MESA_SHADER_FRAGMENT];
+ } else {
+ new_state |= _NEW_PROGRAM_CONSTANTS;
+ }
}
}
@@ -242,7 +247,12 @@ update_program_constants(struct gl_context *ctx)
const struct gl_program_parameter_list *params =
ctx->VertexProgram._Current->Parameters;
if (params && params->StateFlags & ctx->NewState) {
- new_state |= _NEW_PROGRAM_CONSTANTS;
+ if (ctx->DriverFlags.NewShaderConstants[MESA_SHADER_VERTEX]) {
+ ctx->NewDriverState |=
+ ctx->DriverFlags.NewShaderConstants[MESA_SHADER_VERTEX];
+ } else {
+ new_state |= _NEW_PROGRAM_CONSTANTS;
+ }
}
}