glsl: Add 'bare' shadow sampler type
authorJesse Natalie <jenatali@microsoft.com>
Mon, 20 Apr 2020 19:27:27 +0000 (12:27 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Aug 2020 13:10:19 +0000 (13:10 +0000)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6222>

src/compiler/builtin_type_macros.h
src/compiler/nir_types.cpp
src/compiler/nir_types.h

index 55ad2b89554cec0b18db8cc3145e71dc60c3c02d..b5598c0b2dcb3889defa3848eed4f0e0a96ebefa 100644 (file)
@@ -122,6 +122,7 @@ DECL_TYPE(usamplerBuffer,    GL_UNSIGNED_INT_SAMPLER_BUFFER,               GLSL_
 DECL_TYPE(usampler2DMS,      GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE,       GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_MS,   0, 0, GLSL_TYPE_UINT)
 DECL_TYPE(usampler2DMSArray, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_MS,   0, 1, GLSL_TYPE_UINT)
 
+DECL_TYPE(samplerShadow,          GL_SAMPLER_1D_SHADOW,             GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,       1, 0, GLSL_TYPE_VOID)
 DECL_TYPE(sampler1DShadow,        GL_SAMPLER_1D_SHADOW,             GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,       1, 0, GLSL_TYPE_FLOAT)
 DECL_TYPE(sampler2DShadow,        GL_SAMPLER_2D_SHADOW,             GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_2D,       1, 0, GLSL_TYPE_FLOAT)
 DECL_TYPE(samplerCubeShadow,      GL_SAMPLER_CUBE_SHADOW,           GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_CUBE,     1, 0, GLSL_TYPE_FLOAT)
index a53b14db8148ee7ba7409c72b6378d1825c83216..975f5480e111a7e8d4467ac156ec43e60d97f424 100644 (file)
@@ -586,6 +586,12 @@ glsl_bare_sampler_type()
    return glsl_type::sampler_type;
 }
 
+const struct glsl_type *
+glsl_bare_shadow_sampler_type()
+{
+   return glsl_type::samplerShadow_type;
+}
+
 const struct glsl_type *
 glsl_image_type(enum glsl_sampler_dim dim, bool is_array,
                 enum glsl_base_type base_type)
index 6118e52bfc55fed3e095cfc52901f7a981b552b1..5e4da1e8ab354ab4e17ba5eb450dfc6efd4c8345 100644 (file)
@@ -201,6 +201,7 @@ const struct glsl_type *glsl_sampler_type(enum glsl_sampler_dim dim,
                                           bool is_shadow, bool is_array,
                                           enum glsl_base_type base_type);
 const struct glsl_type *glsl_bare_sampler_type();
+const struct glsl_type *glsl_bare_shadow_sampler_type();
 const struct glsl_type *glsl_image_type(enum glsl_sampler_dim dim,
                                         bool is_array,
                                         enum glsl_base_type base_type);