diff --git a/docs/experiments.md b/docs/experiments.md index 2ac82ba339..13e4d28d40 100644 --- a/docs/experiments.md +++ b/docs/experiments.md @@ -17170,9 +17170,9 @@ ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_entry_" -V ### Static samplers with a LOD clamp -The translator writes a constant sampler of `image_sample`, `_l` or `_lz` whose mip filter is not 0 as an `smpl` line (#2482): a static sampler whose MinLOD and MaxLOD come from the descriptor's word 1. The compute Dispatch now reads `smpl` lines as the draw path does, through the same `TranslatedSamplers::read_manifest_line` and `create_translated_root`; the only difference for compute is that the root signature is set with `SetComputeRootSignature`, and static samplers need nothing else. A comparison sampler (`smpc`) and the run-time sampler heap table (`smpheap`) are still refused, as "a comparison sampler" and "a sampler from the sampler heap". Binding the heap table for compute would need the draw path's sampler snapshot (`snapshot_samplers`, `create_sampler_snapshot_heap`) taken from the compute root's sampler heap pointer, the sampler heap set with `SetDescriptorHeaps` and its table set with `SetComputeRootDescriptorTable`. +The translator writes a constant sampler of `image_sample`, `_l` or `_lz` whose mip filter is not 0 as an `smpl` line (#2482): a static sampler whose MinLOD and MaxLOD come from the descriptor's word 1. The compute Dispatch now reads `smpl` lines as the draw path does, through the same `TranslatedSamplers::read_manifest_line` and `create_translated_root`; the only difference for compute is that the root signature is set with `SetComputeRootSignature`, and static samplers need nothing else. The run-time sampler heap table (`smpheap`) is still refused, as "a sampler from the sampler heap". An `smpc` line is read since #3075: see [comparison samplers in a published compute manifest](experiments/startup-compute-comparison-sampler.md). Binding the heap table for compute would need the draw path's sampler snapshot (`snapshot_samplers`, `create_sampler_snapshot_heap`) taken from the compute root's sampler heap pointer, the sampler heap set with `SetDescriptorHeaps` and its table set with `SetComputeRootDescriptorTable`. -`tests/startup_compute_dispatch_texture_check.py` adds a filtered case: the texture input program with a wrap, linear sampler (`smpl 0 0x0 0xc00000 0x18500000 0x0`) reads a 2x1 RGBA8 texture whose left texel has red 0 and right texel red 1.0, at the left edge. Only a linear filter that wraps reads 0.5 there. On WARP and on a physical adapter, every thread read red 0.5, and the debug layer reported no error. The control is the same program with the manifest's sampler changed to clamp: it reads red 0, which the check refuses. The `smpc` and `smpheap` lines refuse with their reasons and leave the output untouched. Without the new `smpl` reading, the Dispatch refuses with "a sampler that is not a plain static one" and the case fails. The texture has one mip, so the LOD clamp itself is not exercised here. +`tests/startup_compute_dispatch_texture_check.py` adds a filtered case: the texture input program with a wrap, linear sampler (`smpl 0 0x0 0xc00000 0x18500000 0x0`) reads a 2x1 RGBA8 texture whose left texel has red 0 and right texel red 1.0, at the left edge. Only a linear filter that wraps reads 0.5 there. On WARP and on a physical adapter, every thread read red 0.5, and the debug layer reported no error. The control is the same program with the manifest's sampler changed to clamp: it reads red 0, which the check refuses. The `smpheap` line refuses with its reason and leaves the output untouched. Without the new `smpl` reading, the Dispatch refuses with "a sampler that is not a plain static one" and the case fails. The texture has one mip, so the LOD clamp itself is not exercised here. In a local census, 7 compute programs (about 135 thousand Dispatch calls) had an `smpl` line as their first refusal, each with one or two `smpl` lines and no other sampler form. Read against the classifier, all 7 manifests now load; their next refusal, if any, comes from the bindings at Dispatch and has not been measured. diff --git a/docs/experiments/startup-compute-comparison-sampler.md b/docs/experiments/startup-compute-comparison-sampler.md new file mode 100644 index 0000000000..fc1f3ccfbd --- /dev/null +++ b/docs/experiments/startup-compute-comparison-sampler.md @@ -0,0 +1,90 @@ +# Comparison samplers in a published compute manifest (#3075) + +The stand-in reads the published translation of a slot 67 compute request from `.txt` +(`load_compute_translation`, `src/startup_stubs/d3d12_compute_dispatch.inl`). It refused every `smpc` line there +with `a comparison sampler`. It now reads `smpc ` under the same index and whole-line +checks as `smp` and `smpl`, through `TranslatedSamplers::read_manifest_line`. `decode_statics` already turns the +line into a comparison static sampler for the draw path, and the compute root signature takes it the same way. +An `smpheap` line is still refused with `a sampler from the sampler heap`. + +## What this covers + +- Only `tools/startup/gfx2hlsl.py` writes `smpc` for a compute program today (`image_sample_c_lz` and + `image_sample_c` with a constant comparison sampler). Before this change the runtime refused that translation + when it loaded the manifest, so such a request could not be dispatched. +- The C++ compiler's publisher is unchanged. `format_compute_runtime_manifest` (`src/direct_compute_cache.cpp`) + returns no manifest for a comparison sampler, so `compile_dxil` publishes no compute `smpc` line. +- The in-process route (`X2W_NATIVE_SHADERS`, `translate_compute_natively`) is unchanged. It reads no manifest + lines and refuses every sampler, and every view that is not a raw buffer, before it reaches one. + +## Fixture + +[`tests/startup_compute_dispatch_texture_check.py`](../../tests/startup_compute_dispatch_texture_check.py) gains +a compared case. It is case A of +[`startup_gfx2hlsl_compute_check.py`](../../tests/startup_gfx2hlsl_compute_check.py) (group size 2x3x4, 3x2x2 +groups, one word stored per thread) with these instructions before the store: + +``` +s_mov_b64 s[20:21], 0 +s_mov_b64 s[22:23], 0 +s_mov_b32 s20, 0x8001012 +s_load_dwordx8 s[24:31], s[10:11], 0x40 +v_cvt_f32_u32_e32 v7, v2 +v_cvt_f32_u32_e32 v8, v0 +v_mov_b32_e32 v9, 0 +image_sample_c_lz v12, v[7:9], s[24:31], s[20:23] dmask:0x1 dim:SQ_RSRC_IMG_2D +v_xor_b32_e32 v5, v5, v12 +``` + +The five instructions that are new here were not assembled by llvm-mc. The check asserts that the Python decoder +reads them as written, that the HLSL holds +`v12 = U(r1.SampleCmpLevelZero(q0, float2(F(v8), F(v9)), F(v7)));` and that the manifest ends with +`smpc 0 0x8001012 0x0 0x0 0x0` (clamp in U and V, TRUNC_COORD, point filters, LESS). + +The consumer's new mode `dispatch-sampled-depth` binds a 2x1 `R32_FLOAT` texture with depths 1.0 (left) and 2.5 +(right). The reference is the thread's z id (0.0 to 3.0). u is its x id: 0 reads the left texel and 1 clamps to +the right one. The CPU model XORs the bits of 1.0f into a word where `reference < texel` and leaves the word as +case A wrote it otherwise. That is 144 of the 288 written words. The 32 words past them keep the sentinel. + +1. Before the translation is published, the Dispatch is refused and every word keeps the sentinel. +2. After `gfx2hlsl.py --pending`, all 320 words match the model and the debug layer reports no error. +3. Control: the same program with the manifest's word 0 changed to GREATER (`0x8004012`) matches the model of + `reference > texel` (108 words pass). The two models differ at 252 words, so the function bound is the + manifest's. + +The case replaces an older control in the same file, which rewrote an `smpl` line as `smpc` and expected the +refusal. + +## Command and result + +```powershell +.\tools\dev.ps1 +cmake --build --preset dev --target startup_stream_consumer +ctest --preset dev --no-tests=error -R '^startup_compute_dispatch_texture_(warp|hardware)$' -V +``` + +Measured on 27.11.2026: `main` at `e1ea515d` plus this change, Windows 11 build 26300.9974, Windows SDK +10.0.26100, DXC 1.9.2602.17, Debug build, D3D12 debug layer enabled. + +| Test | Adapter, driver | Result | +|---|---|---| +| `startup_compute_dispatch_texture_hardware` | NVIDIA GeForce RTX 4090, 32.0.16.1088 | PASS (18.81 s). The compared case matched all 320 words under LESS and under GREATER, with no debug layer error. | +| `startup_compute_dispatch_texture_warp` | Microsoft Basic Render Driver, 10.0.26100.9818 | PASS (7.72 s), with the same lines. | + +There was no capability skip. + +Negative control: with `src/startup_stubs/d3d12_compute_dispatch.inl` put back to `e1ea515d` and the same target +rebuilt, both tests fail in the compared case, after the cases before it pass: + +``` +AssertionError: smpc LESS: x2w-draw compute e9f1d94c2215f572 Dispatch(3, 2, 2) refused: a comparison sampler +``` + +## Not measured + +- A bilinear comparison filter, a border address mode, a 2D array and the other six functions. The fixture runs + point, clamp, LESS and GREATER on a 2D texture with one mip. +- A comparison sampler on the in-process route or from the C++ compiler's publisher. Both still stop before the + manifest reader, as listed above. +- Console behaviour. The comparison is the desktop sampler's. The function mapping is the draw path's + (`decode_sampler` in `src/startup_stubs/translated_sampler_bindings.h`). diff --git a/src/startup_stubs/d3d12_compute_dispatch.inl b/src/startup_stubs/d3d12_compute_dispatch.inl index 3dfc274449..542749959b 100644 --- a/src/startup_stubs/d3d12_compute_dispatch.inl +++ b/src/startup_stubs/d3d12_compute_dispatch.inl @@ -4,7 +4,7 @@ // buffers (`srv buf table ` and `srv buf root ` inputs, `uav table ` // outputs) named by hardware buffer descriptors or 64-bit root SRV addresses, and textures // (`srv tex2d table ` inputs, `uav tex1d/tex2d/tex2da/tex3d float table channels 4` outputs) named -// by the token of a view the title created (device slots 18 and 19). `smp` lines become static samplers. Entry +// by the token of a view the title created (device slots 18 and 19). `smp`, `smpl` and `smpc` lines become static samplers. Entry // values come from the compute root constants of slots 37 and 39, or from the descriptor a buffer input or output is // bound from: its stride and word 3 (`stride`, `descword3`), and word 3, the upper half of word 1 and the record // count of an output (`uav_descword3`, `uav_stride`, `uav_numrecords`). Any other manifest line makes the translation @@ -170,12 +170,12 @@ const char* load_compute_translation(ComputeTranslation& tr) } else if (std::sscanf(line.c_str(), "srv %u tex2d table %d %d%n", &i, &a, &b, &used) == 3 && whole() && i == tr.srvs.size()) tr.srvs.push_back({a, b, true}); - // A static sampler, plain (smp) or with the descriptor's LOD clamp (smpl), decoded as the draw path does. - // Not modelled here: comparison samplers (smpc) and the run-time sampler heap table (smpheap). - else if (line.rfind("smpc", 0) == 0) return "a comparison sampler"; + // A static sampler, decoded as the draw path does: plain (smp), with the descriptor's LOD clamp (smpl) or a + // comparison one (smpc). Not modelled here: the run-time sampler heap table (smpheap). else if (line.rfind("smpheap", 0) == 0) return "a sampler from the sampler heap"; else if ((std::sscanf(line.c_str(), "smp %u %x %x %x %x%n", &i, &x, &y, &z, &w, &used) == 5 || - std::sscanf(line.c_str(), "smpl %u %x %x %x %x%n", &i, &x, &y, &z, &w, &used) == 5) && whole() && + std::sscanf(line.c_str(), "smpl %u %x %x %x %x%n", &i, &x, &y, &z, &w, &used) == 5 || + std::sscanf(line.c_str(), "smpc %u %x %x %x %x%n", &i, &x, &y, &z, &w, &used) == 5) && whole() && i == tr.samplers.statics.size()) tr.samplers.read_manifest_line(line.c_str()); else return line.rfind("srv", 0) == 0 ? "a resource that is not a raw table buffer or a 2D texture" diff --git a/tests/startup_compute_dispatch_texture_check.py b/tests/startup_compute_dispatch_texture_check.py index d56ba9ad11..1c7543bc95 100644 --- a/tests/startup_compute_dispatch_texture_check.py +++ b/tests/startup_compute_dispatch_texture_check.py @@ -23,7 +23,13 @@ Filtered input: the texture input case with a constant wrap, linear sampler that the translator writes as `smpl` and a 2x1 texture (dispatch-sampled-2x1): red 0.5 at the left edge. The same program with the manifest's sampler -changed to clamp reads red 0 (the control); `smpc` and `smpheap` lines are refused with their reasons. +changed to clamp reads red 0 (the control); an `smpheap` line is refused with its reason. + +Compared input: case A with a level-zero comparison sample (image_sample_c_lz) under a constant point, clamp, LESS +sampler that the translator writes as `smpc`, and a 2x1 R32_FLOAT texture of depths 1.0 and 2.5 +(dispatch-sampled-depth). The reference is the thread's z id and u its x id, so the 288 written words hold both +outcomes; all 320 words equal a CPU model of the comparison. The same program with the manifest's function changed +to GREATER matches the GREATER model (the control). The two-mips mode writes two different patterns through separate UAVs of the same texture, then swaps the views. Exit 77 when the adapter is not available. @@ -373,22 +379,101 @@ def reds(got): layer = clean(result) # Control: the same program under the manifest's sampler changed to clamp in U, V and W reads red 0, which the - # check above refuses; a comparison sampler and a sampler heap table stay refused, each with its reason. + # check above refuses; a sampler heap table stays refused with its reason. manifest = cache / f'{key:016x}.txt' original = manifest.read_text() assert original.count(line) == 1, original manifest.write_bytes(original.replace(line, line.replace('smpl 0 0x0 ', 'smpl 0 0x92 ')).encode()) got, result = run(directory, consumer, env, 'dispatch-sampled-2x1', layout) assert len(lines(result, 'Dispatch(3, 2, 2) translated')) == 1 and reds(got) == {0.0}, result.stderr[-3000:] - for new, reason in ((line.replace('smpl', 'smpc'), 'a comparison sampler'), - (line + '\nsmpheap 2048 1 fallback 2047', 'a sampler from the sampler heap')): - manifest.write_bytes(original.replace(line, new).encode()) - got, result = run(directory, consumer, env, 'dispatch-sampled-2x1', layout) - refused = lines(result, 'refused: ') - assert got == [C.SENTINEL] * C.WORDS and len(refused) == 1 and refused[0].endswith('refused: ' + reason), ( - reason, refused, result.stderr[-3000:]) + manifest.write_bytes(original.replace(line, line + '\nsmpheap 2048 1 fallback 2047').encode()) + got, result = run(directory, consumer, env, 'dispatch-sampled-2x1', layout) + refused = lines(result, 'refused: ') + assert got == [C.SENTINEL] * C.WORDS and len(refused) == 1 and refused[0].endswith( + 'refused: a sampler from the sampler heap'), (refused, result.stderr[-3000:]) print(f'filtered input: an smpl wrap and linear sampler reads red 0.5 at the left edge of a 2x1 texture; the same ' - f'program with a clamp sampler reads 0; comparison and heap samplers refused; debug layer: {layer}') + f'program with a clamp sampler reads 0; a heap sampler is refused; debug layer: {layer}') + + +# The texture input case with a comparison sample: s20 clamp in U and V, TRUNC_COORD and LESS (point filters, LOD +# range 0). The reference is v7 = float(thread id z), u is v8 = float(thread id x) and v is v9 = 0. The five new +# instructions are not assembled by llvm-mc here; the decoder is checked to read them as written. +POINT_LESS = 2 | 2 << 3 | 1 << 27 | 1 << 12 +POINT_GREATER = POINT_LESS ^ 1 << 12 | 4 << 12 +COMPARED = SAMPLED[:2] + ('s_mov_b32 s20, 0x%x' % POINT_LESS, SAMPLED[2], 'v_cvt_f32_u32_e32 v7, v2', + 'v_cvt_f32_u32_e32 v8, v0', 'v_mov_b32_e32 v9, 0', + 'image_sample_c_lz v12, v[7:9], s[24:31], s[20:23] dmask:0x1 dim:SQ_RSRC_IMG_2D', + 'v_xor_b32_e32 v5, v5, v12') + + +def compared(directory, consumer, dxc, env): + """The sampler bound is the manifest's `smpc` one: a 2x1 R32_FLOAT texture (1.0, 2.5) is compared at u = 0 (the + left texel) or u = 1 (clamped to the right one) with the references 0.0 to 3.0. A word is XORed with the bits of + 1.0f where the CPU model of the comparison passes and is left as case A wrote it where the model fails.""" + cache, base = prepare(directory) + env = dict(base, **env) + (directory / 'compute_root').write_bytes(C.root_blob(table_range=True)) + env['X2W_TEST_COMPUTE_ROOT'] = str(directory / 'compute_root') + _, _, rsrc2, group, _ = C.CASES['A'] + C.SPLICE.update({COMPARED[2]: 'ff0394be' + struct.pack('= C.STORE_A][:len(COMPARED)] + assert decoded == list(COMPARED), decoded + pipeline = C.translate('A', code=code) + line = 'smpc 0 0x%x 0x0 0x0 0x0' % POINT_LESS + assert 'v12 = U(r1.SampleCmpLevelZero(q0, float2(F(v8), F(v9)), F(v7)));' in pipeline.hlsl_cs() and \ + pipeline.manifest().endswith('srv 1 tex2d table 1 64\nuav 0 table 1 16\n' + line + '\n'), pipeline.manifest() + (directory / 'program').write_bytes(code) + (directory / 'data').write_bytes(DATA) + (directory / 'state').write_bytes(state_a(group, rsrc2)) + one = struct.unpack(' texel) + passing = [sum(a != b for a, b in zip(m, plain)) for m in (less, greater)] + differ = sum(a != b for a, b in zip(less, greater)) + assert passing == [144, 108] and differ == 252, (passing, differ) + + got, result = run(directory, consumer, env, 'dispatch-sampled-depth', layout) + assert got == [C.SENTINEL] * C.WORDS, 'a Dispatch without a translation wrote the output' + key = int(lines(result, 'x2w-draw compute request')[0].split()[3], 16) + translate(cache, dxc, key) + + got, result = run(directory, consumer, env, 'dispatch-sampled-depth', layout) + match(got, less, result, 'smpc LESS') + layer = clean(result) + + # Control: the function is the manifest's. Under GREATER the same program passes where the reference is above + # the texel, a result the check above refuses at 252 words. + manifest = cache / f'{key:016x}.txt' + original = manifest.read_text() + assert original.count(line) == 1, original + manifest.write_bytes(original.replace(line, 'smpc 0 0x%x 0x0 0x0 0x0' % POINT_GREATER).encode()) + got, result = run(directory, consumer, env, 'dispatch-sampled-depth', layout) + match(got, greater, result, 'smpc GREATER') + clean(result) + print(f'compared input: an smpc point, clamp, LESS sampler passes at 144 of the {written} written words and all ' + f'{C.WORDS} words match the CPU model; the same program under GREATER matches its model (108 pass, 252 ' + f'words differ from LESS); debug layer: {layer}') def uniform_image_load_mip(directory, consumer, dxc, env): @@ -483,6 +568,7 @@ def main(consumer, dxc, adapter, mode=None): store_3d1d(directory / form, consumer, dxc, env, form) sample(directory / 'sample', consumer, dxc, env) filtered(directory / 'filtered', consumer, dxc, env) + compared(directory / 'compared', consumer, dxc, env) uniform_image_load_mip(directory / 'uniform_image_load_mip', consumer, dxc, env) print(f'startup_compute_dispatch_texture: PASS on {adapter}') diff --git a/tests/startup_stream_consumer.cpp b/tests/startup_stream_consumer.cpp index 5e75f5f394..16c288f714 100644 --- a/tests/startup_stream_consumer.cpp +++ b/tests/startup_stream_consumer.cpp @@ -163,7 +163,7 @@ static void* desktop_pipeline(void* device) // data-pointer valid, with the first data qword pointing at state block A // code-zero, data-zero, no-root, code-unreadable, code-past-end, data-unreadable, state-unreadable, // stateb-unreadable, desc-unreadable -// dispatch, dispatch-swapped, dispatch-none, dispatch-records32, dispatch-sampled, dispatch-sampled-unbound, dispatch-sampled-2x1, dispatch-heap, +// dispatch, dispatch-swapped, dispatch-none, dispatch-records32, dispatch-sampled, dispatch-sampled-unbound, dispatch-sampled-2x1, dispatch-sampled-depth, dispatch-heap, // dispatch-heap-outside, dispatch-heap-word*, dispatch-input-*: one creation, then dispatch_slot67 below // texture-store and texture-array modes: one creation, then texture_slot67 below // The unreadable cases point at a PAGE_NOACCESS page; code-past-end ends the code on the last byte before one. @@ -196,6 +196,7 @@ static void* make_committed(void* device, D3D12_HEAP_TYPE type, const D3D12_RESO // CopyTextureRegion (list slot 16) and a shader resource view of it (device slot 18) whose token the stand-in // writes at table byte 64. dispatch-sampled-unbound creates no view, so that entry holds no token. // dispatch-sampled-2x1 makes the texture 2x1 with red 0 in its left texel and 1.0 in its right one. +// dispatch-sampled-depth makes it 2x1 R32_FLOAT, a format a comparison sample reads: 1.0 left, 2.5 right. // dispatch-heap runs the program of startup_gfx2hlsl_heap_record_check.py: a third root constant, 2, indexes the // 32-byte heap record that holds the input descriptor (heap byte 64). Heap bytes 0 and 32 hold the output's // descriptor, so an index that is ignored or scaled by 16 names a buffer the dispatch refuses as an input. @@ -342,8 +343,10 @@ static int dispatch_slot67(IDXGIAdapter* adapter, void* device, const std::strin if (indirect) record.prepare(adapter, device, list, memory + 0x20000 / sizeof(UINT), groups); bind(); if (mode.rfind("dispatch-sampled", 0) == 0 || mode == "dispatch-input-token") { - const UINT width = mode == "dispatch-sampled-2x1" ? 2 : 1; - const D3D12_RESOURCE_DESC texture_desc{D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, width, 1, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, {1, 0}}; + const bool depth = mode == "dispatch-sampled-depth"; + const UINT width = depth || mode == "dispatch-sampled-2x1" ? 2 : 1; + const DXGI_FORMAT format = depth ? DXGI_FORMAT_R32_FLOAT : DXGI_FORMAT_R8G8B8A8_UNORM; + const D3D12_RESOURCE_DESC texture_desc{D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, width, 1, 1, 1, format, {1, 0}}; const D3D12_RESOURCE_DESC upload_desc{D3D12_RESOURCE_DIMENSION_BUFFER, 0, 256, 1, 1, 1, DXGI_FORMAT_UNKNOWN, {1, 0}, D3D12_TEXTURE_LAYOUT_ROW_MAJOR}; void* const texture = make_committed(device, D3D12_HEAP_TYPE_DEFAULT, texture_desc, D3D12_RESOURCE_STATE_COMMON); @@ -354,13 +357,14 @@ static int dispatch_slot67(IDXGIAdapter* adapter, void* device, const std::strin // reads 0.5 at the left edge (point or clamp read 0). unsigned char rgba[8] = {255, 64, 128, 32, 255, 64, 128, 32}; if (width == 2) rgba[0] = 0; - std::memcpy(texel, rgba, sizeof(rgba)); + const float depths[2] = {1.0f, 2.5f}; + std::memcpy(texel, depth ? static_cast(depths) : rgba, sizeof(rgba)); invoke(upload, 9, 0, 0); D3D12_TEXTURE_COPY_LOCATION image{static_cast(texture), D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX}; D3D12_TEXTURE_COPY_LOCATION source{static_cast(upload), D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT}; - source.PlacedFootprint = {0, {DXGI_FORMAT_R8G8B8A8_UNORM, width, 1, 1, 256}}; + source.PlacedFootprint = {0, {format, width, 1, 1, 256}}; invoke(list, 16, word(&image), 0, 0, 0, word(&source), 0); - D3D12_SHADER_RESOURCE_VIEW_DESC view{DXGI_FORMAT_R8G8B8A8_UNORM, D3D12_SRV_DIMENSION_TEXTURE2D, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING}; + D3D12_SHADER_RESOURCE_VIEW_DESC view{format, D3D12_SRV_DIMENSION_TEXTURE2D, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING}; view.Texture2D.MipLevels = 1; if (mode != "dispatch-sampled-unbound") invoke(device, 18, word(texture), word(&view), cpu + (mode == "dispatch-input-token" ? 0 : 64)); }