aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2020-04-24 18:32:02 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2020-05-05 12:26:02 +0200
commitea289d1502dc5739ec9bf69328c037b72dc02789 (patch)
tree6940b2864756497f0ed34b4fd3dd06c18ec4f919 /src/mesa/main
parent679421628bf89067b4cbfa85530f196ca2835717 (diff)
mesa: extend GLSLZeroInit semantics
This commit introduces a new way to zero-init variables but keep the old one to not break any existing behavior. With this change GLSLZeroInit becomes an integer, with the following possible values: - 0: no 0 init - 1: current behavior - 2: new behavior. Similar to 1, except ir_var_function_out type are 0 initialized but ir_var_shader_out. The rationale behind 2 is: zero initializing ir_var_shader_out can prevent some optimization where out variables are completely eliminated when not written to. On the other hand, zero initializing "ir_var_function_out" has no effect on correct shaders but typically helps shadertoy since the main function is: void mainImage(out vec4 fragColor) { ... } So with this change we're sure that fragColor will always get a value. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a46eb72da9a..7046e8adfa3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3868,9 +3868,9 @@ struct gl_constants
GLboolean ForceGLSLAbsSqrt;
/**
- * Force uninitialized variables to default to zero.
+ * Types of variable to default initialized to zero.
*/
- GLboolean GLSLZeroInit;
+ GLuint GLSLZeroInit;
/**
* Treat integer textures using GL_LINEAR filters as GL_NEAREST.