Skip to content

shader: lower pixel ordered sections (POPS) to rasterizer-ordered views - #114

Open
VastyViz wants to merge 1 commit into
Zettrox:mainfrom
VastyViz:shaders/pops-rov
Open

VastyViz wants to merge 1 commit into
Zettrox:mainfrom
VastyViz:shaders/pops-rov

Conversation

@VastyViz

Copy link
Copy Markdown

Port pixel POPS/ROV support from upstream VIctory with two refinements:

  • Track pixel shader initialized SGPR bounds in io::raise (user SGPRs, primitive mask, and POPS collision id) and seed the primitive mask as 0 and the POPS collision id (when DB_SHADER_CONTROL bit 16 is set) as 1 << 16. Using wave_id = 1, collision_id = 0, overlap = 0 satisfies the hardware invariant wave_id != collision_id so both the fast-path overlap check and the wrap-around wait test (wave_id + ~collision_id <u exiting + ~collision_id) pass immediately when src_pops_exiting_wave_id (operand 239) is 0, avoiding a LOOP_LIMIT spin on inactive lanes.
  • Annotate table/heap UAV handles in POPS pixel shaders with DXIL IsROV (0x2000), emit ShaderFlags::ROVS (1 << 18) and SFI0 0x1000, and track ROV usage in bitcode::opt::Usage so dead-code elimination keeps flags accurate.
  • Add synthetic test ordered_pixel_sections_use_rasterizer_ordered_views covering both the POPS wait loop and non-POPS refusal.

Eliminates all 10 remaining 'emit: a hardware SGPR input' failures (10/10 validated and D3D12 pipelines created).

Port pixel POPS/ROV support from upstream VIctory with two refinements:

- Track pixel shader initialized SGPR bounds in io::raise (user SGPRs, primitive mask, and POPS collision id) and seed the primitive mask as 0 and the POPS collision id (when DB_SHADER_CONTROL bit 16 is set) as 1 << 16.
  Using wave_id = 1, collision_id = 0, overlap = 0 satisfies the hardware invariant wave_id != collision_id so both the fast-path overlap check and the wrap-around wait test (wave_id + ~collision_id <u exiting + ~collision_id) pass immediately when src_pops_exiting_wave_id (operand 239) is 0, avoiding a LOOP_LIMIT spin on inactive lanes.
- Annotate table/heap UAV handles in POPS pixel shaders with DXIL IsROV (0x2000), emit ShaderFlags::ROVS (1 << 18) and SFI0 0x1000, and track ROV usage in bitcode::opt::Usage so dead-code elimination keeps flags accurate.
- Add synthetic test ordered_pixel_sections_use_rasterizer_ordered_views covering both the POPS wait loop and non-POPS refusal.

Eliminates all 10 remaining 'emit: a hardware SGPR input' failures (10/10 validated and D3D12 pipelines created).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant