Repository navigation
Conversation
A GCN color target with LINEAR_GENERAL set threw. It is now a linear surface with the pitch CB_COLOR_PITCH gives, unpadded, at CB_COLOR_BASE plus the low byte of CB_COLOR_VIEW SLICE_START, whatever its tile mode index, as shadPS4 reads these registers. The post-draw range check takes the target's own alignment, at most the 256 bytes it required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Feature Merge Risk:
|
What
A PS4 (GCN) color target with
CB_COLOR_INFO.LINEAR_GENERAL(bit 7) set threwendian-swapped or linear-general GCN color targets are not implemented, although the texture path already reads GCN tile index 31 (linear general) as an unpadded linear surface.DecodeGcnColorBuffernow decodes such a target the way shadPS4 reads these registers (GetTileMode,Address,BaseSlice):CB_COLOR_ATTRIBis ignored and the target is linear, as a newColorTileMode::GcnLinearGeneral(0x109, clear of feat(agc): draw PS4 color targets in the PRT tile modes boykopovar/AnyPS5#22514's 0x105 to 0x108);CB_COLOR_PITCHtexels apart with no further padding (GcnLinear, the linear-aligned mode, still pads to max(8, 64 / bytes per texel));CB_COLOR_BASEplusCB_COLOR_VIEW.SLICE_START[7:0]bytes, and no slice offset is added.ColorTileModeBlockBytesgives the new mode a 1-byte alignment. The post-draw range check inDraw.cpp, which required 256-byte alignment for every target, now takes the smaller of 256 and the target'sColorTileModeBlockBytes; that is still 256 for every other mode. Linear-general targets take the same CPU staging path asGcnLinearones.Still refused:
SLICE_START[10:8]set on a linear-general view, multisampled linear-general targets, endian-swapped targets (ENDIAN!= 0), and aTILE_MODE_INDEXof 31 withoutLINEAR_GENERAL. A single-sampleFAST_CLEARkeepsmain's refusal. A debt fragment adds aPS4 (GCN) linear-general color targetsentry (not checked on a console).Tests:
GcnLinearGeneralColorTarget(agc_driver_gcn_linear_general_color_target): an unpadded 72x64 RGBA8 target (72 is not a multiple of the 16 texels linear-aligned would pad to) with tile mode index 14 inCB_COLOR_ATTRIB, atCB_COLOR_BASEand atCB_COLOR_BASE + 0x44. A triangle is drawn into each; every texel must hold its background or the drawn color at its row-major place, and the 256 guard bytes around the target (plus the 0x44 skipped bytes) must stay unchanged.GcnColorTarget.cppLinearGeneralTargetsDecode: the byte offset and tile-index override, an 8-bit target with a 24-texel pitch (accepted as linear-general, refused as linear-aligned), and the refusals listed above.SLICE_STARTbyte fails both tests; padding the pitch asGcnLineardoes fails both (PS4 color target pitch or slice is not padded the way its tile mode pads them). Without theDraw.cppchange the execution test fails at the0x44target withnull or misaligned address.Tested
WSL2 Ubuntu on Windows 11, Release build with GCC, lavapipe (Mesa 25.2.8). Same 29 focused tests (
agc_driver_gcn_*,agc_gcn_*,agc_driver_linear_target_*,agc_driver_cmask_fast_clear,agc_driver_eqaa_color_target) withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer:main526b7b1: 29/29 passed, 28Insert instance layer "VK_LAYER_KHRONOS_validation"lines, nowas not foundline, 84VUID-VkDeviceCreateInfo-pNext-pNext.agc_driver_gcn_linear_general_color_target), 29 insert lines, nowas not foundline, 87VUID-VkDeviceCreateInfo-pNext-pNext.The only validation ID on both is the device-creation one from Ubuntu's older 1.3.275 layer (boykopovar#17693), three per test; the change adds no new
VUID-. No title was run.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)tools/pr_overlap.pyfailed closed. boykopovar#18177, boykopovar#22140 and boykopovar#22514 conflict only on adjacent lines:GcnColorTarget.cpp'smain()call list and, for boykopovar#22514, the end of theColorTileModeenum andColorTileModeIsGcn; whichever merges second keeps both sides. The 41 PRs it could not compare were each merged by hand against this branch and againstmain: none gains a conflicting file or hunk from this branch.🤖 Generated with Claude Code
Summary by CodeRabbit