Commit Graph

4 Commits

Author SHA1 Message Date
299325cb20 sampler_lod_probe: validate oracle payloads, non-finite calibration starts, and run errors 2026-11-25 08:50:27 +01:00
c2547f4508 tools: handle POISON/arch errors in texoff_probe and close oracle in sampler_lod_probe 2026-11-24 09:45:32 +01:00
e11ded9d84 sampler_lod_probe: the docstring names the RDNA2 model as the rule, all 43 rows pinned, tsharp.POISON
From @iurysf's review of #2983: the docstring still said the rows are compared with Vulkan's rule and that the
no-GPU mode prints only that, while rule_level is the fitted RDNA2 model; it now describes both rules and what
exit 0 means. tests/test_sampler_lod_probe.py pins every measured row (43, from the gfx1036 run) instead of 14 and
checks that none is missing. The POISON check uses tsharp.POISON, as the kernel does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:12:47 +01:00
c462f27ee7 sampler_lod_probe: measure the S# and T# LOD fields on RDNA2 (SHADER-539)
tools/sampler_lod_probe.py samples a linear 64x64 R32_SFLOAT texture with seven levels through tools/hw_oracle,
with image_sample_l and image_sample_lz under the S#'s MIN_LOD / MAX_LOD / LOD_BIAS / MIP_FILTER and the T#'s
MIN_LOD and BASE_LEVEL. The texture memory is a dword ramp, so each sample names the level it came from; a
calibration row per level finds the level starts instead of assuming a layout.

On a gfx1036 (Radeon iGPU, AMD 26.10.1), 43 of 43 rows fit one model, wave32 and wave64 alike:
- the S# fields apply to an explicit LOD and to _lz's LOD 0 (bias, then the clamp), as radv assumes; MIP_FILTER
  none ignores them;
- the T#'s MIN_LOD applies too, counted from the resource's level 0, not the view's BASE_LEVEL;
- the point mip filter's level is floor(lambda + 0.5): an exact .5 rounds up (Vulkan: ceil(lambda + 0.5) - 1);
- the T#'s MIN_LOD clamps the fractional LOD before that rounding (VK_EXT_image_view_min_lod: floor(minLod)).
So the runtime's Vulkan sampler and view read one level lower on 8 of the 43 rows. Also measured: gfx1036 lays a
linear mip chain out smallest level first, rows padded to 256 bytes.

docs/d3d12_vulkan.md records the measurement in place of "not measured on RDNA2 here";
tests/test_sampler_lod_probe.py checks the descriptor fields and the model without a GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:01:02 +01:00