st/mesa: move handling CubeMapSeamless into st_convert_sampler where it belongs
authorMarek Olšák <marek.olsak@amd.com>
Mon, 7 Jun 2021 12:51:41 +0000 (08:51 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Aug 2021 15:04:20 +0000 (15:04 +0000)
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12334>

src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_texture.h

index 9f5a357..5c314d3 100644 (file)
@@ -61,10 +61,13 @@ st_convert_sampler(const struct st_context *st,
                    const struct gl_texture_object *texobj,
                    const struct gl_sampler_object *msamp,
                    float tex_unit_lod_bias,
-                   struct pipe_sampler_state *sampler)
+                   struct pipe_sampler_state *sampler,
+                   bool seamless_cube_map)
 {
    memcpy(sampler, &msamp->Attrib.state, sizeof(*sampler));
 
+   sampler->seamless_cube_map |= seamless_cube_map;
+
    if (texobj->_IsIntegerFormat && st->ctx->Const.ForceIntegerTexNearest) {
       sampler->min_img_filter = PIPE_TEX_FILTER_NEAREST;
       sampler->mag_img_filter = PIPE_TEX_FILTER_NEAREST;
@@ -156,9 +159,7 @@ st_convert_sampler_from_unit(const struct st_context *st,
    msamp = _mesa_get_samplerobj(ctx, texUnit);
 
    st_convert_sampler(st, texobj, msamp, ctx->Texture.Unit[texUnit].LodBiasQuantized,
-                      sampler);
-
-   sampler->seamless_cube_map |= ctx->Texture.CubeMapSeamless;
+                      sampler, ctx->Texture.CubeMapSeamless);
 }
 
 
index a39005f..deb1aae 100644 (file)
@@ -3617,7 +3617,7 @@ st_NewTextureHandle(struct gl_context *ctx, struct gl_texture_object *texObj,
       if (!st_finalize_texture(ctx, pipe, texObj, 0))
          return 0;
 
-      st_convert_sampler(st, texObj, sampObj, 0, &sampler);
+      st_convert_sampler(st, texObj, sampObj, 0, &sampler, false);
 
       /* TODO: Clarify the interaction of ARB_bindless_texture and EXT_texture_sRGB_decode */
       view = st_get_texture_sampler_view_from_stobj(st, stObj, sampObj, 0,
index 824ef4b..c9d670f 100644 (file)
@@ -367,7 +367,8 @@ st_convert_sampler(const struct st_context *st,
                    const struct gl_texture_object *texobj,
                    const struct gl_sampler_object *msamp,
                    float tex_unit_lod_bias,
-                   struct pipe_sampler_state *sampler);
+                   struct pipe_sampler_state *sampler,
+                   bool seamless_cube_map);
 
 void
 st_convert_sampler_from_unit(const struct st_context *st,