mesa/st: plumb glsl130_or_later through sampler creation

no functional changes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>
This commit is contained in:
Mike Blumenkrantz
2022-07-21 09:55:44 -04:00
committed by Marge Bot
parent d1e33fa345
commit 1c172cdbcc
4 changed files with 14 additions and 8 deletions

View File

@@ -233,7 +233,7 @@ new_texture_handle(struct gl_context *ctx, struct gl_texture_object *texObj,
if (!st_finalize_texture(ctx, pipe, texObj, 0)) if (!st_finalize_texture(ctx, pipe, texObj, 0))
return 0; return 0;
st_convert_sampler(st, texObj, sampObj, 0, &sampler, false, false); st_convert_sampler(st, texObj, sampObj, 0, &sampler, false, false, true);
/* TODO: Clarify the interaction of ARB_bindless_texture and EXT_texture_sRGB_decode */ /* TODO: Clarify the interaction of ARB_bindless_texture and EXT_texture_sRGB_decode */
view = st_get_texture_sampler_view_from_stobj(st, texObj, sampObj, 0, view = st_get_texture_sampler_view_from_stobj(st, texObj, sampObj, 0,

View File

@@ -62,7 +62,8 @@ st_convert_sampler(const struct st_context *st,
float tex_unit_lod_bias, float tex_unit_lod_bias,
struct pipe_sampler_state *sampler, struct pipe_sampler_state *sampler,
bool seamless_cube_map, bool seamless_cube_map,
bool ignore_srgb_decode) bool ignore_srgb_decode,
bool glsl130_or_later)
{ {
memcpy(sampler, &msamp->Attrib.state, sizeof(*sampler)); memcpy(sampler, &msamp->Attrib.state, sizeof(*sampler));
@@ -152,7 +153,8 @@ st_convert_sampler(const struct st_context *st,
void void
st_convert_sampler_from_unit(const struct st_context *st, st_convert_sampler_from_unit(const struct st_context *st,
struct pipe_sampler_state *sampler, struct pipe_sampler_state *sampler,
GLuint texUnit) GLuint texUnit,
bool glsl130_or_later)
{ {
const struct gl_texture_object *texobj; const struct gl_texture_object *texobj;
struct gl_context *ctx = st->ctx; struct gl_context *ctx = st->ctx;
@@ -164,7 +166,7 @@ st_convert_sampler_from_unit(const struct st_context *st,
msamp = _mesa_get_samplerobj(ctx, texUnit); msamp = _mesa_get_samplerobj(ctx, texUnit);
st_convert_sampler(st, texobj, msamp, ctx->Texture.Unit[texUnit].LodBiasQuantized, st_convert_sampler(st, texobj, msamp, ctx->Texture.Unit[texUnit].LodBiasQuantized,
sampler, ctx->Texture.CubeMapSeamless, true); sampler, ctx->Texture.CubeMapSeamless, true, glsl130_or_later);
} }
@@ -209,7 +211,8 @@ update_shader_samplers(struct st_context *st,
if (samplers_used & 1 && if (samplers_used & 1 &&
(ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER || (ctx->Texture.Unit[tex_unit]._Current->Target != GL_TEXTURE_BUFFER ||
st->texture_buffer_sampler)) { st->texture_buffer_sampler)) {
st_convert_sampler_from_unit(st, sampler, tex_unit); st_convert_sampler_from_unit(st, sampler, tex_unit,
prog->sh.data && prog->sh.data->Version >= 130);
states[unit] = sampler; states[unit] = sampler;
} else { } else {
states[unit] = NULL; states[unit] = NULL;

View File

@@ -523,7 +523,8 @@ st_create_texture_handle_from_unit(struct st_context *st,
return 0; return 0;
if (view->target != PIPE_BUFFER) if (view->target != PIPE_BUFFER)
st_convert_sampler_from_unit(st, &sampler, texUnit); st_convert_sampler_from_unit(st, &sampler, texUnit,
prog->sh.data && prog->sh.data->Version >= 130);
assert(st->ctx->Texture.Unit[texUnit]._Current); assert(st->ctx->Texture.Unit[texUnit]._Current);

View File

@@ -240,12 +240,14 @@ st_convert_sampler(const struct st_context *st,
float tex_unit_lod_bias, float tex_unit_lod_bias,
struct pipe_sampler_state *sampler, struct pipe_sampler_state *sampler,
bool seamless_cube_map, bool seamless_cube_map,
bool ignore_srgb_decode); bool ignore_srgb_decode,
bool glsl130_or_later);
void void
st_convert_sampler_from_unit(const struct st_context *st, st_convert_sampler_from_unit(const struct st_context *st,
struct pipe_sampler_state *sampler, struct pipe_sampler_state *sampler,
GLuint texUnit); GLuint texUnit,
bool glsl130_or_later);
struct pipe_sampler_view * struct pipe_sampler_view *
st_update_single_texture(struct st_context *st, st_update_single_texture(struct st_context *st,