diff options
| author | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 03:15:13 +0100 |
|---|---|---|
| committer | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 03:15:13 +0100 |
| commit | 0e63a76da09ab665512dc51153eb1ca8578d92bf (patch) | |
| tree | 2657446a965191d98752f27e5f09c4ea90e442e7 /runtime/src/depth24_convert.comp | |
| parent | 33059d6b6323e10134a405b1bce314b233c4754d (diff) | |
D24 conversion: predication, large copies, tests, spec note (review)
- A dispatch honours conditional rendering and the layer's copies do not, so a
SetPredication that skips copies also skipped the D24 conversion while the
copy ran. Conditional rendering is ended around the dispatch and begun
again; a test runs an upload and readback under a skipping predicate and
compares with the host's unpredicated run (it fails without the fix).
- A copy larger than maxStorageBufferRange (queried; 128 MiB assumed if not)
is split into dispatches by slices, or by rows of one slice; the descriptors
bind 256-byte-aligned windows of both buffers. depth24_convert_test splits
the 4096x4096 copy with a 1 MiB range and a pitched one with a 1 KiB range.
- make_pipeline destroys the layouts it made when a later step fails.
- depth24_convert_test is in the CI tool list; the docs say which GPU each test
exercises.
- R24G8_TYPELESS with a typed D24 DSV is compared with the host. SRVs of
R24_UNORM_X8_TYPELESS and X24_TYPELESS_G8_UINT are an empty slot in the
layer (no format mapping; stencil-plane views refused): reported by the
test and documented as a known gap.
- depth24.h: the D3D11.3 spec's FLOAT -> UNORM wording (3.2.3.6, 3.2.2) next to
what WARP and AMD were measured to do; "159" is 5215.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/depth24_convert.comp')
| -rw-r--r-- | runtime/src/depth24_convert.comp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/src/depth24_convert.comp b/runtime/src/depth24_convert.comp index ee69f8e3b..eb4795a35 100644 --- a/runtime/src/depth24_convert.comp +++ b/runtime/src/depth24_convert.comp | |||
| @@ -20,7 +20,7 @@ layout(push_constant) uniform Push { | |||
| 20 | uint app_base; // first word of the region in `app`, within the bound window | 20 | uint app_base; // first word of the region in `app`, within the bound window |
| 21 | uint app_row; // words between rows and between slices of the app buffer | 21 | uint app_row; // words between rows and between slices of the app buffer |
| 22 | uint app_slice; | 22 | uint app_slice; |
| 23 | uint unused; | 23 | uint scratch_base; // first word of the region in `scratch`, within the bound window |
| 24 | } pc; | 24 | } pc; |
| 25 | 25 | ||
| 26 | // d / (2^24 - 1) as a float. With m the 24-bit mantissa of d (d = m * 2^(e-23)) the quotient is | 26 | // d / (2^24 - 1) as a float. With m the 24-bit mantissa of d (d = m * 2^(e-23)) the quotient is |
| @@ -46,7 +46,7 @@ void main() { | |||
| 46 | uvec3 g = gl_GlobalInvocationID; | 46 | uvec3 g = gl_GlobalInvocationID; |
| 47 | if (g.x >= pc.width || g.y >= pc.height || g.z >= pc.slices) return; | 47 | if (g.x >= pc.width || g.y >= pc.height || g.z >= pc.slices) return; |
| 48 | uint a = pc.app_base + g.z * pc.app_slice + g.y * pc.app_row + g.x; | 48 | uint a = pc.app_base + g.z * pc.app_slice + g.y * pc.app_row + g.x; |
| 49 | uint s = (g.z * pc.height + g.y) * pc.width + g.x; | 49 | uint s = pc.scratch_base + (g.z * pc.height + g.y) * pc.width + g.x; |
| 50 | if (pc.to_float != 0u) scratch[s] = floatBitsToUint(depth24_to_float(app[a] & 0xffffffu)); | 50 | if (pc.to_float != 0u) scratch[s] = floatBitsToUint(depth24_to_float(app[a] & 0xffffffu)); |
| 51 | else app[a] = depth24_from_float(uintBitsToFloat(scratch[s])); | 51 | else app[a] = depth24_from_float(uintBitsToFloat(scratch[s])); |
| 52 | } | 52 | } |