gallium: give vertex-shader saturate its own cap
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 5 Jul 2019 14:21:45 +0000 (16:21 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Jul 2019 13:49:57 +0000 (15:49 +0200)
Shader Model 3.0 is a big promise to make to the state-tracker, and
for instance mobile hardware might support vertex-shader saturate but
not some of the other features of SM3. So let's give this its own cap
for simplicity.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_context.c

index 4b57c0c6342d8f866b36dca1bd44f80476e3ee8f..4ee1b4f62af92ee385a33445727120d6a3e30462 100644 (file)
@@ -372,6 +372,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
 
    case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
    case PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES:
+   case PIPE_CAP_VERTEX_SHADER_SATURATE:
       return pscreen->get_param(pscreen, PIPE_CAP_SM3);
 
    default:
index 010725818830e84a5b842985ce0078e7ee4a6bd6..1f1728d717a4e0bd16b078a809f7ed81c11a55ee 100644 (file)
@@ -538,6 +538,8 @@ The integer capabilities:
   explicit LOD is supported in the fragment shader.
 * ``PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES``: True if the driver supports
   derivatives in fragment shaders.
+* ``PIPE_CAP_VERTEX_SHADER_SATURATE``: True if the driver supports saturate
+  modifiers in the vertex shader.
 
 .. _pipe_capf:
 
index 1ce2d131195eb36a77491792d25970403434d296..1d589457152f95390d4720b71bf1f340a96bfe0b 100644 (file)
@@ -890,6 +890,7 @@ enum pipe_cap
    PIPE_CAP_TGSI_DIV,
    PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD,
    PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES,
+   PIPE_CAP_VERTEX_SHADER_SATURATE,
 };
 
 /**
index f3b84d53c5996958c0628b9b9f33ac359bdd1939..a94ffe26eba2facbaaf79390880eacd91b9eea7a 100644 (file)
@@ -686,7 +686,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
     * is not supported
     */
    ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoSat =
-      !screen->get_param(screen, PIPE_CAP_SM3);
+      !screen->get_param(screen, PIPE_CAP_VERTEX_SHADER_SATURATE);
 
    if (ctx->Const.GLSLVersion < 400) {
       for (i = 0; i < MESA_SHADER_STAGES; i++)