Skip to content

pvr/g9p: A10 compute and compute textures, 512-invocation workgroups, storage images, robustness, indirect draws, depth levels, advanced blending, 2x/4x/8x MSAA - #52

Merged
henrikklee merged 45 commits into
OrchardLinux:mainfrom
paulscalise1:a10-gpu-fixes
Dec 4, 2026

Conversation

@paulscalise1

@paulscalise1 paulscalise1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

A10 (G9P) fixes and features, each measured on an iPhone 7 (D10) running Omarchy A through Zink. A set of 40 GLES and EGL tests went from 22 to all 40 passing.

Compute

  • Kernel record word 6 is 0 from 32 invocations up. Workgroups wider than 32 lost or swapped invocations.
  • Workgroups of 512 invocations. Each of the 16 tasks keeps at most 16 registers in bank 1 and the rest in bank 0. Measured with 64 workgroups, also with values in bank 0 up to r95, ten runs without a GPU reset.
  • A variable shift amount is masked to 0-31. The hardware gives 0 for 32 or more, while NIR's shifts take the amount modulo 32.
  • One compute job at a time. Two or three dispatches with barriers between them in one submission hung the firmware, though each job waits for the one before it. A compute-to-compute barrier no longer emits Rogue's fence kernel.
  • Storage images in compute shaders: imageLoad, imageStore, imageSize and image atomics, read and written as memory through a record in the descriptor (the texel layout the sampler and the CPU transfers use).
  • Compare-and-swap, with the A9's loop. Image atomics outside the view need no branch.
  • Values above r31, as graphics code parks them. Shaders that ran out of the 16 low registers (image round trips of four channels, image atomics) compile.
  • Workgroups are launched as whole tasks of 32. Groups past 128 invocations hung when their size was 8 past a multiple of 16, and with registers above r31 so did 40, 56 and 72. A pipeline whose group is too large for its registers (measured per register count) is refused at creation.
  • Workgroup barriers across tasks. The tasks of a group run apart, and the barrier only waited for memory, so sums through shared memory were wrong from 128 invocations up. Lane 0 of each task now counts in on a word of a device buffer with coherent atomics, and the last one releases the others.
  • Atomics on shared variables, through memory: the A10 has none for its shared memory, so such a shader keeps its shared variables in a region per workgroup, as the A9 does past its size.
  • Indirect dispatches. They ran one workgroup. The group counts are filled from the arguments when the job is submitted, and gl_NumWorkGroups is copied from them.
  • Values past a workgroup's share of bank 1 go to bank 0, as in A9 kernels. A shader of 256 invocations that needed 34 registers was refused, though the device offered 256. The record's field takes the bank-1 count and the kick's DOUTU temps allocate bank 0.
  • The DMA task's common store covers every buffer. Its word 6 is the store's size in blocks of 16 dwords and kept iPadOS's 1, so a shader with eight storage and four uniform buffers lost the GPU.
  • Textures in compute shaders: texelFetch, textureLod and textureSize of 2D textures, arrays, 3D textures and cubes, up to 16 units. They failed the pipeline before. Compute takes the vertex form of the sample, with the textures' words in the common store from dword 96.

Fragment and blending

  • gl_PointSize is clamped to the advertised range. The size field is 9 bits wide, so 512 drew nothing.
  • R32, R32G32 and R32G32B32A32 SFLOAT targets get the blend feature. GL refused blended draws into them.
  • Several discards in one shader become one. Two hardware discards killed about 90% of a draw's pixels, even with neither taken.
  • A shader that reads the tile keeps its hardware discards when the pass has depth or stencil, and runs as punch-through. Its discarded pixels wrote depth before and hid later draws.
  • R5G6B5 targets round to the nearest level. The PBE truncates, so blits and draws came out one level low for about a fifth of the values.
  • Framebuffer fetch through VK_KHR_dynamic_rendering_local_read: an input attachment load reads the tile, as blending does. Zink then offers GL_KHR_blend_equation_advanced, and all 15 modes match the formulas.
  • textureGather of 2D textures and arrays, with offsets and the depth comparison form.
  • A fragment shader's uniform array indexed at run time is read through a tree of selects.
  • More colour words than a pixel holds (8): the targets go in groups of at most 8 words and the render runs once per group. Each group has its own fragment program, state words, copy of the control stream, background and end of tile. Every group loads the depth and stencil the render started with and only the last stores them. Before, the words past 8 were written to memory by the shader, also by fragments the depth test hid, and were never blended.
  • A discarded pixel of a blended draw without depth writes none of those memory targets either, and the pass that turns such discards into selects takes up to 32 colour stores (Zink writes them a component at a time).
  • Renders into the tail of a mip chain. The end of tile takes only a 64-byte aligned address, so a level past the chain's first one under 64 bytes kept none of a render's pixels. Such a level is rendered in a scratch slot and copied in and back.

Varyings

  • Noperspective varyings are iterated without perspective. Fragment inputs arrive as load_input, so the mode now comes from the variables.
  • Flat and noperspective values survive TA clipping. VARYING0 now counts perspective, flat and screen-linear dwords separately with the varyings ordered by class, and the PPP control word names the draw's provoking vertex. Both changes are needed.

Robustness

  • Vertex fetches are clamped to the binding's last element and indexed draws to the index buffer. Far past either, the GPU faulted.
  • Storage and uniform buffer accesses of compute and vertex shaders stay inside their buffers.
  • A texel fetch outside the level reads 0, and the A10 offers robustImageAccess. With robust buffer access, Zink offers GL_KHR_robustness.

Draws and depth

  • Indirect draws. They fell through to Rogue's VDM words and lost the device. The INDEX_LIST is now filled from the arguments when the job is submitted.
  • Depth renders into any mip level, array layer or cube face. Upstream's copy of a small attachment through a tile-rounded buffer is skipped, as on the A9.
  • D32F_S8's stencil plane is 16-byte aligned, and its levels under 32 pixels render through a scratch plane of whole tiles, copied in and back.
  • A render that would drop a colour attachment of the one kept open no longer continues it. A depth-only draw after a clear coloured the target.

