asm: Fix x86 assembly for inverse matrix operations

In commit 3175b63a0d, Marek stopped
allocating the GLmatrix::inv field with malloc, instead embedding
it directly in the structure.  So, we need to drop a level of
indirection here and use (matrix pointer + MATRIX_INV) as the
inverse matrix array directly, rather than reading a pointer at
that offset and chasing it.

Fixes: 3175b63a0d ("mesa: don't allocate matrices with malloc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7889>
This commit is contained in:
Kenneth Graunke 2020-12-02 14:38:07 -08:00
parent 94c6511757
commit 70762b826b

View file

@ -57,7 +57,7 @@ GLNAME(_mesa_sse_transform_rescale_normals_no_rot):
MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
ADD_L ( CONST(MATRIX_INV), EDX ) /* matrix->inv */
MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
@ -119,7 +119,7 @@ GLNAME(_mesa_sse_transform_rescale_normals):
MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
ADD_L ( CONST(MATRIX_INV), EDX ) /* matrix->inv */
MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */
@ -212,7 +212,7 @@ GLNAME(_mesa_sse_transform_normals_no_rot):
MOV_L ( ARG_DEST, EDI ) /* ptr to dest GLvector3f */
MOV_L ( ARG_MAT, EDX ) /* ptr to matrix */
MOV_L ( REGOFF(MATRIX_INV, EDX), EDX) /* matrix->inv */
ADD_L ( CONST(MATRIX_INV), EDX ) /* matrix->inv */
MOV_L ( REGOFF(V4F_COUNT, ESI), ECX ) /* source count */