Repository navigation
Conversation
When a draw targets a specific 3D or 2D array slice without vertex layer exports, PA_CL_VS_OUT_CNTL does not set bit 18, so layerExported is 0. With a single-layer view, Vulkan's gl_Layer evaluates to 0, which previously caused the packed pixel ancillary word (bits 16..28) to read layer index 0 across all slices. Unreal Engine 4's PostProcessCombineLUTs draws each slice of a 3D volume LUT with a separate quad setting CB_COLOR_VIEW.SLICE_START. Because InLayerIndex read 0 for every slice, the neutral LUT's blue channel was collapsed to 0, severely altering scene color grading and producing an unnatural green tint in outdoor environments. Add pipeline specialization constant PipelineSpecialization::LayerBase (8235u) to carry the base slice (depthSlice or arraySlice) into the fragment shader when layerExported is 0. The effective layer index is evaluated as (gl_Layer * LayerExported) + LayerBase. Also compute the layer count for 2D array targets in State::DecodeColorBuffer when multiple slices are bound. Bump recompile request serialization to version 24.
|
The conventions check is failing because the required |
|
Windows build of #5500: Windows 10 (19045), MinGW-w64 GCC 15.2, Release, Result: the build stops ( Not tested: everything that needs a build of this PR, whether the line comes from a stacked branch, Linux, a title run. AI-assisted (Claude Code). |
|
I checked the current |
Ported from upstream PR boykopovar#5500, adapted to main: the draw decode sets the color view slice as layerBase (the layer-export decode this PR also touches does not exist on main, so its diagnostic and layers hunks are skipped). layerBase is added to the pixel info, request key, shader info, disk cache and pipeline specialization constants. The request serialization stays at version 24, bumped once by the front-face commit. The shader disk cache format is bumped to 36. Not ported: unrelated hunks the upstream commit carried in Recompiler.cpp (dot-product capability option) and its ShaderMemory serializer tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj
* fix(agc): accept integer tessellation partitioning Ported from upstream PR boykopovar#5234, adapted to our triangle/fractional-odd only tessellation path: VGT_TF_PARAM.PARTITIONING 0 decodes, emits equal spacing and bounds factors at 64. Metal still refuses guest tessellation draws in MetalRenderState. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(agc): accept fractional-even tessellation partitioning Ported from upstream PR boykopovar#5402 (its integer-partitioning base commit is the previous commit), adapted to our triangle-only tessellation path: VGT_TF_PARAM.PARTITIONING 3 decodes, emits fractional-even spacing and bounds factors at 64. Metal still refuses guest tessellation draws. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): place hull input components by their offset in the control-point slot Ported from upstream PR boykopovar#4723 (shader hunk; its Vulkan execution test is not ported). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): lower hulls with one input or one output control point (partial) Ported from upstream PR boykopovar#5457, commits 1, 4 and 5 of 5 (hull exec masks restored through phis, input stride from the patch term, one output control point per patch). Vulkan execution-test hunks are not ported. Skipped from boykopovar#5457, with reasons: - relative patch index rebuilt as data: needs GE_CNTL.PRIM_GRP_SIZE and BREAK_WAVE_AT_EOI in TessellationConfiguration, VGT_LS_HS_CONFIG patchesPerGroup and the request key/serializer additions. None of these exist on main, which only lowers triangle fractional-odd hulls. - recording BDA faults in hull programs: drops a refusal whose safety rests on upstream hull work we lack; the refusal stays. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): honour SPI_BARYC_CNTL.FRONT_FACE_ALL_BITS for the front-face input Ported from upstream PR boykopovar#5314. Tracks SPI_BARYC_CNTL in the draw key and shader request key, and bumps the request serialization to version 24 (shared with the following slice-offset port, which adds no second bump). Not ported: the ShaderMemory serializer-version assertions of the PR, which build on upstream test scaffolding absent from main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): propagate color view slice to pixel ancillary input Ported from upstream PR boykopovar#5500, adapted to main: the draw decode sets the color view slice as layerBase (the layer-export decode this PR also touches does not exist on main, so its diagnostic and layers hunks are skipped). layerBase is added to the pixel info, request key, shader info, disk cache and pipeline specialization constants. The request serialization stays at version 24, bumped once by the front-face commit. The shader disk cache format is bumped to 36. Not ported: unrelated hunks the upstream commit carried in Recompiler.cpp (dot-product capability option) and its ShaderMemory serializer tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * test(shader): cover tessellation partitioning, hull slot placement, layerBase and serializer v24 Fix the stale serialization version expectation in the shader memory test, add pixel ancillary rows with a non-zero layerBase, extract PixelLayerBase for a derivation test, and point the FrontFace note at TechnicalDebt.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: XairRrR <dev910382@gmail.com>
…-base Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # core/shader/recompiler/ShaderDiskCache.cpp
|
Removed the Also merged current Pushed in 720127c. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for tracking this down. Points before this can go in:
- Source for the semantics. The description says the rasterizer feeds
CB_COLOR_VIEW.SLICE_STARTinto ancillary bits 16..28 when no layer is exported, but cites nothing. As far as I know the render target index there comes from the layer exported by the previous stage, and the CB applies the view slice itself when addressing the target. Please cite a source (ISA guide, Mesa/LLPC, a measurement) or a test that shows the slice offset reaches the pixel shader. The Hello Neighbor 2 screenshot only shows the symptom; it does not show where the value comes from. - Unrelated/undescribed changes.
State.cpp:873now suppresses the "layer/viewport index vertex exports are ignored" message for non-zero slices, andState.cpp:1119changescolor.layersfor 2D arrays. Neither is in the description and neither has a test. Please justify them or drop them. - No test for the new wiring.
DrawDecode.cpp:120-122(layerBasefromdepthSlice/arraySlice) andsameDecodeare not exercised; the tests only cover the IR and the serializer. - Conflicts with
main.mainis now at request serialization version 27 andPipelineSpecializationid8235uis taken byStencilReferenceOffset;StageIO.hpp,Recompiler.hpp,DrawDecode.cpp,DrawRegisterKey.cppandShaderMemory.cppconflict too. Please rebase and renumber the version and the constant, and rerunpixel_ancillaryandagc_shader_memory.
LayerBase moves to specialization id 8236 and request version 28. The unrelated color-view warning and 2D array layer-count edits are dropped. PixelLayerBase covers the slice chosen for a draw that does not export Layer. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Merged current main. |
|
The two open points are still open, and I did not invent a source for them. There is still no ISA, Mesa or LLPC reference that feeds
|
What
When a draw does not export
Layer, the pixel ancillary render-target index was 0 even ifCB_COLOR_VIEWstarted at a later slice.PixelLayerBaseuses the 3D depth slice, or the 2D array slice, in that case, and 0 when a layer is exported or no color target is bound.DrawDecodestores it on the pixel stage andsameDecodecompares it. The recompiler adds that value to the exported layer in the packed ancillary word.PipelineSpecialization::LayerBaseis8236(8235isStencilReferenceOffseton main). Recompile requests are version 28; versions through 27 leave the base at 0.The color-view warning suppression and the 2D-array
color.layersedit are not part of this PR. The slice addend is this driver's model ofSLICE_START. It is not a console measurement; the ancillary bit positions follow the RDNA 3 / GCN guides already cited indocs/dev/debt/shader.md.Tested
pixelLayerBaseTestsinagcgraphics tests checks the 2D slice, the 3D depth slice, an exported layer, and a draw with no color target.pixel_ancillaryandagc_shader_memorywere not re-run after the merge onto current main.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)