Multisampling

  • 2x and 8x as well as 4x. The kernel already sets the tiling for each count. The driver now gives Vulkan's standard positions, ISP_AA, region headers for tiles of 1x2, 2x2 or 2x4, and a per-sample load that finds each sample's index from its y. Multisampled views take the texture unit's multisample form, which texelFetch now reads in fragment shaders. Alpha to coverage keeps a nested set at each count, and the CPU transfers address any count.
  • texelFetch of a multisampled texture in vertex and compute shaders too, through the vertex form of the sample with the sample index after the pixel.
  • Targets of one or two raw words (R32, RG32, the 8- and 16-bit integer formats) at several samples, stored as RG16 or RGBA16 uint, bit for bit, since the store of every sample takes the tile in 16-bit channels. RGBA32 stays single-sampled.
  • An end of tile stores at most four surfaces. Past that a render's resolves go through a transfer: four multisampled targets with a resolve lost the fourth.
  • The CPU resolve sums in double. Eight R32F samples near 7.8 million came out one higher.
  • A load gives each sample its own value. It read the target as a 2D texture at the pixel centre, so every sample took one sample's value. It now reads the sample index from the sample's position and uses the texture unit's multisample form.
  • Discards become the coverage mask. A discard at four samples kept only sample 0 of each pixel it let through.
  • Alpha to coverage keeps samples 0, 3, 1 and 2 in turn, so two kept samples are a diagonal pair.
  • A resolve's end-of-tile surface stores its source's words and has none of its own. A second target took the resolve's place and kept its clear colour.

Each commit builds on its own, with no new warnings. The branch merges cleanly with main and with the open #48, #50 and #51. With #47, #53 and #54 there are small conflicts in pvr_arch_queue.c, where both sides add lines next to each other. Keeping both resolves them.

Not addressed here:

  • RGBA32 targets at more than one sample. They hung the GPU, and the store of every sample takes four 16-bit channels at most, two of a sample's four words.

🤖 Generated with Claude Code

Word 6 of a kernel record carried (threads % 32) << 27. On the A10 that
broke every workgroup of more than 32 invocations: with 33, invocation
1 never ran, and with 64 or 128, invocation 32 reported local index 0
of the next workgroup. Writing the field as the thread count below 32
and as 0 from 32 up fixes them.

Tested on an iPhone 7 (D10) through Zink: our GLES 3.1 compute ID test
(gl_GlobalInvocationID, gl_LocalInvocationIndex, gl_WorkGroupID for
local sizes 1 to 128, 8x8x1 and 4x4x4, on 1x1x1 to 2x3x4 grids) passes
every case. Before, the 33-, 64- and 128-wide ones failed.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
GLES 3.1 and Vulkan ask for 128 invocations per workgroup, the generic
Rogue limit used so far. Measured on an iPhone 7 (D10): 256 invocations
of up to 24 allocated registers run (16x16x1, 8x8x4), while 512 hang the
GPU even at 10 registers. The A10 now offers 256, as the A9 does, and a
compute pipeline whose registers go past what was seen to run (40 per
invocation, the 16 unified ones included, at 256 invocations) is refused
at creation instead of hanging the GPU.

Tested through Zink: our compute ID test passes every local size up to
256 (16x16x1, 8x8x4, 8x4x8, 8x8x2), with no GPU reset.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
NIR's shifts use their amount modulo 32, and the A10's shift instructions
give 0 for an amount of 32 or more: 1 << 0xfffffffe read 0 instead of
1 << 30. A shift by an amount that is not a constant now ANDs it with 31
first (ishl, ushr, ishr). NIR already folds constant amounts.

Tested on an iPhone 7 (D10) through Zink: our GLES 3 integer test passes
(shl, shr and sar by variable amounts failed 3801 to 3975 of 4096 cases).

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10 takes a point's size in a 9-bit field: 512 drew nothing and 1000
drew a point 488 pixels wide, while the device advertises sizes up to
511 and GL clamps to that range. Vertex shaders now clamp the size with
nir_lower_point_size() to [PVR_POINT_SIZE_RANGE_MIN, _MAX].

Tested on an iPhone 7 (D10) through Zink: our point size test passes
(sizes 512 and 1000 draw 511 pixels wide).

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
R32_SFLOAT, R32G32_SFLOAT and R32G32B32A32_SFLOAT were colour targets
without the blend feature, so GL (EXT_float_blend) refused a draw that
blends into one and left the target as it was. These targets are raw:
the tile holds their own 32-bit words, and the blend's framebuffer
fetch (lower_fb_fetch_instr()) already takes them as they are, so
blending needs no conversion. Advertise COLOR_ATTACHMENT_BLEND for
them.

Tested on an iPhone 7 (D10) through Zink: our GLES 3 render target test
passes, with RGBA32F, RG32F and R32F drawn with SRC_ALPHA /
ONE_MINUS_SRC_ALPHA blending (all 1024 pixels of each were wrong).

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Two hardware discards in one fragment shader kill pixels where neither
condition holds. An opaque, depth-tested draw whose shader discarded on
a uniform and on a texture value, neither of them taken, lost about 90%
of its pixels in random tiles. Either discard alone drew every pixel.

discards_to_flag() already turns the discards inside control flow into
one flag and a single discard at the end. Do the same for every discard
of a shader that has more than one, wherever they are.

Tested on an iPhone 7 (D10) through Zink: a 750x1334 RGBA8 target with
D24S8, drawn with both discards, has every pixel right (924680 of
1000500 were wrong).

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A shader that reads the tile turns its discards into selects that keep
the tile's colour (discards_to_select()), since the hardware discard in
the translucent pass lost random tiles. The pixel is still written,
though, and with a depth/stencil attachment it writes its depth and
stencil. A blended draw's discarded pixels then hid every later draw
behind them.

