From 70762b826b6d2781de9e06f1dad5d5e741876704 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 2 Dec 2020 14:38:07 -0800 Subject: [PATCH] asm: Fix x86 assembly for inverse matrix operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 3175b63a0dfa290430f9f7eb651387788933a02b, 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: 3175b63a0df ("mesa: don't allocate matrices with malloc") Reviewed-by: Adam Jackson Reviewed-by: Marek Olšák Part-of: --- src/mesa/x86/sse_normal.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/x86/sse_normal.S b/src/mesa/x86/sse_normal.S index b04a77a7b2d..4a6573c6b7d 100644 --- a/src/mesa/x86/sse_normal.S +++ b/src/mesa/x86/sse_normal.S @@ -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 */