Revert "gallium: remove PIPE_CAP_TEXTURE_SHADOW_MAP"
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 17 Jun 2019 22:54:47 +0000 (00:54 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 18 Sep 2019 04:47:21 +0000 (06:47 +0200)
There are GPUs that do not support this feature.

This reverts commit e871abe452ad40efcccb0bab6b88fc31d0551e29

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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 83b1c4df15b850a7de9753f48fb9dd85d70db802..a5711e5595cdbdd984dc576169b79affccb67fa2 100644 (file)
@@ -387,6 +387,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
       return 0;
 #endif
 
+   case PIPE_CAP_TEXTURE_SHADOW_MAP: /* Enables ARB_shadow */
+      return 1;
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
index c4373e72de5b2753b81c982e1dde621a2d42d438..d853edf92d0b30796c41d99160ffd010bf25ea96 100644 (file)
@@ -34,6 +34,9 @@ The integer capabilities:
   bound.
 * ``PIPE_CAP_OCCLUSION_QUERY``: Whether occlusion queries are available.
 * ``PIPE_CAP_QUERY_TIME_ELAPSED``: Whether PIPE_QUERY_TIME_ELAPSED queries are available.
+* ``PIPE_CAP_TEXTURE_SHADOW_MAP``: indicates whether the fragment shader hardware
+  can do the depth texture / Z comparison operation in TEX instructions
+  for shadow testing.
 * ``PIPE_CAP_TEXTURE_SWIZZLE``: Whether swizzling through sampler views is
   supported.
 * ``PIPE_CAP_MAX_TEXTURE_2D_SIZE``: The maximum size of 2D (and 1D) textures.
index 0e98af3985db421dc3bcc7ae2e31b5c228c239e0..de0d88f6548b7e160cc9df02d60a73d2a3d4cf4f 100644 (file)
@@ -693,6 +693,7 @@ enum pipe_cap
    PIPE_CAP_MAX_RENDER_TARGETS,
    PIPE_CAP_OCCLUSION_QUERY,
    PIPE_CAP_QUERY_TIME_ELAPSED,
+   PIPE_CAP_TEXTURE_SHADOW_MAP,
    PIPE_CAP_TEXTURE_SWIZZLE,
    PIPE_CAP_MAX_TEXTURE_2D_SIZE,
    PIPE_CAP_MAX_TEXTURE_3D_LEVELS,
index 401a64b62e353e2f4b0c52b181b3dc94cf5896a4..d111b6cf10ba7b5f341d5869c993d383e6b717be 100644 (file)
@@ -704,6 +704,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(ARB_draw_buffers_blend),           PIPE_CAP_INDEP_BLEND_FUNC                 },
       { o(ARB_draw_indirect),                PIPE_CAP_DRAW_INDIRECT                    },
       { o(ARB_draw_instanced),               PIPE_CAP_TGSI_INSTANCEID                  },
+      { o(ARB_fragment_program_shadow),      PIPE_CAP_TEXTURE_SHADOW_MAP               },
       { o(ARB_framebuffer_object),           PIPE_CAP_MIXED_FRAMEBUFFER_SIZES          },
       { o(ARB_gpu_shader_int64),             PIPE_CAP_INT64                            },
       { o(ARB_gl_spirv),                     PIPE_CAP_GL_SPIRV                         },
@@ -730,6 +731,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { 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_FRAGMENT_SHADER_TEXTURE_LOD      },
+      { o(ARB_shadow),                       PIPE_CAP_TEXTURE_SHADOW_MAP               },
       { o(ARB_sparse_buffer),                PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE          },
       { o(ARB_spirv_extensions),             PIPE_CAP_GL_SPIRV                         },
       { o(ARB_texture_buffer_object),        PIPE_CAP_TEXTURE_BUFFER_OBJECTS           },
@@ -994,13 +996,11 @@ void st_init_extensions(struct pipe_screen *screen,
    extensions->ARB_explicit_uniform_location = GL_TRUE;
    extensions->ARB_fragment_coord_conventions = GL_TRUE;
    extensions->ARB_fragment_program = GL_TRUE;
-   extensions->ARB_fragment_program_shadow = GL_TRUE;
    extensions->ARB_fragment_shader = GL_TRUE;
    extensions->ARB_half_float_vertex = GL_TRUE;
    extensions->ARB_internalformat_query = GL_TRUE;
    extensions->ARB_internalformat_query2 = GL_TRUE;
    extensions->ARB_map_buffer_range = GL_TRUE;
-   extensions->ARB_shadow = GL_TRUE;
    extensions->ARB_sync = GL_TRUE;
    extensions->ARB_texture_border_clamp = GL_TRUE;
    extensions->ARB_texture_cube_map = GL_TRUE;