With a depth or stencil attachment, keep the hardware discards and run
the shader as punch-through, as a shader that writes its coverage
already does. Without one nothing changes. The compile gets the
attachment from the render pass state, and replay captures carry it.

Tested on an iPhone 7 (D10) through Zink: 26 of the 42 cases of our
GLES 3 multi-target test pass (10 before), all up to three targets and
8 words a pixel, with D24S8, from 96x96 to 2048x2048. The 16 that fail
have four targets, more words or 4x multisampling.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The fragment shader's inputs reach the backend as load_input, with no
barycentric whose mode perspective() could read, so every varying was
iterated perspective-correct. A noperspective one read the perspective
value instead of the screen-linear one (measured: -0.2450 where the
pixel wants 0.2344, exactly the perspective-correct value).

Mark noperspective inputs from their variables, as flat ones already
are, and iterate them without perspective.

Tested on an iPhone 7 (D10) through Zink: a noperspective varying
holding each vertex's NDC x now gives every pixel centre's own NDC x on
a triangle with w 1, 2 and 3, and the unclipped list, strip and fan
cases of our flat varying clipping test pass.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Triangles the TA clipped (a vertex past the near plane, behind the eye
or outside the guard band) lost their flat values, which came from
other vertices than the provoking one, and their noperspective ones.
Two TA settings were wrong for them:

- VARYING0 counted every varying dword as perspective. It has separate
  counts for perspective, flat and screen-linear dwords, in that order
  in the vertex. The varyings are now ordered by class in both stages
  (g9p_gap_varyings(), which already moved their locations) and counted
  by class. Transform feedback keeps its layout and the old count.
- The PPP control word's bits 7-8 hold the provoking vertex + 1, whose
  flat values the clipped triangles keep. 0x4a0 named the first vertex,
  while GL's is the last. It follows the draw's provoking vertex now,
  as VDM_STATE0's flatshade control does.

Either change alone leaves clipped triangles wrong.

Tested on an iPhone 7 (D10) through Zink: our flat varying clipping
test passes, all 36 cases (lists, strips, fans, indexed, with a
restart, near plane, behind the eye and guard band). The other GPU
tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The PBE stores floor(v * 2^bits) of each channel of an R5G6B5 target:
a 0-255 ramp blitted from RGBA8, or drawn, took the top bits and came
out a level low for 52 of 256 values in the 5-bit channels and 42 in
the 6-bit one. GL rounds to the nearest level.

The fragment shader writes the middle of the nearest level instead,
(round(v * m) + 0.5) / 2^bits, which the PBE's floor keeps. A tile read
for blending decodes that back to the level's own value, and such a
target doesn't take the native blend.

Tested on an iPhone 7 (D10) through Zink: the ramp is exact in all
three channels, blitted, drawn and after blended passes that keep the
destination, and our GLES 3 blit test passes (its RGBA8 to RGB565 case
had 2304 of 4096 pixels wrong).

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The device advertises robustBufferAccess, but a vertex index far past
the vertex buffer, or an index count far past the index buffer, faulted
the GPU and lost the device. GL_KHR_robustness depends on both being
safe.

A vertex shader now clamps the element it fetches to the binding's last
whole element. The stride slot is 64 bits wide and the stride needs only
the low word, so the draw puts that element in the high word, from the
bound range and the end of the binding's furthest attribute (kept in the
pipeline). An indexed draw draws only the indices inside the index
buffer.

Tested on an iPhone 7 (D10) through Zink: our robustness test's vertex
index of 1,000,000 draws the last vertex, an index count of 1,000,000
from a buffer of 6 draws the 6, per-instance data for 2 instances
repeats the second for instances 2 and 3, and the GPU keeps working.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Storage buffer accesses millions of elements past a buffer, and uniform
buffer loads at such offsets, faulted the GPU in compute and vertex
shaders and lost the device, while robustBufferAccess is advertised.

A10 compute and vertex shaders now go through
nir_lower_robust_access() for every storage buffer access and for the
uniform buffer loads whose offset is only known when the shader runs. A
load past the end reads the buffer's start, and a store or atomic there
is dropped. The sizes come from the descriptors: compute's binding DMA
already copies them, and a draw now fills the vertex shader's size
slots too (get_ubo_size is handled as get_ssbo_size). Constant uniform
loads keep their common-store copies.

Fragment shaders read their uniform buffers from the common store, so
they never fault. A dynamic offset past the copied dwords read 0 there.
It now reads the same component of the buffer's first vec4, as the
other stages' vector loads do.

The A9's compute path is left as it was.

Tested on an iPhone 7 (D10) through Zink: our robustness test's storage
buffer, uniform block (vertex, fragment and compute) and shared array
cases pass, the GPU keeps working after them, and the other GPU tests
are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Zink offers GL_KHR_robustness when the device has robustBufferAccess and
robustImageAccess. The A10 has no storage images yet, so its image reads
are texel fetches, which are samples at the texel's centre
(lower_txf()). Outside the level such a sample wraps or clamps to a
texel inside it. A fetch outside the level now reads 0, and Zink bounds
the level itself. The A10 advertises VK_EXT_image_robustness with
robustImageAccess.

Tested on an iPhone 7 (D10) through Zink: GL_KHR_robustness is offered,
our robustness test passes, and the other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A depth/stencil attachment at a mip level or array layer other than the
first was refused, so GL renders into depth texture levels, array
layers and cube faces did nothing.

The ZLS now loads and stores the attachment's own level and layer, at
the offsets the sampler reads them from. In a chain of levels, a depth
plane alone takes its level's exact size for ISP_ZLS_PIXELS: the ZLS
stores a level smaller than a tile then (measured down to 1x1), while
whole tiles would reach into the next level. A stencil plane takes
ZLS_PIXELS aligned to 32, so stencil levels under 32 pixels in a chain
are still refused by name.

Upstream's copy of a small attachment through a tile-rounded buffer is
skipped on G9P, as on the A9. Its CPU transfers cannot reach that
buffer in the general heap ("G9P transfer: no CPU mapping"), and the
render went to the buffer while the image kept its old depth.

