From 85fc7268a690e38ecb7f3b04dbfb8d70f2570a79 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Thu, 2 Nov 2023 20:36:51 -0600 Subject: rtl/gfx: implement perspective division --- rtl/gfx/gfx_defs.sv | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'rtl/gfx/gfx_defs.sv') diff --git a/rtl/gfx/gfx_defs.sv b/rtl/gfx/gfx_defs.sv index 1fe0df2..6e96b4e 100644 --- a/rtl/gfx/gfx_defs.sv +++ b/rtl/gfx/gfx_defs.sv @@ -11,10 +11,18 @@ `define FP_MUL_STAGES 5 // ~144 LUTs ~1 bloque DSP `define FP_INV_STAGES 3 // ~178 LUTs ~1 bloque DSP -typedef logic[`FLOAT_BITS - 1:0] fp; -typedef fp vec2[2]; -typedef fp vec4[`FLOATS_PER_VEC]; -typedef vec4 mat4[`VECS_PER_MAT]; +typedef logic[`FLOAT_BITS - 1:0] fp; +typedef fp vec2[2]; +typedef fp vec4[`FLOATS_PER_VEC]; +typedef fp[`FLOATS_PER_VEC - 1:0] vec4_packed; +typedef vec4 mat4[`VECS_PER_MAT]; + +`define FP_UNIT 16'h3c00 + +typedef struct packed +{ + fp x, y, z, w; +} attr4; typedef logic[1:0] index4; -- cgit v1.2.3