Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7c813dc
pvr/g9p: kernel record word 6 is zero from 32 invocations up
paulscalise1 Dec 3, 2026
0774ed1
pvr/g9p: 256-invocation workgroups on the A10
paulscalise1 Dec 3, 2026
6d34aa6
pvr/g9p: mask a variable shift amount to 0-31
paulscalise1 Dec 3, 2026
c89687e
pvr/g9p: clamp gl_PointSize to the advertised range
paulscalise1 Dec 3, 2026
b2c2c35
pvr/g9p: blend into 32-bit float colour targets
paulscalise1 Dec 3, 2026
c112b9b
pvr/g9p: fold several discards into one
paulscalise1 Dec 3, 2026
8770f52
pvr/g9p: keep the discards of a blending shader with depth or stencil
paulscalise1 Dec 3, 2026
8ba5cf5
pvr/g9p: interpolate noperspective varyings without perspective
paulscalise1 Dec 3, 2026
7df1bf1
pvr/g9p: keep flat and noperspective values where the TA clips
paulscalise1 Dec 3, 2026
939effe
pvr/g9p: round colours written to R5G6B5 targets
paulscalise1 Dec 3, 2026
b81c80c
pvr/g9p: keep vertex fetches and index counts inside their buffers
paulscalise1 Dec 3, 2026
657ab0e
pvr/g9p: keep buffer accesses inside their buffers
paulscalise1 Dec 3, 2026
5a90202
pvr/g9p: robust image access, for GL_KHR_robustness
paulscalise1 Dec 3, 2026
ee97b14
pvr/g9p: render depth into any level and layer
paulscalise1 Dec 3, 2026
2089884
pvr/g9p: one compute job at a time
paulscalise1 Dec 3, 2026
11a0945
pvr/g9p: compute storage images on the A10
paulscalise1 Dec 3, 2026
88d02a6
pvr/g9p: indirect draws
paulscalise1 Dec 3, 2026
790e3cf
pvr/g9p: textureGather of 2D textures and arrays
paulscalise1 Dec 3, 2026
846d491
pvr/g9p: compare-and-swap, and image atomics without a branch
paulscalise1 Dec 3, 2026
5a57f04
pvr/g9p: framebuffer fetch through local reads, for advanced blending
paulscalise1 Dec 3, 2026
8b5ba19
pvr/g9p: fragment uniform arrays indexed at run time, as a tree
paulscalise1 Dec 3, 2026
2c85fa6
pvr/g9p: a 16-byte aligned stencil plane for D32F_S8
paulscalise1 Dec 3, 2026
5426880
pvr/g9p: D32F_S8 levels under 32 pixels through a scratch plane
paulscalise1 Dec 3, 2026
052df4f
pvr/g9p: compute values above r31, workgroups launched as whole tasks
paulscalise1 Dec 3, 2026
f2db970
pvr/g9p: discards at four samples through the coverage mask
paulscalise1 Dec 3, 2026
3a43ed7
pvr/g9p: colour renders into the tail of a mip chain
paulscalise1 Dec 3, 2026
e5822e7
pvr/g9p: alpha to coverage keeps a nested set of samples
paulscalise1 Dec 3, 2026
7dd27cb
pvr/g9p: resolve surfaces take no words of the tile
paulscalise1 Dec 3, 2026
e9b7ad5
pvr/g9p: a four-sample load gives each sample its own value
paulscalise1 Dec 3, 2026
f273e8a
pvr/g9p: no render merge that drops a colour attachment
paulscalise1 Dec 3, 2026
93ab995
pvr/g9p: workgroup barriers across tasks
paulscalise1 Dec 3, 2026
a7f5315
pvr/g9p: atomics on shared variables, through memory
paulscalise1 Dec 3, 2026
6b56c3d
pvr/g9p: indirect compute dispatches
paulscalise1 Dec 3, 2026
fe3a837
pvr/g9p: two and eight samples per pixel
paulscalise1 Dec 4, 2026
58ba607
pvr/g9p: a discarded pixel writes no target past what a pixel holds
paulscalise1 Dec 4, 2026
150fcc3
pvr/g9p: resolves by transfer past four end-of-tile surfaces
paulscalise1 Dec 4, 2026
e8b609c
pvr/g9p: a resolve sums in double and divides once
paulscalise1 Dec 4, 2026
b3a66ce
pvr/g9p: several samples of one and two raw words
paulscalise1 Dec 4, 2026
0b5f048
pvr/g9p: more colour words than a pixel holds, a render per group of …
paulscalise1 Dec 4, 2026
24b98f8
pvr/g9p: compute values past a workgroup's bank-1 share in bank 0
paulscalise1 Dec 4, 2026
6fb51f0
pvr/g9p: a compute dispatch's common store holds every buffer
paulscalise1 Dec 4, 2026
fe3d74a
pvr/g9p: textures in compute shaders
paulscalise1 Dec 4, 2026
8c9dee8
pvr/g9p: multisample texelFetch in vertex and compute shaders
paulscalise1 Dec 4, 2026
796cd04
pvr/g9p: workgroups of 512 invocations
paulscalise1 Dec 4, 2026
68844db
Merge branch 'main' into a10-gpu-fixes
henrikklee Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/imagination/g9p/g9p_a9_compute.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ bool g9p_a9_compile_compute(nir_shader *nir, struct g9p_shader *out, void *mem_c
memset(out, 0, sizeof(*out));
out->a9 = true;
a9_last_refusal[0] = 0;
lower_front(nir);
lower_front(nir, false);
NIR_PASS(_, nir, nir_shader_intrinsics_pass, a9_lower_subgroups_size1,
nir_metadata_control_flow, NULL);
NIR_PASS(_, nir, nir_shader_intrinsics_pass, a9_pack_image_store,
Expand Down
41 changes: 37 additions & 4 deletions src/imagination/g9p/g9p_cdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,18 @@ static inline struct g9p_cdm_record g9p_cdm_task(uint32_t k0, uint32_t data, uin
/*
* A DMA-only task loading constants into the USC common store (the buffer
* binding; iPadOS's constants record). Word 6 = 0x40000001 as observed on
* every captured DMA task (low bit: Rogue's common-store allocation, open).
* every captured DMA task. Its low bits are the common store the kernels
* after it have, in blocks of 16 dwords (decoded + tested on the A10: with
* one block, kernels read other values from dword 16 on, and buffer
* addresses there lost the GPU; 16 blocks, 256 dwords, read right).
* @dwords is the store the kernels read.
*/
static inline struct g9p_cdm_record g9p_cdm_dma_task(uint32_t k0, uint32_t data, uint32_t code)
static inline struct g9p_cdm_record g9p_cdm_dma_task(uint32_t k0, uint32_t data, uint32_t code,
uint32_t dwords)
{
struct g9p_cdm_record r = g9p_cdm_task(k0, data, G9P_CDM_K1_DMA, code);

r.w[6] |= 1;
r.w[6] |= dwords ? (dwords + 15) / 16 : 1;
return r;
}

Expand All @@ -152,11 +157,39 @@ static inline struct g9p_cdm_record g9p_cdm_kernel(uint32_t k0, uint32_t data, u
uint32_t threads, uint32_t tg_alloc)
{
struct g9p_cdm_record r = { { k0, data, code, gx - 1, gy - 1, gz - 1,
(threads % 32) << 27 | tg_alloc, (threads - 1) << 20 } };
(threads < 32 ? threads : 0) << 27 | tg_alloc, (threads - 1) << 20 } };

return r;
}

/*
* The threads a kernel record launches for a workgroup of @threads: past one
* task, whole tasks of 32, as the A9 launches them (g5p_cdm_workgroup_threads()).
* The program's prologue turns off the lanes past the workgroup (g9p_prologue()
* compares the index with the count in the common store). Measured on the A10
* with 64 workgroups: launched as they were, groups past 128 invocations and 8
* past a multiple of 16 (136, 152 ... 248) hung the GPU, and with registers
* above r31 so did 40, 56 and 72. As whole tasks every size tested ran.
*/
static inline uint32_t g9p_compute_hw_threads(uint32_t threads)
{
return threads > 32 ? (threads + 31) & ~31u : threads;
}

/*
* The most tasks of 32 a workgroup of programs of @regs registers may have.
* Measured on the A10 with 64 workgroups of whole tasks, registers in eights:
* 16 ran at 512 invocations, 24 at 256, 40 at 160 (192 hung one run in two),
* 48 and 64 at 128 (48 hung at 160), 72 to 96 at 64 (72 hung at 96). 32 is
* not measured and keeps the 192 invocations the earlier rule allowed.
*/
static inline unsigned g9p_compute_max_tasks(unsigned regs)
{
const unsigned r = (regs + 7) & ~7u;

return r <= 16 ? 16 : r <= 24 ? 8 : r <= 32 ? 6 : r <= 40 ? 5 : r <= 64 ? 4 : r <= 96 ? 2 : 1;
}

/* --- Internal programs and the end of a compute pass --------------------- */

/*
Expand Down
Loading
Loading