diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-11-12 23:53:04 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-11-14 07:48:52 -0600 |
| commit | 8ed41312384e1f2e99b94576684fa06c1d5f468a (patch) | |
| tree | c019568bfd401fc25826a810f7aa0352ad629641 /rtl/gfx | |
| parent | 3e8235aa71a930be815e03230b64bb850b6ffdb4 (diff) | |
rtl/gfx: implement w-coordinate in funnel
Diffstat (limited to 'rtl/gfx')
| -rw-r--r-- | rtl/gfx/gfx.sv | 16 | ||||
| -rw-r--r-- | rtl/gfx/gfx_funnel.sv | 19 |
2 files changed, 23 insertions, 12 deletions
diff --git a/rtl/gfx/gfx.sv b/rtl/gfx/gfx.sv index cf209bf..f2a9990 100644 --- a/rtl/gfx/gfx.sv +++ b/rtl/gfx/gfx.sv @@ -43,13 +43,14 @@ module gfx ); logic raster_ready; - fixed_tri ws; + fixed_tri raster_ws; bary_lanes barys; paint_lanes raster_valid; frag_xy_lanes fragments; gfx_raster raster ( + .ws(raster_ws), .in_ready(raster_ready), .in_valid(0), //TODO .out_ready(funnel_ready), @@ -73,13 +74,11 @@ module gfx ); logic funnel_ready, funnel_valid; - frag_xy funnel_frag; - fixed_tri funnel_bary; + frag_xy frag; + fixed_tri frag_bary, frag_ws; gfx_funnel funnel ( - .bary(funnel_bary), - .frag(funnel_frag), .in_ready(funnel_ready), .in_valid(raster_valid), .out_ready(frag_ready), @@ -90,11 +89,12 @@ module gfx logic frag_ready, frag_valid; frag_paint frag_out; - gfx_frag frag + gfx_frag frag_ ( .out(frag_out), - .bary(funnel_bary), - .frag(funnel_frag), + + .ws(frag_ws), + .bary(frag_bary), .in_ready(frag_ready), .in_valid(funnel_valid), .out_ready(1), //TODO diff --git a/rtl/gfx/gfx_funnel.sv b/rtl/gfx/gfx_funnel.sv index 22fefe3..4710111 100644 --- a/rtl/gfx/gfx_funnel.sv +++ b/rtl/gfx/gfx_funnel.sv @@ -7,18 +7,20 @@ module gfx_funnel input frag_xy_lanes fragments, input bary_lanes barys, + input fixed_tri raster_ws, input paint_lanes in_valid, output logic in_ready, input logic out_ready, output logic out_valid, output frag_xy frag, - output fixed_tri bary + output fixed_tri frag_bary, + frag_ws ); logic skid_ready, stall, ready, valid; frag_xy next_frag, out_frag; - fixed_tri next_bary, out_bary; + fixed_tri next_bary, out_bary, out_ws, ws_hold; bary_lanes barys_hold; paint_lanes current, next; frag_xy_lanes fragments_hold; @@ -33,10 +35,17 @@ module gfx_funnel .* ); - gfx_skid_buf #(.WIDTH($bits(bary))) skid_bary + gfx_skid_buf #(.WIDTH($bits(frag_bary))) skid_bary ( .in(out_bary), - .out(bary), + .out(frag_bary), + .* + ); + + gfx_skid_buf #(.WIDTH($bits(frag_ws))) skid_ws + ( + .in(out_ws), + .out(frag_ws), .* ); @@ -74,10 +83,12 @@ module gfx_funnel always_ff @(posedge clk) if (!stall) begin if (ready) begin + ws_hold <= raster_ws; barys_hold <= barys; fragments_hold <= fragments; end + out_ws <= ws_hold; out_bary <= next_bary; out_frag <= next_frag; end |
