🎨 Answer the graphics lane's device limits as an AMD Mac does

The graphics lane's device answered what the host platform answers for
maxBufferLength and the linear texture alignment, and left the framebuffer
read, tile shader and imageblock answers to the base class. Each answer
steers the guest's frameworks, so each now picks, from the answers real
Macs give, the one the lane can keep cheapest (dgpu-oracle.md):

- maxBufferLength is the host's, but at most three quarters of
  recommendedMaxWorkingSetSize rounded down to 16 KiB. That is the rule the
  Radeon Pro 5300M and the M3 Max answer by. The Vulkan platform answers
  the driver's maxBufferSize, a terabyte on an RTX 5080 that no allocation
  reaches; the 5080 now answers 12821200896.
- minimumLinearTextureAlignmentForPixelFormat: and the SPI
  linearTextureAlignmentBytes and deviceLinearTextureAlignmentBytes answer
  256 (or the host's, where larger), as the 5300M and the UHD 630 answer.
  RADV takes a texture over dma-buf pages in place only at rows a multiple
  of 256 apart, and every 256-byte layout is one the host's 16 takes.
- isFramebufferReadSupported answers no, as the 5300M does. That keeps the
  guest's frameworks off attachment reads, which cost the Vulkan platform
  the most.
- supportsTileShaders, supportsNonSquareTileShaders and supportsImageBlocks
  answer no, as the 5300M and the UHD 630 do. The lane carries none of
  them.

The bundle answers all of these from the device-info blob, never through
the base class.
This commit is contained in:
Anees Iqbal committed 2026-11-05 21:59:19 -08:00
1 parent 50b38949d7
commit 7b2ecacab6
6 files changed
+185 -4

No files matched your search

+5
View File
@@ -333,6 +333,7 @@ void test_caps()
info.primitive_types[3] = 1;
info.write_rounding_modes[1] = 1; // mode 2
info.limits[kRgfxLimitDeviceLinearTextureAlignmentBytes] = 64;
info.limits[kRgfxLimitLinearTextureAlignmentBytes] = 256;
info.limits[kRgfxLimitMaxViewportCount] = 16; // last by position
info.flags[kRgfxFlagAreRasterOrderGroupsSupported] = 1; // first by position
info.flags[kRgfxFlagSupportsTileShaders] = 1; // last by position
@@ -369,6 +370,10 @@ void test_caps()
CHECK(caps.textureBufferAlignment(80) == 16);
CHECK(caps.textureBufferAlignment(70) == 0); // listed past the count
CHECK(caps.textureBufferAlignment(130) == 0); // not listed
// The linear alignment is the one limit for every format with a texture-buffer answer.
CHECK(caps.minimumLinearTextureAlignment(80) == 256);
CHECK(caps.minimumLinearTextureAlignment(70) == 0); // listed past the count
CHECK(caps.minimumLinearTextureAlignment(130) == 0); // not listed
uint64_t tile[3];
CHECK(caps.sparseTile(80, 1, 101, tile) && tile[0] == 64 && tile[1] == 64 && tile[2] == 1);
CHECK(caps.sparseTile(80, 4, 103, tile) && tile[0] == 128 && tile[2] == 1);