Repository navigation
pvr/g9p: A9 compute storage images: 1D, layers, integer formats, atomics - #42
Merged
henrikklee merged 7 commits intoDec 2, 2026
Merged
Conversation
1D views were refused at descriptor time and 1D samples and image accesses by the A9 backend, which takes 2D, 2D-array and cube only. A 1D image is a 2D one of height 1, so describe 1D views as 2D views and 1D array views as 2D array views, and lower the shaders to match: nir_lower_tex's lower_1d for samples and fetches, and y = 0 (a 1D array's layer moved to z) for image loads and stores. Generated-by: LLM Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
The A9 compute path took one storage image and loaded R32_UINT only, so every image load/store test in the CTS was refused: "more than one storage image binding" (they read one image and write another) or "image load format ... (R32_UINT only)". - A load reads the texel's 32-bit words as they are, so R32_SINT, R32_FLOAT and the R32G32B32A32 formats load as R32_UINT does. - Storage image i's descriptor words are DMAed to common 40 + 8 * i (pvr_arch_g5p_compute.c already uploads them so); two fit below the device fence at 56. The second shares 48-55 with a second sampled texture, which is refused in either order. Tested on an iPhone 6s (S8003): dEQP-VK.image.load_store.* through deqp-runner gives 24 passes (the R32 and RGBA32 formats on 2D, 2D array, cube and cube array, single layer), where all were refused; dEQP-VK.api.smoke.* stays 8/8. Generated-by: LLM Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
Generated-by: LLM Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
An A9 compute image store already takes a third coordinate for an array layer or a cube face (g5p_image_access(), three coordinates); a load was refused for anything but a 2D image, so Zink's compute pipeline failed. Loads take the third coordinate the same way. On an iPhone 6s (S8003), GLES3.1 image_load_store 2d / 2d_array / cube cases of the sample: 5 -> 14 of 46 pass, no GPU reset. What remains is image atomics and stores of 8/16-bit integer formats. Generated-by: LLM Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
A9 compute stores of RGBA8/RG8/R8 and RGBA16/RG16/R16 UINT and SINT
were refused ("no A9 pack path yet"). They take the packed store of
the f16 formats: four 16-bit lanes in two dwords, which the store
converts to the format's channels (8-bit channels packed as bytes read
back wrong, as 16-bit lanes they are right).
On an iPhone 6s (S8003): 5 more GLES3.1 image_load_store store cases
of the sample pass (rgba8i, rgba8ui, rgba16ui on 2D arrays, cubes and
3D slices), no regression in the 62 image_load_store cases.
Generated-by: LLM
Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
Loads of RGBA8/RG8/R8 and RGBA16/RG16/R16 UINT and SINT storage images were refused. They take the f16 formats' packed load: four 16-bit lanes in two dwords, here zero- or sign-extended integers (missing channels 0, 0, 0, 1). On an iPhone 6s (S8003): 4 more GLES3.1 image_load_store cases of the sample pass (integer format_reinterpret and load_store), no regression in the 62 image_load_store cases. Generated-by: LLM Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
No A9 image atomic is known, so image atomics were refused. On a 32-bit
2D, 2D-array or cube storage image, an atomic is a device atomic (the
storage buffer atomics' form) on the texel's address: the image's base
plus layer * layer stride plus its rectangular Morton index * 4 (the
CPU transfers' twiddle order, g5p_twiddle2d()). The dispatch fills two
slots from the bound storage descriptor: the base address (G9P_IMAGE_BASE)
and the address of an upload of {Morton bits, layer stride}
(G9P_IMAGE_INFO), the stride from the layer's 4-byte texel chain as the
image layout computes it.
On an iPhone 6s (S8003): every 2D, 2D-array and cube image atomic case
of the GLES3.1 sample passes (9 more), no GPU reset, no regression in
the image_load_store and Vulkan storage-image cases.
Generated-by: LLM
Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
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.
Compute storage images on the A9, step by step:
Tested on an iPhone 6s (S8003): GLES3.1
image_load_storeof the sample +27 (every 2D / 2D-array / cube atomic case passes; integer store/load and format-reinterpret cases), no GPU reset case by case, no regression in the Vulkan storage-image cases.