Repository navigation
feat(agc): sample border colors from the border color table - #1221
Closed
awake-devel wants to merge 1 commit into
Closed
awake-devel wants to merge 1 commit into
awake-devel wants to merge 1 commit into
Conversation
A sampler with BORDER_COLOR_TYPE 3 whose clamp mode reads the border takes its color from the border color table instead of throwing. The entry is the 4 dwords at base + BORDER_COLOR_PTR * 16, read when the resources are built and passed to VK_EXT_custom_border_color as a float custom color. Draws take the base from TA_BC_BASE_ADDR, dispatches from TA_CS_BC_BASE_ADDR; an unset base, a base past 48 bits and an integer-format texture throw. Builds holding such a sampler are never cached or recorded as recipes. Closes boykopovar#665 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RNrNcixatky8U4LfC7Ew5
This was referenced Oct 7, 2026
This was referenced Oct 8, 2026
2 of 4 tasks
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #665.
A sampler with
BORDER_COLOR_TYPE3 whose clamp mode reads the border now takes its color from the border color table instead of throwing.DecodeSamplerResourcedecodesBORDER_COLOR_PTR(S# word 3, bits 0–11). A table-type sampler that never reads its border decodes as before (fix(agc): accept a table border colour when no axis uses a border mode #941).BORDER_COLOR_PTR× 16 (the radeonsi and radv layout), read from guest memory when the resources are built and passed toVK_EXT_custom_border_coloras a float custom color withVK_FORMAT_UNDEFINED. The extension is enabled when the device hascustomBorderColorsandcustomBorderColorWithoutFormat; without them such a sampler throws. Live custom-color samplers are counted againstmaxCustomBorderColorSamplers.TA_BC_BASE_ADDR/_HI(context 0x20/0x21, added toDrawKeyRegisters), dispatches takeTA_CS_BC_BASE_ADDR/_HI(user config 0x380/0x381), the pairs Mesa programs. A dispatch that reads a table color with the compute pair unset throws, with no fallback to the graphics pair, as agreed in AGC sampler: border colour table (BORDER_COLOR_TYPE 3) not implemented #665.SamplerCachekey. AShaderResourcesthat holds such a sampler is not reusable, so it is never cached or recorded as a recipe, and a rewritten table or a moved base is read again by the next draw or dispatch.SamplerCacheis edited to name the entry as part of the key; no comment is added.#757 adds runtime-indexed sampler tables that create samplers without the entry. If both land, such a sampler throws instead of using a zero color: the decoded entry is an optional that
Samplerrequires.Tested
Linux (Arch, GCC 16.2.1), GeForce GTX 1050 Ti Max-Q, NVIDIA 580.178.04. Full
ctest: 400/400 pass.agc_driver_image_sample_border_color_table: compute dispatches sample a 13×7 RGBA8 image withimage_sample_lz,image_sample_landimage_samplethrough point clamp-to-border table samplers, with unnormalized and normalized coordinates: table entries 0–3 (entry 3 holds the words ThisIsAkill dumped from PPSA21567 in AGC sampler: border colour table (BORDER_COLOR_TYPE 3) not implemented #665), an entry rewritten between dispatches, a second table, and the rejections (no base, base past 48 bits, integer texture). Also passes withAPS5_NO_SAMPLER_CACHE=1. NVIDIA rounds the border color to the image's 8-bit precision (0.25 reads as 64/255), so the test allows half a step.agc_driver_graphics: decode tests for the pointer (bits 0–11, recorded only when a border mode reads it) and the captured PPSA21567 sampler; mock Vulkan tests that the entry reachesvkCreateSamplerbit for bit withVK_FORMAT_UNDEFINED, that a table-color build is not reusable while a fixed-color one is, and the device limit, missing extension and missing base. Each of these tests fails when the rule it covers is removed.VK_LAYER_KHRONOS_validation1.4.363.0 (core validation, errors and warnings): the full suite passes 400/400, and nothing this PR touches reports a message: the new test (with and withoutAPS5_NO_SAMPLER_CACHE=1),agc_driver_graphicsandagc_driver_emulated_color_compareare clean. As a control, leavingcustomBorderColorsandcustomBorderColorWithoutFormatout of device creation makes the new test reportVUID-VkSamplerCreateInfo-customBorderColors-04085andVUID-VkSamplerCustomBorderColorCreateInfoEXT-format-04014(the test itself still passes on NVIDIA), so the layer does check these samplers.bvh64_intersect_ray,scalar_wide_loads,view_past_last_mip) report oneVUID-vkDestroyDevice-device-05137each: one or twoVkBuffer/VkDeviceMemorypairs still alive atvkDestroyDevice. They report the same onmain(cea1ef1) with the same object counts, so they predate this PR.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_018RNrNcixatky8U4LfC7Ew5