summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-05-09 09:52:40 +0200
committerMarek Olšák <[email protected]>2019-05-09 16:15:20 -0400
commit62ed82ea1a93e4fb9676a1edd9447b26cdd4f173 (patch)
treeb7848bd04b835a09f114ea734154a0f1dd65c234 /src/mesa
parent1f1007a4edcefa1c291c1b4e13d6cec35a59ca6f (diff)
mesa: fix GL_PROGRAM_BINARY_RETRIEVABLE_HINT handling
When first implemented in fefd03e16c16 Mesa's behavior was aligned on behavior of Nvidia's driver. This caused a failing test in piglit but was ok since the specification is unclear on this subject. Nvidia's driver behavior has been modified because using version 410.104, the problematic test (program_binary_retrievable_hint) now passes. This commit defers BinaryRetrievableHint update until the next linking so the test passes on Mesa as well. Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h7
-rw-r--r--src/mesa/main/shaderapi.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0ca87561f05..76905f60662 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2956,8 +2956,13 @@ struct gl_shader_program
/**
* Is the application intending to glGetProgramBinary this program?
+ *
+ * BinaryRetrievableHint is the currently active hint that gets set
+ * during initialization and after linking and BinaryRetrievableHintPending
+ * is the hint set by the user to be active when program is linked next time.
*/
- GLboolean BinaryRetreivableHint;
+ GLboolean BinaryRetrievableHint;
+ GLboolean BinaryRetrievableHintPending;
/**
* Indicates whether program can be bound for individual pipeline stages
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 6b73e6c7e7a..2cc5fe5d8f8 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -843,7 +843,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
break;
- *params = shProg->BinaryRetreivableHint;
+ *params = shProg->BinaryRetrievableHint;
return;
case GL_PROGRAM_BINARY_LENGTH:
if (ctx->Const.NumProgramBinaryFormats == 0 || !shProg->data->LinkStatus) {
@@ -1287,6 +1287,8 @@ link_program(struct gl_context *ctx, struct gl_shader_program *shProg,
_mesa_update_vertex_processing_mode(ctx);
+ shProg->BinaryRetrievableHint = shProg->BinaryRetrievableHintPending;
+
/* debug code */
if (0) {
GLuint i;
@@ -2380,7 +2382,7 @@ program_parameteri(struct gl_context *ctx, struct gl_shader_program *shProg,
* will not be in effect until the next time LinkProgram or
* ProgramBinary has been called successfully."
*
- * The resloution of issue 9 in the extension spec also says:
+ * The resolution of issue 9 in the extension spec also says:
*
* "The application may use the PROGRAM_BINARY_RETRIEVABLE_HINT hint
* to indicate to the GL implementation that this program will
@@ -2389,7 +2391,7 @@ program_parameteri(struct gl_context *ctx, struct gl_shader_program *shProg,
* changes made to the program before being saved such that when it
* is loaded again a recompile can be avoided."
*/
- shProg->BinaryRetreivableHint = value;
+ shProg->BinaryRetrievableHintPending = value;
return;
case GL_PROGRAM_SEPARABLE: