libagx: use designated initializers

these work now :-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32759>
This commit is contained in:
Alyssa Rosenzweig 2024-12-11 12:16:04 -05:00 committed by Marge Bot
parent a3b796ba19
commit 07e1b523b9

View file

@ -797,9 +797,10 @@ libagx_tess_isoline(constant struct libagx_tess_args *p,
}
}
struct CHWTessellator ctx;
ctx.mode = mode;
ctx.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE;
struct CHWTessellator ctx = {
.mode = mode,
.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE,
};
/* Connectivity */
if (!p->points_mode) {
@ -838,13 +839,10 @@ libagx_tess_tri(constant struct libagx_tess_args *p,
float tessFactor_Weq0 = factors[2];
float insideTessFactor_f = factors[4];
struct CHWTessellator ctx;
ctx.Point = NULL;
ctx.Index = NULL;
ctx.mode = mode;
ctx.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE;
ctx.bUsingPatchedIndices = false;
ctx.bUsingPatchedIndices2 = false;
struct CHWTessellator ctx = {
.mode = mode,
.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE,
};
// Is the patch culled? NaN will pass.
if (!(tessFactor_Ueq0 > 0) || !(tessFactor_Veq0 > 0) ||
@ -1172,14 +1170,10 @@ libagx_tess_quad(constant struct libagx_tess_args *p,
float insideTessFactor_U = factors[4];
float insideTessFactor_V = factors[5];
// TODO: fix designated initializer optimization in NIR
struct CHWTessellator ctx;
ctx.Point = NULL;
ctx.Index = NULL;
ctx.mode = mode;
ctx.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE;
ctx.bUsingPatchedIndices = false;
ctx.bUsingPatchedIndices2 = false;
struct CHWTessellator ctx = {
.mode = mode,
.index_bias = patch * LIBAGX_TES_PATCH_ID_STRIDE,
};
// Is the patch culled?
if (!(tessFactor_Ueq0 > 0) || // NaN will pass