mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
kk: Clamp negative array indices to 0
Required so that uint array formats don't incorrectly wrap to last array slice instead of the first one. For some reason this only happens with uint texture formats while int and float formats work as expected. Acked-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/38713>
This commit is contained in:
parent
5527b71bce
commit
60f6bd4761
1 changed files with 2 additions and 2 deletions
|
|
@ -614,12 +614,12 @@ round_src_component_to_uint(struct nir_to_msl_ctx *ctx, nir_src *src,
|
|||
{
|
||||
bool is_float = msl_src_is_float(ctx, src);
|
||||
if (is_float) {
|
||||
P(ctx, "uint(rint(");
|
||||
P(ctx, "uint(max(int(rint(");
|
||||
}
|
||||
src_to_msl(ctx, src);
|
||||
P(ctx, ".%c", component);
|
||||
if (is_float) {
|
||||
P(ctx, "))");
|
||||
P(ctx, ")), int(0)))");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue