Repository navigation
fix(shader): number an instanced draw's hull patches across its instances - #4450
Conversation
|
Rebase handoff — this PR is the 6th link of the hull/tessellation chain (it contains #4222 underneath), so I stacked the rebase on the already-rebased chain through One conflict in Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up (whole chain): Head is |
322c5fb to
26ff6ad
Compare
|
@Celegans12 @blawesom thanks both for the rebase offers. I've rebased this onto #4222's current head ( Tested and written by Claude (AI assistant) on a contributor's machine. |
26ff6ad to
b538d42
Compare
b538d42 to
10337ce
Compare
|
Rebased onto Three spots conflicted only because
On Windows (RTX 4090), the full suite gives 1183 pass and 14 skip, with Tested and written by Claude (AI assistant) on a contributor's machine. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
…nces With GE_CNTL.BREAK_WAVE_AT_EOI clear, the instances of a tessellated draw share hull threadgroups: the relative patch index counts on through the instances, while the host's PrimitiveID restarts with each one. The local stage now passes its draw-relative instance (InstanceIndex - BaseInstance) to the hull, which numbers its patches instance * patches-per-instance + PrimitiveID before taking (mod PRIM_GRP_SIZE) mod NUM_PATCHES. Instances that start a threadgroup anyway (BREAK_WAVE_AT_EOI, or patches per instance a multiple of the group) keep the per-instance PrimitiveID. This replaces boykopovar#4201's refusal of a hull or domain that uses its relative index as data while BREAK_WAVE_AT_EOI is clear, and builds on its decode of the bit (breakAtInstance, request serialization and draw keys). - Hull and domain cache keys hold the patches per instance instead of the bit; an indirect draw recompiles its hull and domain for each record's instance count. - The device enables shaderDrawParameters when available. Without it, a hull using its relative index as data in such a draw is refused, as is a domain doing so (passing the instance on to the domain is not implemented). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked on the PR merged onto main: build, Added one commit: the TechnicalDebt line for the relative patch index said it throws when |
10337ce to
3c17b3d
Compare
What
When GE_CNTL.BREAK_WAVE_AT_EOI is clear, the instances of a tessellated draw share hull threadgroups. The relative patch index then counts on through the instances, while the host's PrimitiveID restarts with each one. #4201 rebuilds the index from PrimitiveID alone, which is only right when every instance starts a threadgroup.
InstanceIndex - BaseInstance) to one more interface slot. The hull reads it from control point 0, andgroupedPatchnumbers the patchesinstance * patchesPerInstance + PrimitiveIDbefore taking(mod PRIM_GRP_SIZE) mod NUM_PATCHES.GE_CNTL.BREAK_WAVE_AT_EOIintoTessellationConfiguration::breakAtInstance(request serialization, draw and pipeline keys) and refuses a hull or domain that uses its relative index as data while the bit is clear. This PR builds on that decode and replaces the refusal with the numbering above; it no longer decodes or serializes the bit itself.TessellationInstancePatches) and go into the hull and domain cache keys, in place of feat(agc): rebuild the hull's relative patch index when it is used as data #4201'sbreakAtInstancekey: the bit changes the compiled program only through the patches per instance.shaderDrawParameterswhen it has it, andShaderDeviceProfileand shader validation acceptBaseInstanceandDrawParametersin vertex stages. Without the feature, a hull that uses its relative index as data in such a draw is refused.Tested
Windows 11, RTX 4090.
agc_driver_tessellation. NewRequireInstancedRelativePatchestest: two instances of three patches, first instance 1, (patches per group, primitive group) = (4, 8). The test reads back the relative index that the second instance's patches 0 and 2 carry. The counted-through numbering, a per-instance restart and the absolute instance each give different values. Also checked: the (3, 3) and BREAK_WAVE_AT_EOI restart cases, the domain refusal, and the refusal without DrawParameters.agc_shader_memory. The patches per instance change only the hull and domain keys, and BREAK_WAVE_AT_EOI survives serialization and leaves the key as for one instance.maine34c47921(fix(shader): record BDA faults in hull programs instead of refusing them #4222 merged). The tessellation levels live in the draw state, so the instanced test draws pass their levels inPatchDraw. feat(agc): rebuild the hull's relative patch index when it is used as data #4201's two "BREAK_WAVE_AT_EOI is clear" refusal cases are dropped, as this PR replaces that refusal; the instanced refusals above cover the domain and the missing DrawParameters. Two lists onmaingained entries next to this PR's:StageInputKindkeepsLayerExportedand addsBaseInstance, and the shader validation keeps main's mesh ClipDistance condition next to this PR's DrawParameters one.ctest, Windows, RTX 4090): of 1198 tests, 1183 pass, among themagc_driver_tessellation, and 14 hardware- or display-dependent tests skip.check_main_syncfailstest_paths_with_spaces_and_unicode_are_reported_verbatimbecause this machine's console code page printséasé; it does not touch this change.0x8040(BREAK_WAVE_AT_EOI 0). Its terrainDRAW_INDIRECTrecords hold 4 vertices and 2 to 3,157 instances of one 4-point patch each. With this change the hull compiles for every record and the title renders past these draws to its post-load popover.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (the unimplemented domain case is a refusal).mdfiles or images added to the repository🤖 Generated with Claude Code