gallium: give fragment-shader texture-lod its own cap
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 5 Jul 2019 13:46:38 +0000 (15:46 +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 texture lod 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_extensions.c

index 3feb0b5f37c98d2c3dd6d2e78f4b836ff338f523..5baf7d72fb16f5c1da1287bdcc81c3a10dab7f53 100644 (file)
@@ -370,6 +370,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
       return 0;
 #endif
 
+   case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
+      return pscreen->get_param(pscreen, PIPE_CAP_SM3);
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
index 596a17f32ebf513c770aeec4dc91008f8a39acb6..59fa82b427f8f96bd929660724d8305836a3f848 100644 (file)
@@ -534,6 +534,8 @@ The integer capabilities:
 * ``PIPE_CAP_ATOMIC_FLOAT_MINMAX``: Atomic float point minimum,
   maximum, exchange and compare-and-swap support to buffer and shared variables.
 * ``PIPE_CAP_TGSI_DIV``: Whether opcode DIV is supported
+* ``PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD``: Whether texture lookups with
+  explicit LOD is supported in the fragment shader.
 
 .. _pipe_capf:
 
index 536f321edfda834520621199490f7b62144ef2ee..8092fca4df17c6847e74f052f1e365bb8aa7de2d 100644 (file)
@@ -888,6 +888,7 @@ enum pipe_cap
    PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED,
    PIPE_CAP_ATOMIC_FLOAT_MINMAX,
    PIPE_CAP_TGSI_DIV,
+   PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD,
 };
 
 /**
index f423136929ffd87986b7dfc7915177975aedec2f..3611cdcd5fdec13e10c39f1ed6750a86f76259bd 100644 (file)
@@ -725,7 +725,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(EXT_shader_image_load_formatted),  PIPE_CAP_IMAGE_LOAD_FORMATTED             },
       { o(ARB_shader_stencil_export),        PIPE_CAP_SHADER_STENCIL_EXPORT            },
       { o(ARB_shader_texture_image_samples), PIPE_CAP_TGSI_TXQS                        },
-      { o(ARB_shader_texture_lod),           PIPE_CAP_SM3                              },
+      { o(ARB_shader_texture_lod),           PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD      },
       { o(ARB_sparse_buffer),                PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE          },
       { o(ARB_texture_buffer_object),        PIPE_CAP_TEXTURE_BUFFER_OBJECTS           },
       { o(ARB_texture_cube_map_array),       PIPE_CAP_CUBE_MAP_ARRAY                   },