Add FOG_ENABLE param, prune fog cone on the board profile (fix -6.165ns setup)
The fog blend's tex_color*F multiply landed on the texture->color critical path (u_texcache RAM -> u_tex|tex_color -> mult_126 -> raster_pixel_color_q, 46ns, -6.165ns setup). Fog is a proven no-op for the current board scene (96.5% F=255), so pay zero for it here. FOG_ENABLE (default 1, byte-identical fog) added to gs_stub; each fog mux gated (FOG_ENABLE && ras_fge) so FOG_ENABLE=0 constant-folds the entire fog cone away (multiply, FOGCOL adders, s2_fog_f/persp_fog_f5 interp). Threaded through top_psmct32_raster_demo_bram; set FOG_ENABLE(1'b0) on the active GS_SH3_LPDDR_FB board arm (elsif at :1086, the one the QSF profile compiles). Fog stays default-on everywhere else. Verified: FOG_ENABLE=1 fog TBs unchanged PASS; FOG_ENABLE=0 (new tb_gs_fog_disabled + board scene TB) emits raw color = pre-fog datapath; board elaborates clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1108,6 +1108,12 @@ module de25_nano_psmct32_raster_demo_top (
|
||||
.BIN_BUFFER_ENABLE (1'b0),
|
||||
.HEARTBEAT_SPLICE_ENABLE (1'b0),
|
||||
.PERSPECTIVE_CORRECT(1'b1),
|
||||
// GS per-vertex FOG pruned for the board scene: 96.5% of this frame's
|
||||
// vertices have F=255 (fog is a functional no-op here), so gate it OUT
|
||||
// to keep the texel*F multiply off the tex-cache->raster_pixel_color
|
||||
// critical path (recovers the -6.165 ns setup fail). Covers the
|
||||
// FB/_Z/_640/_SCHED/_MULTI variants, which all share this instance.
|
||||
.FOG_ENABLE (1'b0),
|
||||
.SUBPIXEL_XY (1'b1), // Ch416 — preserve native XYZ 12.4 and sample pixel centers
|
||||
.PERSP_RECIP_IDX_BITS(11),
|
||||
.BILINEAR_ENABLE (1'b1),
|
||||
|
||||
@@ -195,6 +195,10 @@ module top_psmct32_raster_demo_bram
|
||||
// Default 0 generate-guards all perspective logic out (zero cost); only the
|
||||
// GS_PERSP_DEMO board profile sets it 1.
|
||||
parameter bit PERSPECTIVE_CORRECT = 1'b0,
|
||||
// GS per-vertex FOG compile gate, forwarded to gs_stub. Default 1 (fog
|
||||
// active). Board profiles whose scene fog is a functional no-op set 0 to
|
||||
// prune the fog cone off the texture->color critical path.
|
||||
parameter bit FOG_ENABLE = 1'b1,
|
||||
parameter bit SUBPIXEL_XY = 1'b0,
|
||||
parameter int PERSP_RECIP_IDX_BITS = 8, // Ch351 — perspective reciprocal LUT width (far-W -> 11)
|
||||
parameter int GRAD_DIV_CYCLES = 1, // Ch352 — triangle-setup divide settle cycles (board fits -> 4)
|
||||
@@ -1017,6 +1021,7 @@ module top_psmct32_raster_demo_bram
|
||||
.FB_RD_REGISTERED (1'b1),
|
||||
.Z_RD_REGISTERED (1'b1),
|
||||
.PERSPECTIVE_CORRECT(PERSPECTIVE_CORRECT), // Ch301 — forwarded board param (default 0)
|
||||
.FOG_ENABLE (FOG_ENABLE), // per-vertex fog gate; 0 prunes the fog cone
|
||||
.SUBPIXEL_XY (SUBPIXEL_XY), // Ch416 — native GS 12.4 coverage (default 0)
|
||||
.PERSP_RECIP_IDX_BITS(PERSP_RECIP_IDX_BITS), // Ch351 — perspective reciprocal LUT width (far-W -> 11)
|
||||
.GRAD_DIV_CYCLES(GRAD_DIV_CYCLES), // Ch352 — triangle-setup divide settle cycles (board -> 4)
|
||||
|
||||
Reference in New Issue
Block a user