Tested on an iPhone 7 (D10) through Zink: our depth mip test passes for
D32F and D16 2D chains of 64x64, 64x16 and 48x40, a D32F 2D array of
32x32x3 and a D32F cube map of 16x16, every level down to 1x1, with
each render leaving the other levels as they were. The other GPU tests
are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Two or three compute dispatches with a barrier between them, in one
submission, hung the A10's firmware ("hang: compute job 1", the device
lost), though each job waits for the one before it through the
barrier's syncobjs. The same dispatches in separate submissions, or with
G9P_SYNC waiting for each job, ran. A compute job is now submitted only
once the previous one has completed.

A compute-to-compute barrier inside a job emitted Rogue's data fence and
fence kernel, which are not A10 programs. It ends the job instead, and
the next dispatch starts another.

A compute pipeline the backend refuses now says so on stderr, as
g9p_feature_error() does: vk_errorf() is quiet outside debug builds and
Zink reports only VK_ERROR_UNKNOWN.

Tested on an iPhone 7 (D10) through Zink: three dispatches of a storage
buffer kernel with glMemoryBarrier() between them, and four of an image
kernel, give their results with no GPU reset (they lost the device), and
our GLES 3.1 test's image round trips no longer lose it. The other GPU
tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10 had no storage images: imageStore, imageLoad and imageSize
failed to compile ("intrinsic image_deref_store not supported yet"), and
GLES 3.1 asks for them in compute shaders.

A10 compute shaders now read and write a storage image as memory. Its
descriptor holds a record in place of texture state (struct
g9p_storage_image): the address of the view's level and first layer,
the layer stride, the size and the layout. Twiddled, the low bits of x
and y are interleaved, y first, up to the shorter side, and the rest of
the longer side follows, as the sampler and the CPU transfers lay the
texels out. A linear image is the same with no interleaved bits and its
row pitch. The shader reads the record through a slot holding the
descriptor's own address (G9P_BINDING_DESCRIPTOR) and addresses the
texel through the descriptor's first word. The texel's words are packed
and unpacked in 32-bit code for formats of R, G, B, A channels of 8, 16
or 32 bits, since the backend has no 16-bit values. Outside the view a
load reads 0, without a branch, and a store or atomic is dropped. Image
atomics are storage buffer atomics on the texel.

Tested on an iPhone 7 (D10) through Zink: our GLES 3.1 test's
imageStore into a single-level texture (linear), level 1 of four
(twiddled) and layer 2 of an array, a render loaded by imageLoad and
stored for a draw to sample, and the r32f, r32ui and r32i round trips
(store, load and store, load, imageSize, a load outside the image)
pass. The round trips of four-channel formats still fail to compile,
out of registers in their checking shaders, and compare-and-swap needs
ssbo_atomic_swap, which the A10 backend lacks. The other GPU tests are
unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
vkCmdDrawIndirect and vkCmdDrawIndexedIndirect fell through to Rogue's
VDM index list, which the A10 cannot run: glDrawArraysIndirect lost the
device.

An A10 indirect draw is now recorded as a direct one, and its
INDEX_LIST words are filled from its arguments when the job is
submitted, as the unaligned vertex bindings are copied then: the count,
instances, first vertex or vertex offset, the index list's address from
firstIndex, and the first instance in the vertex shader's
G9P_DRAW_PARAMS slot. Indices past the index buffer are not drawn, as in
a direct draw, and a draw of no instances gets a count of 0, which draws
nothing (measured, points too). The CPU reads the arguments, and waits
first for the job before when the GPU may have written them.

