kk: Expose shaderImageGatherExtended

Limit gather offsets to hardware's limit [-8, 7].

Reviewed-By: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38846>
This commit is contained in:
Aitor Camacho 2025-12-08 20:24:03 +09:00 committed by Marge Bot
parent 9649eee307
commit d5b05d53e4
2 changed files with 12 additions and 6 deletions

View file

@ -1683,11 +1683,16 @@ tex_to_msl(struct nir_to_msl_ctx *ctx, nir_tex_instr *tex)
P(ctx, ", ");
src_to_msl(ctx, comparator);
}
P(ctx, ", ");
if (offset)
/* SPIR-V does not allow offsets for cube samplers (neither does MSL).
* nir_opt_constant_folding will remove offsets that are 0, so we need to
* add them here. */
if (offset) {
P(ctx, ", ");
src_to_msl(ctx, offset);
else
P(ctx, "int2(0)");
} else if (tex->sampler_dim != GLSL_SAMPLER_DIM_CUBE) {
P(ctx, ", int2(0)");
}
/* Non-depth textures require component */
if (!comparator) {

View file

@ -170,6 +170,7 @@ kk_get_device_features(
.multiViewport = true,
.robustBufferAccess = true,
.samplerAnisotropy = true,
.shaderImageGatherExtended = true,
.shaderInt16 = true,
.shaderInt64 = true,
.shaderResourceMinLod = true,
@ -410,8 +411,8 @@ kk_get_device_properties(const struct kk_physical_device *pdev,
.minStorageBufferOffsetAlignment = KK_MIN_SSBO_ALIGNMENT,
.minTexelOffset = -8,
.maxTexelOffset = 7,
.minTexelGatherOffset = -32,
.maxTexelGatherOffset = 31,
.minTexelGatherOffset = -8,
.maxTexelGatherOffset = 7,
.minInterpolationOffset = -0.5,
.maxInterpolationOffset = 0.4375,
.subPixelInterpolationOffsetBits = 4,