upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authoraslan2142 <jan.trencansky@protonmail.com>2026-11-25 03:59:38 +0100
committerGitHub <noreply@github.com>2026-11-25 03:59:38 +0100
commit0eeb1e663af5a3fe086c8dd0dfc5156bf69cc331 (patch)
treef5a883298136a8f74ee14d7cacd4f9a0b0e6ff61 /runtime
parentf78385646c5483d8bcd7d4161ee5dcd48d2b7fb3 (diff)
parent40b393aeaf2c0ba008bfca4de5454b5026e0d971 (diff)
Merge pull request #1008 from sodove/runtime/wave64-graphics-tier
Use wave64 graphics tiers on fixed 32-wide devices (RT-WAVE64-GRAPHICS-TIER)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/test/subgroup_size_test.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/test/subgroup_size_test.cpp b/runtime/test/subgroup_size_test.cpp
index 2628509fc..2a6fbdf97 100644
--- a/runtime/test/subgroup_size_test.cpp
+++ b/runtime/test/subgroup_size_test.cpp
@@ -7,8 +7,10 @@
7// - an old RADV: sizes 32..64, COMPUTE only. 7// - an old RADV: sizes 32..64, COMPUTE only.
8// No game data. 8// No game data.
9#include "../src/subgroup_size.h" 9#include "../src/subgroup_size.h"
10#include "test_temp_dir.h"
10 11
11#include <cstdio> 12#include <cstdio>
13#include <fstream>
12#include <string> 14#include <string>
13 15
14#define CHECK(condition) do { \ 16#define CHECK(condition) do { \
@@ -138,6 +140,31 @@ int main() {
138 CHECK(emulated.outcome == SubgroupOutcome::emulated && emulated.size == 0); 140 CHECK(emulated.outcome == SubgroupOutcome::emulated && emulated.size == 0);
139 } 141 }
140 142
143 // Read the translator's graphics tier through the same index lookup used at pipeline creation: tiers A and B are
144 // partition invariant (the device's 32-wide size is exact for them), C, an unknown tier and a non-string are not.
145 {
146 const testfiles::ScratchDir scratch("leonida_subgroup_graphics");
147 std::ofstream(scratch.path() / "index.json") << R"({
148 "a": {"stage":"vs","wave64":true,"subgroup_size":64,"fssm_sha256":"a","wave64_graphics":"A"},
149 "b": {"stage":"ps","wave64":true,"subgroup_size":64,"fssm_sha256":"b","wave64_graphics":"B"},
150 "c": {"stage":"gs","wave64":true,"subgroup_size":64,"fssm_sha256":"c","wave64_graphics":"C"},
151 "unknown": {"stage":"ps","wave64":true,"fssm_sha256":"unknown","wave64_graphics":"D"},
152 "bad": {"stage":"ps","wave64":true,"fssm_sha256":"bad","wave64_graphics":1}
153 })";
154 ShaderLibrary library;
155 CHECK(library.load(scratch.path()));
156 const auto* a = library.find("vs", "a");
157 const auto* b = library.find("ps", "b");
158 CHECK(a && b && graphics_partition_invariant(*a) && graphics_partition_invariant(*b));
159 for (const auto* shader : {library.find("gs", "c"), library.find("ps", "unknown"), library.find("ps", "bad")})
160 CHECK(shader && !graphics_partition_invariant(*shader));
161 // The size decision itself does not change: 64 cannot be had on NVIDIA, and AMD still gets it natively.
162 const auto fixed = decide_subgroup_size(*b, nvidia());
163 CHECK(fixed.outcome == SubgroupOutcome::unavailable && fixed.wanted == 64 && fixed.size == 0 && fixed.flags == 0);
164 const auto native = decide_subgroup_size(*b, amd());
165 CHECK(native.outcome == SubgroupOutcome::required && native.size == 64);
166 }
167
141 // --- An old RADV: COMPUTE only ---------------------------------------------------------------------------------- 168 // --- An old RADV: COMPUTE only ----------------------------------------------------------------------------------
142 { 169 {
143 const SubgroupSizeCaps caps = old_radv(); 170 const SubgroupSizeCaps caps = old_radv();