gallium: Remove PIPE_CAP_TEXTURE_BUFFER_SAMPLER
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 30 Mar 2023 17:24:16 +0000 (13:24 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 01:15:41 +0000 (01:15 +0000)
No more users. It was already not respected by rusticl so you couldn't set it if
you wanted OpenCL support. I regret introducing the CAP in the first place, and
no more drivers should use it.

Reverts d5d3f77e4ac ("gallium: Add new cap PIPE_CAP_TEXTURE_BUFFER_SAMPLER").

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>

docs/gallium/context.rst
docs/gallium/screen.rst
src/gallium/auxiliary/util/u_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_atom_shader.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h

index 8ebbd84..a3fd78b 100644 (file)
@@ -129,11 +129,10 @@ Samplers
 ^^^^^^^^
 
 pipe_sampler_state objects control how textures are sampled
-(coordinate wrap modes, interpolation modes, etc).  Note that unless
-``PIPE_CAP_TEXTURE_BUFFER_SAMPLER`` is enabled, samplers are not used for
-texture buffer objects.  That is, pipe_context::bind_sampler_views()
-will not bind a sampler if the corresponding sampler view refers to a
-PIPE_BUFFER resource.
+(coordinate wrap modes, interpolation modes, etc).  Note that
+samplers are not used for texture buffer objects.  That is,
+pipe_context::bind_sampler_views() will not bind a sampler if the corresponding
+sampler view refers to a PIPE_BUFFER resource.
 
 Sampler Views
 ^^^^^^^^^^^^^
index 2a7a16b..efcc981 100644 (file)
@@ -180,9 +180,6 @@ The integer capabilities:
   TEXCOORD semantic.
   Also, TGSI_SEMANTIC_PCOORD becomes available, which labels a fragment shader
   input that will always be replaced with sprite coordinates.
-* ``PIPE_CAP_TEXTURE_BUFFER_SAMPLER``: Whether a sampler should still
-  be used for PIPE_BUFFER resources (normally a sampler is only used
-  if the texture target is PIPE_TEXTURE_*).
 * ``PIPE_CAP_TEXTURE_TRANSFER_MODES``: The ``pipe_texture_transfer_mode`` modes
   that are supported for implementing a texture transfer which needs format conversions
   and swizzling in gallium frontends. Generally, all hardware drivers with
index c8f1c5f..348aaa8 100644 (file)
@@ -172,7 +172,6 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
 
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
    case PIPE_CAP_TGSI_TEXCOORD:
-   case PIPE_CAP_TEXTURE_BUFFER_SAMPLER:
       return 0;
 
    case PIPE_CAP_TEXTURE_TRANSFER_MODES:
index 2a6920b..800e901 100644 (file)
@@ -807,7 +807,6 @@ enum pipe_cap
    PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT,
    PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY,
    PIPE_CAP_TGSI_TEXCOORD,
-   PIPE_CAP_TEXTURE_BUFFER_SAMPLER,
    PIPE_CAP_LINEAR_IMAGE_PITCH_ALIGNMENT,
    PIPE_CAP_LINEAR_IMAGE_BASE_ADDRESS_ALIGNMENT,
    PIPE_CAP_TEXTURE_TRANSFER_MODES,
index 826c42d..bedd223 100644 (file)
@@ -237,8 +237,7 @@ update_shader_samplers(struct st_context *st,
        * states that are NULL.
        */
       if (samplers_used & 1 &&
-          (ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER ||
-           st->texture_buffer_sampler)) {
+          (ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER)) {
          st_convert_sampler_from_unit(
             st, sampler, tex_unit,
             prog->shader_program && prog->shader_program->GLSL_Version >= 130);
index 643a373..4bb2433 100644 (file)
@@ -85,8 +85,7 @@ update_gl_clamp(struct st_context *st, struct gl_program *prog, uint32_t *gl_cla
    for (unit = 0; samplers_used; unit++, samplers_used >>= 1) {
       unsigned tex_unit = prog->SamplerUnits[unit];
       if (samplers_used & 1 &&
-          (st->ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER ||
-           st->texture_buffer_sampler)) {
+          (st->ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER)) {
          ASSERTED const struct gl_texture_object *texobj;
          struct gl_context *ctx = st->ctx;
          const struct gl_sampler_object *msamp;
index e7f0a2e..0aba174 100644 (file)
@@ -600,8 +600,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
          PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_ALPHA_NOT_W);
    st->emulate_gl_clamp =
       !screen->get_param(screen, PIPE_CAP_GL_CLAMP);
-   st->texture_buffer_sampler =
-      screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_SAMPLER);
    st->has_time_elapsed =
       screen->get_param(screen, PIPE_CAP_QUERY_TIME_ELAPSED);
    st->has_half_float_packing =
index ce7d2fd..031ba10 100644 (file)
@@ -202,7 +202,6 @@ struct st_context
    boolean use_format_with_border_color;
    boolean alpha_border_color_is_not_w;
    boolean emulate_gl_clamp;
-   boolean texture_buffer_sampler;
 
    boolean draw_needs_minmax_index;
    boolean has_hw_atomics;