Repository navigation
fix(shaders): the noperspective workaround baked offline too; RX_VK_LOWER_SKIP in the program stamp - #2782
fix(shaders): the noperspective workaround baked offline too; RX_VK_LOWER_SKIP in the program stamp#2782FIocker wants to merge 1 commit into
Conversation
…d baked offline too, RX_VK_LOWER_SKIP in the program stamp - nx2/bake_ds/bake_ds.cpp translates the fragment stage before it emits the vertex stage, as vk_shader.cpp translate_into does, and sets noperspective_outputs / scaled_noperspective_inputs the same way (not with indexed fragment reads or transform feedback): an offline-baked bank now has the AMD clipped-vertex workaround as live translation does - RX_VK_LOWER_SKIP is in translator_stamp's prefix list and bake_ds.cpp's (test_program_stamp_knobs keeps the two equal): programs translated while it is set are kept apart in the cache, so a bisection sees cached programs too - spirv_emit_context.cpp: loads already holds passthrough's mask, so FragCoord's condition is loads or noperspective_as_smooth - the (super build) tags gone from emit_spirv.cpp, stream.h and vk_shader.cpp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joey-Magnus
left a comment
There was a problem hiding this comment.
I merged this into current main and ran the bake, stamp and shader checks: test_bake_ds, test_bake_portability, test_bake_skeleton, test_program_stamp_knobs, test_shader_stamp_*, test_prepared_stamps and the vk/shader/program subset of run_all. All pass. The bake_ds.cpp change matches vk_shader.cpp translate_into:1341-1348 line for line: fragment first, no indexed attribute reads, xfb_count == 0, and scaled_noperspective_inputs set from the vertex mask. Dropping the passthrough term in DefineInputs is right, since loads already ORs in passthrough. RX_VK_LOWER_SKIP is now in both prefix lists, and test_program_stamp_knobs keeps them equal. One correction to the description: no CI job builds nx2/bake_ds/bake_ds.cpp. The Linux jobs only run the source checks, and nothing in .github compiles it through nx2/bake_ds/build.sh. So it is still unbuilt after CI. I couldn't build it here either (no fmt/boost externals). Please run nx2/bake_ds/build.sh once on Linux before this merges, or ask someone who has the externals to.
#1830 merged with a few non-blocking notes left from hckrman101's and Joey-Magnus's reviews; this PR is those. The main one: an offline-baked program bank didn't get the AMD noperspective workaround that live translation now has.
What it does
nx2/bake_ds/bake_ds.cpp):vk_shader.cpp translate_intodoes.noperspective_outputs/scaled_noperspective_inputsthe same way: not with indexed fragment reads and not with transform feedback.RX_VK_LOWER_SKIPis in the program stamp: it's intranslator_stamp's prefix list and inbake_ds.cpp's, whichtest_program_stamp_knobs.pykeeps equal. Programs translated while it's set are kept apart in the cache, so a bisection also sees programs that were already cached. The comment says so.DefineInputs'loadsis alreadyinfo.loads.mask | info.passthrough.mask, so FragCoord's condition is justloads.AnyComponent(PositionX) || noperspective_as_smooth.emit_spirv.cpp,stream.handvk_shader.cpp.Testing
vk_shader.cpp,spirv_emit_context.cppandemit_spirv.cppcompile with clang usingnx2/build.py's renderer flags.bake_ds.cppis POSIX-only; I syntax-checked it on Windows with stand-inunistd.h/dlfcn.h, so Linux CI is its real build.test_program_stamp_knobs.pyamong them.test_bake_portability.pyfails on this PC for main as well.🤖 Generated with Claude Code