aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2020-04-24 18:14:40 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2020-05-05 12:26:02 +0200
commit0ee1a724bf78baa3fe514036d77d3e96abc998f7 (patch)
tree704ade77e87072aceba4383802ee66dd1ddc131a /src/mesa
parentea289d1502dc5739ec9bf69328c037b72dc02789 (diff)
gallium: add a new cap PIPE_CAP_GLSL_ZERO_INIT
Allows driver to select a zero init mode between the 3 possible values. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h8
-rw-r--r--src/mesa/state_tracker/st_extensions.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7046e8adfa3..2fa06e7a570 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3868,9 +3868,13 @@ struct gl_constants
GLboolean ForceGLSLAbsSqrt;
/**
- * Types of variable to default initialized to zero.
+ * Types of variable to default initialized to zero. Supported values are:
+ * - 0: no zero initialization
+ * - 1: all shader variables and gl_FragColor are initialiazed to 0
+ * - 2: same as 1, but shader out variables are *not* initialized, while
+ * function out variables are now initialized.
*/
- GLuint GLSLZeroInit;
+ GLchar GLSLZeroInit;
/**
* Treat integer textures using GL_LINEAR filters as GL_NEAREST.
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 2403bd60a8c..f13ded7c19d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1205,6 +1205,8 @@ void st_init_extensions(struct pipe_screen *screen,
if (options->glsl_zero_init) {
consts->GLSLZeroInit = 1;
+ } else {
+ consts->GLSLZeroInit = screen->get_param(screen, PIPE_CAP_GLSL_ZERO_INIT);
}
consts->ForceIntegerTexNearest = options->force_integer_tex_nearest;