Tested on an iPhone 7 (D10) through Zink: our GLES 3.1 test's
glDrawArraysIndirect and glDrawElementsIndirect, from index 3, draws of
nothing, and arguments a compute shader wrote just before pass (they
lost the device). The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10 backend refused tg4 ("only plain 2D samples of combined image
samplers so far"), and GLES 3.1 has textureGather, textureGatherOffset
and textureGatherOffsets, with a depth comparison form.

A gather of a 2D texture or array is now four samples at level 0, at the
centres of the texels of the bilinear footprint, in the order (i0, j1),
(i1, j1), (i1, j0), (i0, j0), each giving the gathered component. The
sampler's wrap applies to texels outside the level, a linear filter at
a texel's centre reads that texel alone, and with a shadow sampler each
sample is that texel's comparison. An offset moves the footprint, and
textureGatherOffsets takes each texel from its own. Cube maps are still
refused.

Tested on an iPhone 7 (D10) through Zink: our GLES 3.1 test's
textureGather of each component, textureGatherOffset with (-1, 1) and
the depth comparison form pass. The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10 backend had no ssbo_atomic_swap, so atomicCompSwap and
imageAtomicCompSwap failed to compile. The A10 now uses the A9's
compare-and-swap loop (g5p_device_cas()): each lane in turn loads the
word, compares it and stores the new value.

An image atomic outside the view was in a branch whose phi held a
register for the whole program, and shaders with several image atomics
ran out of registers. It now goes to the view's first texel with an
operand that changes nothing there (0 for add, or and xor, all ones for
and and umin, the extremes for min and max, the compared value as the
new one for compare-and-swap). Only exchange keeps the branch. The
result is undefined outside the view either way.

Tested on an iPhone 7 (D10) through Zink: a contended atomicCompSwap
loop on a storage buffer counts every invocation (16 and 128), and a
compare that fails leaves the word. On an r32ui image, single-level
(linear) and with two levels (twiddled), 128 invocations' imageAtomicAdd
over four texels, a compare-and-swap loop, imageAtomicMax and
imageAtomicMin give exact results, and atomics outside the image change
nothing. The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
GL_KHR_blend_equation_advanced was missing: Zink offers framebuffer fetch,
and with it the advanced blend modes, when the device has
VK_KHR_dynamic_rendering_local_read, and G9P had no input attachments.

A fragment shader's input attachment load now reads colour attachment i
from the tile for input attachment i, as blending already does
(lower_fb_fetch_instr() decodes the target's words), and the shader runs
in the pass type of a shader that reads the tile. The A10 offers
VK_KHR_dynamic_rendering_local_read with dynamicRenderingLocalRead. A
fragment-to-fragment barrier inside a render no longer adds Rogue's
transparent object, which is not an A10 draw: the tile reads see the
draws before them in order.

Tested on an iPhone 7 (D10) through Zink: our GLES 3.2 test passes, all
15 KHR_blend_equation_advanced modes within 1/255 of the formulas (the
extension was missing). The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
@paulscalise1 paulscalise1 changed the title pvr/g9p: A10 fixes for compute, discards, varyings and colour targets pvr/g9p: A10 compute, storage images, robustness, indirect draws, depth levels, advanced blending Dec 3, 2026
A fragment shader reads its uniform buffers from the common store, so a
load at a computed offset was a chain of selects over every dword of the
buffer, up to 512 a component. A vec4 array of 64 or 100 entries ran out
of registers ("out of registers above r31"), and GL's large uniform
arrays indexed per pixel failed to compile.

The loads' alignments are first updated from what the offsets prove
(nir_opt_load_store_update_alignments()), so a component of a vec4 array
reaches one dword in four. The dwords a load can reach are then chosen
by the bits of the entry number, a binary tree built depth first, which
keeps a few partial results live where the chain kept the whole buffer
(each component's chain shared its loads with the others). An offset
past them reads the same component of the buffer's first vec4, as
before.

Tested on an iPhone 7 (D10) through Zink: our uniform test passes, a
uniform block of 64 vec4s and a default-uniform array of 100 indexed per
pixel exact on all 1024 pixels (they failed to compile), and our
robustness test's fragment read far past a block still reads its first
entry. The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
D32F_S8's stencil plane starts at half the image's size, after the depth
plane's chain of levels. A chain ends at a 4-byte 1x1 level, so the
plane could start 4 bytes past a 16-byte boundary, and the ZLS's stencil
base is 16-byte aligned (ISP_STENCIL_LOAD_BASE): a render stored its
stencil from 4 bytes earlier, over the 1x1 depth level. A 64x64 chain of
7 levels lost its last level whenever level 0 or 1 was rendered.

The depth plane's half is now rounded up to 64 bytes. The ZLS, the
sampler and the transfers all take the stencil plane at half the image's
size, so they move together.

Tested on an iPhone 7 (D10) through Zink: our depth mip test's D24S8 and
D32FS8 chains (D32F_S8 in Zink) keep every other level when levels 0
and 1 are rendered (the 1x1 level read 0 before). The other GPU tests are
unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A stencil plane takes ISP_ZLS_PIXELS aligned to 32, so the ZLS stores
whole tiles, and a level of a chain with a side under 32 pixels would be
stored past its end, over the next levels. Such levels were refused, and
GL's depth/stencil textures (D24S8 and D32F_S8, both D32F_S8 in Zink)
could not be rendered below 32 pixels.

A D32F_S8 level of a chain with a side under 32 pixels now renders in a
scratch plane of whole tiles, as iOS does: a CPU transfer copies the
level's depth and stencil into it before the render when the render
loads them, and back after the render when it stores them, both
serialized with the fragment jobs. The device allocates the plane, 16384
x 32 pixels of depth and stencil, at its first use and registers it for
the CPU transfers. Other stencil formats are still refused below 32
pixels.

Tested on an iPhone 7 (D10) through Zink: our depth mip test's D24S8 and
D32FS8 chains of 64x64 (7 levels) and 48x40 (6), the D24S8 2D array of
32x32x3 and the D24S8 cube map of 16x16 pass, every level down to 1x1
with its stencil, each render leaving the other levels as they were.
The 64x16 chains are right but for one pixel of the stencil check at
their 2x1 level. The other GPU tests are unchanged.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Compute shaders that ran out of the 16 low registers failed to compile,
among them egles31's image round trips of four channels and its image
atomics. Graphics code already parks such values above r31, and compute
code now does too. Kernels of up to 93 registers ran correctly.

Larger groups with those registers hung the GPU, and so did some sizes
without them. Measured with 64 workgroups of a kernel that keeps a set
of loaded values live:

- Past one task of 32, a group whose size was not a multiple of 32 could
  hang. Without parked values every size 8 past a multiple of 16 from
  136 to 248 hung, and with them 40, 56 and 72 did. The kernel record now
  launches whole tasks, as the A9's does, and the program's prologue
  already turns off the lanes past the group. Every size tested then ran.
- How many registers the tasks of a group may use together: 24 per
  invocation ran at 256 invocations, 40 at 160 (192 hung in one run of
  two), 48 and 64 at 128 (48 hung at 160) and 72 to 96 at 64 (72 hung at
  96). A pipeline past these is refused at creation, where the earlier
  rule let some of the hanging ones through.

egles31 now passes in full.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A discarding fragment shader at four samples left only sample 0 of each
pixel it let through. A conditional discard that was never taken drew a
quarter of every pixel. That held with a task per pixel and with one per
sample, and also with the full coverage mask written after the discard.
Alpha-tested draws into a multisampled target came out faint, and the
later cases of eglmsaa inherited the damage.

The discards of a multisampled shader now become its coverage mask, 0
where one is taken, as alpha to coverage already does. The draw stays
punch-through, and depth and stencil follow the mask. A shader that
writes memory keeps its hardware discard, so a discarded pixel makes no
stores.

Measured: a discarding draw after a clear went from 1029 wrong pixels of
eglmsaa's model to none. In eglmsaa's sequence discard went from 1206 to
178 and blending from 1216 to 238, and what is left comes from the load
of the earlier pass. The discard cases of eglcoverage went from 3712
wrong pixels each to none, and the one-target 4x cases of eglmrtbig pass.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A render into a mip level whose address is not a multiple of 64 bytes
kept none of its pixels, not even the clear. Such levels are the tail of
a chain, past its first level under 64 bytes: the 2x1 and 1x1 levels of
a 64x16 RGBA8 texture, or the 4x1 level of a 16x2 one at byte 160. Every
level at a multiple of 64 bytes came out exact, and the sampler reads all
of them where they are. egldepthmip lost its one stencil pixel this way,
since its stencil check draws into the 2x1 colour level.

The end of tile now stores such a target to a 64-byte aligned slot at the
end of the scratch plane. The level is copied in before the render, so
that tiles left unrendered keep it, and back after it, by CPU transfers
serialized with the fragment jobs as the depth and stencil scratch plane
does. Measured with renders into every level of 64x16, 64x64, 32x4, 16x2,
8x8 and 4x1 chains, each level read back after its render and again
after all of them: all exact. egldepthmip passes.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
Alpha to coverage kept the first n of four samples for an alpha of n
quarters, so two kept samples were 0 and 1, both near the top of the
pixel. A sample coverage of 0.5 inverted keeps 2 and 3, and the two
together kept nothing. eglcoverage expects samples 0, 3, 1 and 2 in turn,
as the GLES driver kept them, so two kept samples are a diagonal pair.
The shader now builds that mask.

Measured with eglcoverage at 4x: the edge, both, depth with two renders,
stencil, query and blending cases went from wrong to exact, and its GL
error went away. Its depth-only case with alpha to coverage now fails
like the sample coverage one already did. Both show a colour where the
model has none, which appears in the next render, the one that loads the
4x target, and not in the depth-only render itself.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A multisampled render whose first target Zink resolves in the render
has a third end-of-tile surface between the targets: the resolve of
target 0. Its words were counted in the tile like a target's, so the end
of tile read target 1 from past its words, and the background wrote
target 1's clear or load there. With two 4x targets and a resolve,
target 1 kept its clear colour under every draw, or held words of
another target. eglmrtbig's 4x cases with two targets and eglmsaa's
mrt case failed this way.

A resolve surface now stores the words of the target it resolves and
has none of its own: the end of tile takes its source's offset, the
background skips it, and a clear or a target written to memory finds
colour attachment j as the j-th surface that is not a resolve.

Measured: each sample of two 4x targets read back with texelFetch after
a draw and both resolves is exact (target 1 was zeros and stray words
before). eglmsaa's mrt case at 4x and eglmrtbig's 4x cases with two and
three targets pass. Four targets at 4x still fail.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A render that loads a 4x target read it as a 2D texture of twice the
size at the pixel centre, so every sample of a pixel took one sample's
value. Edges drawn by an earlier render came out all or nothing, and
everything later drawn over them inherited that. In eglmsaa that was the
load case, and the discard, blending and depth cases that load after it.

The background program runs a task per sample already. It now reads the
sample's own y (special value 6), takes the index from it as the
positions go down in y, and samples the target with the texture unit's
multisample form: dimension 4, integer coordinates and the sample index,
with the state at the pixels' size and the sample count at bit 55, as
the GLES driver read 4x surfaces. Reading the twice-size texture at each
sample's texel instead lost one sample in every 8 x 4 pixel block of some
tasks. Both the one-target load and the load of several targets do so.

Measured with eglmsaa at 4x, 96x64 and 300x200: coverage, load, discard,
blending, depth, the depth resolve, two targets and every format are
exact (load, discard, blending and depth were wrong in 63 to 238
pixels). A load followed by nothing, with every tile processed, keeps
each pixel's samples. At 4x eglcoverage fails only its depth-only case.
eglmsaa still fails at 2x and 8x, which the driver does not offer.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A render that only loads attachments of the one kept open continues it
in tile memory (g9p_merge_compatible()). A render with fewer colour
attachments passed that check, so its draws ran in the open render and
wrote the attachment they did not have. eglcoverage clears a 4x target
and its depth, then draws into a framebuffer with the depth buffer
alone: the draw joined the clear's render and coloured the target. A
glFinish() between the two kept them apart, and with it the case passed.

The new render now has to have every colour attachment of the open one.
Zink's case the merge is for, a render begun again on the same images,
still merges.

Measured with eglcoverage: all 37 of its 4x cases pass (its four
depth-only cases, at 96x64 and 300x200, failed on every pixel before). It
still fails at 2x and 8x, which the driver does not offer.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A workgroup of more than 32 invocations runs as several tasks of 32, and
the tasks run apart. The A10's barrier was only a wait for memory, which
holds within one task, so eglcompute's sums through shared memory with
barrier() came out wrong at 128 and 256 invocations (64 passed by
chance).

A workgroup barrier of a group of more than one task now synchronizes
the tasks as the GLES driver did, with coherent atomics on a word of a
device buffer (G9P_BARRIER_COUNTERS, one word per workgroup modulo
4096). Lane 0 of each task adds 1, whose low byte counts the tasks in.
The last one adds 256 - tasks, which sets the count back to 0 and
advances the generation above it, and the others wait until the
generation changes. A task's lanes run in step, so they wait with their
lane 0. The count is back at 0 after every barrier, so one zeroed buffer
serves every dispatch, since compute jobs run one at a time.

The workgroup ID and count are read again where used instead of kept
live from the top of the shader. Otherwise the barrier's use of them
took 34 registers, past what 256 invocations may have.

Measured: eglcompute's reduce case passes at 64, 128 and 256
invocations, in three runs out of three, at 17 registers.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10 has no atomics for its shared memory, and the backend refused
them ("intrinsic shared_atomic not supported yet"), so eglcompute's
shared case could not create its pipeline. A compute shader with atomics
on shared variables now keeps its shared variables in memory instead, a
region of the variables' size per workgroup, where the storage-buffer
atomics are coherent. It is the A9's pass for shared memory past its
size (a9_spill_shared()), and its barriers also order that memory. The
dispatch allocates the regions.

Measured: eglcompute's shared case passes (an atomicAdd and atomicMax on
shared counters from every invocation), and its reduce, atomics and
counter cases still do.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
An indirect dispatch ran one workgroup, and gl_NumWorkGroups read 1, 1,
1 (eglcompute's misc case got 101 for 302). The G9P dispatch took the
group count it was recorded with.

The bind DMA now copies gl_NumWorkGroups from the arguments themselves,
and the queue fills the kernel record's group counts from them when the
job is submitted, after the jobs before it are done (they may write the
arguments), as indirect draws do. A dispatch of no groups runs the empty
kernel once instead, since the record has no count of 0. An indirect
dispatch of a shader whose shared variables are in memory is refused, as
the A9 refuses it: the regions are sized by the group count.

Measured: eglcompute's misc case passes (the group count, the workgroup
size, uniforms and an indirect dispatch), and an indirect dispatch of 5 x
2 x 3 groups with arguments written by a compute shader runs 240
invocations and reads its count, where one of 0 x 2 x 3 runs none.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
@paulscalise1 paulscalise1 changed the title pvr/g9p: A10 compute, storage images, robustness, indirect draws, depth levels, advanced blending pvr/g9p: A10 compute, storage images, robustness, indirect draws, depth levels, advanced blending, 4x MSAA Dec 3, 2026
The A10 renders 2, 4 and 8 samples a pixel. Its kernel already sets the
tiling for each count (TE_AA 1, 5 and 7, the ISP macrotile size) and gives
the TA Vulkan's standard positions. The driver offered only 4.

- The render takes Vulkan's standard positions in 0xfa8 and 0xc78, ISP_AA
  log2 of the count, and region headers for tiles of 1x2, 2x2 or 2x4.
- A load runs per sample and finds the sample's index from its y, which
  differs between the samples of a pixel at every count: 2x by y >> 3, 4x
  by y >> 2, and 8x through a table of nibbles by y >> 1.
- A multisampled image view takes the texture unit's multisample form
  (dimension 4, log2 of the count less one at bit 55, the pixels' size),
  which the background's loads already used. A shader's texelFetch reads
  it the same way, with the pixel in r0-r1 and the sample index in r2.
  The 2D texture of twice the size that four samples were read as has no
  counterpart at 2x or 8x, whose samples follow one another in a pixel.
  Such fetches work in fragment shaders only.
- Alpha to coverage keeps a nested set for each count.
- The CPU transfers address a pixel's samples one after another at any
  count, for clears, copies and resolves. The host image copies set the
  sample fields of their surfaces too.

eglmsaa and eglcoverage now pass every case at 2x, 4x and 8x. egles31
measures each sample's position at 2x, 4x and 8x, and all match what
glGetMultisamplefv reports.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A blended shader without a depth or stencil attachment keeps the tile's
colour where a pixel is discarded, through selects on the discard's
condition, and the discard goes. A target past the 8 words a pixel holds
is written to memory by the shader, and those stores ran at the
discarded pixels too. They now run under the condition, at the end.

The pass also gave up on shaders with more than 8 colour stores, as Zink
writes them one component at a time. It takes 32 now.

eglmrtbig's RGBA8, RGBA32UI, RGBA8UI and RG32F case without depth (9
words here, as RGBA8 takes two) is now right at every size.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
An end of tile stores up to four surfaces, colour targets and resolves
together. Four multisampled targets with a resolve kept only the first
four, so the fourth target was never stored. A program of five emits
stored wrong values for every target, also with each surface's offset
as an immediate in place of its load.

A render whose targets and resolves come to more than four now resolves
by transfer after the render, as upstream does past its own limit, and
the end of tile leaves those resolves out. eglmrtbig's four RGBA16F
targets at 4x pass.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The CPU resolve added each sample's value divided by the count in single
precision. Eight samples of an R32F value near 7.8 million came out one
higher, as the running sum loses its last bit past 4 million. The sum is
now a double, divided by the count at the end.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
R32, RG32, RGBA8 and RGBA16 integer targets and the 32-bit float ones
were refused at more than one sample. The end of tile's store of every
sample takes the tile in 16-bit channels, so R32F stored as itself came
out wrong. A target of one or two raw words is now stored as RG16 or
RGBA16 uint, bit for bit, with the emit of 16-bit channels. Loads read
it in its own format, and its resolves go through a transfer as before.
Four raw words (RGBA32) stay single-sampled, as they hung the fragment
job.

eglmrtbig's R32F target at 4x and new cases of R32F, RG32F, R32UI and
RG32UI targets at 2x and 8x pass.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
…targets

A pixel holds 8 output words. Past them a target was written to memory by
the fragment program, and fragments hidden by the depth test behind a
punch-through draw still wrote it. Such a target was never blended
either. eglmrtbig's cases of 9, 12 and 16 words with a
depth buffer came out wrong.

The targets now go in groups of at most 8 words, in order, and the
render runs once per group:
- A pipeline compiles a fragment program per group, each writing only
  its group's targets. The others' stores are dropped at the end, so
  every program takes the same uniforms, textures and varyings. If two
  differ, or the shader writes memory, uses transform feedback or reads
  the view index, the pipeline keeps the old path.
- Each draw gets its state words once per group, with that group's
  fragment kick. Clears in such a render take per group a program that
  clears or keeps its words. Occlusion queries count in group 0 alone.
- Per group past the first, a copy of the control stream names those
  words. Indirect draws are filled in each copy too.
- Each group has its own background and end of tile. Every group loads
  the depth and stencil the render started with, and only the last
  stores them.
- The queue submits the groups in turn.

eglmrtbig passes every case, up to four RGBA32UI targets at 2048 x 2048
with depth, and egles31's new indirect draw into three RGBA32UI targets
passes. It failed with the indirect draws left out of the copies.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A10 compute kept every value in bank 1, which the kernel record's
register field allocates, and a workgroup's tasks must fit there
together: 256 invocations take at most 24 registers each. A shader of
256 invocations that needed 34 (eglcompute's divergent case, shared
atomics and compare-and-swap loops) was refused at pipeline creation,
though the device offers 256.

Such a shader is now compiled again as A9 compute is: values in bank 1
up to what the workgroup may hold there (24 at 256 invocations, 32 at
192, 40 at 160, 64 at 128, 96 at 64), the mask stack after them, and the
rest parked in bank 0. The record's field takes the bank-1 count and the
kick's DOUTU temps allocate bank 0, as in A9 kernels. Shaders that fit
keep their single bank.

eglcompute passes every case up to the reported 256 invocations.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The DMA task before a kernel loads each buffer's address (two dwords)
and the workgroup's thread count into the common store. Its record's
word 6 kept the 1 iPadOS writes there, and that field is the store's
size in blocks of 16 dwords: varied on the A10, kernels read other
values from dword 16 on with one block. A shader with eight storage
buffers and four uniform buffers lost the GPU, and the buffers past
the first 16 dwords were never written.

The field now covers the buffers' addresses and the count.

eglcstex's case of eight storage and four uniform buffers passes, and
fails with the field forced back to one block.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
A10 compute shaders could not sample. Any texture read, texelFetch and
textureSize included, failed the pipeline, so a GLES 3.1 compute shader
with a sampler never ran.

Compute shaders now sample as vertex shaders do, with the vertex form of
the sample at an explicit level (level 0 for texture()), and gradients
and compare offsets lowered as for vertex shaders. The textures' states
and sampler words sit in the common store from dword 96, past the
buffers' addresses and the thread count. 16 textures end at dword 255,
the last a sample's fields reach. The dispatch copies them there from
the bound descriptor sets, and the DMA task's store covers them. A cube
sample takes r0-r2, as in vertex shaders, so the local index moves out
of r0 in such a shader.

eglcstex passes: texelFetch, textureLod and textureSize of 2D arrays, 3D
textures and cubes, and all 16 texture units in one shader. eglmsfetch's
compute shader reads a 2D texture with texelFetch and texture().

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
texelFetch of a 2D multisample texture compiled in fragment shaders
only. Their form, the pixel and the sample index in r0-r2, read wrong
values in a vertex shader.

Vertex and compute shaders now take the vertex form of the sample, as
their other samples do, with the multisample dimension and integer
coordinates: the pixel in two registers and the sample index in the
next. The level operand is not read there, and a level of the sample
index read the same values. These fetches no longer reserve r0-r3
outside fragment shaders.

eglmsfetch passes at 2, 4 and 8 samples, RGBA8 and R32UI, with every
sample of every pixel read back by fragment, vertex and compute shaders.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The device offered 256 invocations per workgroup, as an earlier
measurement had 512 hang the GPU even at 10 registers. With the
workgroup launch and barriers of today's driver they run.

At 512, 16 tasks of 32, each task now keeps at most 16 registers in bank
1 and the rest in bank 0, as larger workgroups already did past their
bank-1 share. Measured with 64 workgroups: 16 registers ran at 512
invocations, also with values in bank 0 up to r95. 8 registers did not
leave room for the barrier's atomics. The device reports 512 invocations
and 512 for the x and y sizes.

eglcompute passes at 512 and 384 invocations, ten runs in a row without
a GPU reset: IDs over 1D, 2D and 3D workgroups, a sum through shared
memory with barriers, shared atomics, compare-and-swap from odd
invocations only, and 16 to 48 values live through a loop. 72 values
(96 registers) ran too. The run-tests modes with every value in the
extended range pass as well.

Generated-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
@paulscalise1 paulscalise1 changed the title pvr/g9p: A10 compute, storage images, robustness, indirect draws, depth levels, advanced blending, 4x MSAA pvr/g9p: A10 compute and compute textures, 512-invocation workgroups, storage images, robustness, indirect draws, depth levels, advanced blending, 2x/4x/8x MSAA Dec 4, 2026
Conflict in src/imagination/vulkan/pvr_arch_queue.c, both sides kept:

- graphics: the PVR_DEBUG=pass_log marker is now set before the G9P
  target-group path too, and cleared after its submits (and on error),
  so every group's submit is named like the single-pass one.
- compute: the G9P waits for the previous compute job and for indirect
  dispatch arguments run first, then main's A9 queue stamp and submit.
  Their error paths return the sync with pvr_g5p_sync_put(), since main
  now takes it from the reuse pool instead of vk_sync_create().

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
@henrikklee
henrikklee merged commit 92b90cf into OrchardLinux:main Dec 4, 2026
1 check passed
@henrikklee

Copy link
Copy Markdown
Contributor

Merged. Thank you very much, Paul! This is a big step for the A10: compute shaders with textures, indirect dispatches, 512-invocation workgroups and 2x/4x/8x MSAA all in one go, carefully explained commit by commit.

What changed on your branch: one merge commit bringing in current main. It conflicted in src/imagination/vulkan/pvr_arch_queue.c, where main had added A9 queue stamps (#47) and PVR_DEBUG=pass_log lines (#49/#53) right next to your lines. Both sides are kept:

  • Graphics: the pass_log marker is now also set around your G9P target-group submits (and cleared after them and on error), so each group's submit is named like a normal one.
  • Compute: your G9P waits (previous compute job, indirect dispatch arguments) run first, then main's A9 queue stamp and the submit. Main now takes the job's sync from a reuse pool, so your two error paths return it with pvr_g5p_sync_put() instead of vk_sync_destroy().

Your commits are unchanged. The Build workflow on the merged head was green. #55 (UBO preload, vertex and fragment shaders only) doesn't touch the compute paths here.

Follow-ups (none of them block anything):

  • A9/A8 compute smoke test for the two compiler changes that every generation shares: variable shift-amount masking, and re-reading the workgroup id/count. They look right, but only the A10 has run them so far.
  • Performance later: the CPU waits once per compute barrier and once per indirect argument read. That's fine for correctness now; moving those waits onto the GPU is later work.
  • The barrier counter slot after a GPU reset: worth checking that it starts clean again after a hang.
  • dEQP/CTS numbers for compute and MSAA on the A10 are very welcome whenever you have them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants