diff --git a/src/asahi/lib/shaders/tessellation.cl b/src/asahi/lib/shaders/tessellation.cl index ff9e2849486..a5725af6d5a 100644 --- a/src/asahi/lib/shaders/tessellation.cl +++ b/src/asahi/lib/shaders/tessellation.cl @@ -96,7 +96,10 @@ libagx_load_tess_coord(constant struct libagx_tess_args *p, uint raw_id) &p->patch_coord_buffer[p->coord_allocs[patch] + vtx]; /* Written weirdly because NIR struggles with loads of structs */ - return *((global float2 *)t); + uint2 fixed = *((global uint2 *)t); + + /* Convert fixed point to float */ + return convert_float2(fixed) / (1u << 16); } uintptr_t diff --git a/src/asahi/lib/shaders/tessellator.cl b/src/asahi/lib/shaders/tessellator.cl index 2ae8dcd7b42..bd4c92eff60 100644 --- a/src/asahi/lib/shaders/tessellator.cl +++ b/src/asahi/lib/shaders/tessellator.cl @@ -353,13 +353,6 @@ floatToFixed(const float input) return mad(input, FXP_ONE, 0.5f); } -static float -fixedToFloat(const FXP input) -{ - // Don't need to worry about special cases because the bounds are reasonable. - return ((float)input) / FXP_ONE; -} - static bool isOdd(const float input) { @@ -414,8 +407,8 @@ PatchIndexValue(private struct CHWTessellator *ctx, int index) static void DefinePoint(global struct libagx_tess_point *out, FXP fxpU, FXP fxpV) { - out->u = fixedToFloat(fxpU); - out->v = fixedToFloat(fxpV); + out->u = fxpU; + out->v = fxpV; } static void diff --git a/src/asahi/lib/shaders/tessellator.h b/src/asahi/lib/shaders/tessellator.h index a2547e51e38..4350a5573a2 100644 --- a/src/asahi/lib/shaders/tessellator.h +++ b/src/asahi/lib/shaders/tessellator.h @@ -31,8 +31,8 @@ enum libagx_tess_mode { }; struct libagx_tess_point { - float u; - float v; + uint32_t u; + uint32_t v; }; AGX_STATIC_ASSERT(sizeof(struct libagx_tess_point) == 8);