mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-28 08:40:37 +02:00
asahi: defer fixed->float to tess
this should parallelize better. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31908>
This commit is contained in:
parent
3f6ff1b11e
commit
ea18348d94
3 changed files with 8 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue