Preserve comparison sampling through the SPIR-V to HLSL bridge #664

Closed
opened 2026-11-22 18:47:57 +00:00 by R0Y00 · 6 comments
R0Y00 commented 2026-11-22 18:47:57 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T18:47:57Z.


Why this is on the integration path

#656 unblocked subgroup ballot extraction in the external-frontend bridge. In the fixed-profile follow-up scan, all 807 affected compute records emitted HLSL. DXC accepted 29, timed out on 42, and rejected 736. The first diagnostic in the rejected group points to a texture sampling call using a comparison sampler. This identifies a common compile blocker. The supported operation and its output still need an independent comparison.

First implementation

Identify the SPIR-V image operation and sampler type that cause one representative failure. Reproduce it with a small source-built compute fixture and a known depth texture. Keep ordinary sampling and comparison sampling distinguishable across HLSL emission and descriptor binding. Match the reference, coordinate and LOD semantics of the selected form. Record which forms the fixture exercises and reject unsupported variants with a specific diagnostic. Extend the existing bridge tests around #553 and #656.

Acceptance

  • Reproduce the original DXC diagnostic with the public fixture and record the pinned SPIRV-Tools, SPIRV-Cross and DXC versions. Validate SPIR-V before compiling the corrected HLSL to DXIL.
  • Dispatch on Windows using WARP and one capable physical adapter. Compare every output and guard word with an independent reference using at least one passing and one failing depth comparison. A deliberately wrong comparison input or reference must be detected at a named output position. Keep an ordinary sampling control.
  • Add a focused repeatable test with source-built inputs. Record the SHA, command, backend, driver, first mismatch or capability skip. The maintainer can repeat the fixed-profile scan and report frontend, DXC, pipeline and readback outcomes separately using the same 807-record cohort.

You can claim the public reproducer or the lowering and binding change. Leave the first failing command and your proposed interface in a comment before opening the PR. Refs #218 and #656.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6546279378 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T18:47:57Z. --- ## Why this is on the integration path #656 unblocked subgroup ballot extraction in the external-frontend bridge. In the fixed-profile follow-up scan, all 807 affected compute records emitted HLSL. DXC accepted 29, timed out on 42, and rejected 736. The first diagnostic in the rejected group points to a texture sampling call using a comparison sampler. This identifies a common compile blocker. The supported operation and its output still need an independent comparison. ## First implementation Identify the SPIR-V image operation and sampler type that cause one representative failure. Reproduce it with a small source-built compute fixture and a known depth texture. Keep ordinary sampling and comparison sampling distinguishable across HLSL emission and descriptor binding. Match the reference, coordinate and LOD semantics of the selected form. Record which forms the fixture exercises and reject unsupported variants with a specific diagnostic. Extend the existing bridge tests around #553 and #656. ## Acceptance - Reproduce the original DXC diagnostic with the public fixture and record the pinned SPIRV-Tools, SPIRV-Cross and DXC versions. Validate SPIR-V before compiling the corrected HLSL to DXIL. - Dispatch on Windows using WARP and one capable physical adapter. Compare every output and guard word with an independent reference using at least one passing and one failing depth comparison. A deliberately wrong comparison input or reference must be detected at a named output position. Keep an ordinary sampling control. - Add a focused repeatable test with source-built inputs. Record the SHA, command, backend, driver, first mismatch or capability skip. The maintainer can repeat the fixed-profile scan and report frontend, DXC, pipeline and readback outcomes separately using the same 807-record cohort. You can claim the public reproducer or the lowering and binding change. Leave the first failing command and your proposed interface in a comment before opening the PR. Refs #218 and #656.
rwZephyr commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:00:29Z.


Public compile-stage reproducer for #670. Both source-built modules validate under Vulkan 1.2. With one sampler ID used by both sampling forms, pinned SPIRV-Cross emits a SamplerComparisonState and passes it to ordinary SampleLevel. DXC rejects that call. With separate sampler IDs, DXC compiles successfully.

Tested locally on Windows 11 25H2 x64 26200.9974 at Xbox2Windows edc2e54e7e75fcd7c0f13e98b47ba119d9a08268. Tools: SPIRV-Tools v2025.5 with its pinned headers, SPIRV-Cross 57e4efcc84112abcd426dc5ec248b5339bee04f2, and DXC 1.8.2502.8. AI-assisted.

Save as source.hlsl:

[[vk::binding(0, 0)]] Texture2D<float> depthTexture;
[[vk::binding(1, 0)]] Texture2D<float> valueTexture;
[[vk::binding(2, 0)]] SamplerComparisonState cmpSampler;
[[vk::binding(3, 0)]] SamplerState plainSampler;
[[vk::binding(4, 0)]] RWStructuredBuffer<float> results;

[numthreads(1, 1, 1)]
void main()
{
    const float2 uv = float2(0.25f, 0.25f);
    results[0] = depthTexture.SampleCmpLevelZero(cmpSampler, uv, 0.25f);
    results[1] = depthTexture.SampleCmpLevelZero(cmpSampler, uv, 0.75f);
    results[2] = valueTexture.SampleLevel(plainSampler, uv, 0.0f);
}
dxc -spirv '-fspv-target-env=vulkan1.2' -T cs_6_6 -E main -Fo separate.spv -Fc separate.spvasm source.hlsl
$assembly = Get-Content -Raw separate.spvasm
$assembly -replace '(OpLoad %type_sampler) %plainSampler\b', '$1 %cmpSampler' | Set-Content -Encoding ascii shared.spvasm
foreach ($variant in 'separate','shared') {
    spirv-as --target-env vulkan1.2 "$variant.spvasm" -o "$variant.spv"
    spirv-val --target-env vulkan1.2 "$variant.spv"
    spirv-cross "$variant.spv" --hlsl --shader-model 66 --output "$variant.hlsl"
    dxc -T cs_6_6 -E main -Fo "$variant.dxil" "$variant.hlsl"
}

The first failing command was dxc -T cs_6_6 -E main -Fo shared.dxil shared.hlsl. First diagnostic:

shared.hlsl:11:42: error: no matching member function for call to 'SampleLevel'

The comparison instructions here are OpImageSampleDrefExplicitLod with literal Lod 0. The ordinary control is OpImageSampleExplicitLod with Lod 0. For a follow-up, I propose carrying sampler kind per use through the named bridge profile so the host can bind an ordinary sampler and a comparison sampler in separate slots. Keep the first implementation to Texture2D<float> and literal zero LOD. With point-clamp sampling, a constant 0.5 depth, LESS_EQUAL, and a separate ordinary texture of value 0.375, the proposed dispatch reference is [1.0, 0.0, 0.375] followed by unchanged guards. The evidence here covers SPIR-V validation, HLSL emission, and DXC compilation. GPU dispatch and correspondence to the private scan are still unverified.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084034682 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084034682). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:00:29Z. --- Public compile-stage reproducer for #670. Both source-built modules validate under Vulkan 1.2. With one sampler ID used by both sampling forms, pinned SPIRV-Cross emits a `SamplerComparisonState` and passes it to ordinary `SampleLevel`. DXC rejects that call. With separate sampler IDs, DXC compiles successfully. Tested locally on Windows 11 25H2 x64 `26200.9974` at Xbox2Windows `edc2e54e7e75fcd7c0f13e98b47ba119d9a08268`. Tools: SPIRV-Tools `v2025.5` with its pinned headers, SPIRV-Cross `57e4efcc84112abcd426dc5ec248b5339bee04f2`, and DXC `1.8.2502.8`. AI-assisted. Save as `source.hlsl`: ```hlsl [[vk::binding(0, 0)]] Texture2D<float> depthTexture; [[vk::binding(1, 0)]] Texture2D<float> valueTexture; [[vk::binding(2, 0)]] SamplerComparisonState cmpSampler; [[vk::binding(3, 0)]] SamplerState plainSampler; [[vk::binding(4, 0)]] RWStructuredBuffer<float> results; [numthreads(1, 1, 1)] void main() { const float2 uv = float2(0.25f, 0.25f); results[0] = depthTexture.SampleCmpLevelZero(cmpSampler, uv, 0.25f); results[1] = depthTexture.SampleCmpLevelZero(cmpSampler, uv, 0.75f); results[2] = valueTexture.SampleLevel(plainSampler, uv, 0.0f); } ``` ```powershell dxc -spirv '-fspv-target-env=vulkan1.2' -T cs_6_6 -E main -Fo separate.spv -Fc separate.spvasm source.hlsl $assembly = Get-Content -Raw separate.spvasm $assembly -replace '(OpLoad %type_sampler) %plainSampler\b', '$1 %cmpSampler' | Set-Content -Encoding ascii shared.spvasm foreach ($variant in 'separate','shared') { spirv-as --target-env vulkan1.2 "$variant.spvasm" -o "$variant.spv" spirv-val --target-env vulkan1.2 "$variant.spv" spirv-cross "$variant.spv" --hlsl --shader-model 66 --output "$variant.hlsl" dxc -T cs_6_6 -E main -Fo "$variant.dxil" "$variant.hlsl" } ``` The first failing command was `dxc -T cs_6_6 -E main -Fo shared.dxil shared.hlsl`. First diagnostic: ```text shared.hlsl:11:42: error: no matching member function for call to 'SampleLevel' ``` The comparison instructions here are `OpImageSampleDrefExplicitLod` with literal `Lod 0`. The ordinary control is `OpImageSampleExplicitLod` with `Lod 0`. For a follow-up, I propose carrying sampler kind per use through the named bridge profile so the host can bind an ordinary sampler and a comparison sampler in separate slots. Keep the first implementation to `Texture2D<float>` and literal zero LOD. With point-clamp sampling, a constant `0.5` depth, `LESS_EQUAL`, and a separate ordinary texture of value `0.375`, the proposed dispatch reference is `[1.0, 0.0, 0.375]` followed by unchanged guards. The evidence here covers SPIR-V validation, HLSL emission, and DXC compilation. GPU dispatch and correspondence to the private scan are still unverified.
rwZephyr commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:03:24Z.


GPU readback follow-up to the compile-stage reproducer. I dispatched its validated, cross-compiled separate-sampler shader using a standalone D3D12 host. AI-assisted, run locally.

Windows 11 25H2 x64 26200.9974, Xbox2Windows checkout edc2e54e7e75fcd7c0f13e98b47ba119d9a08268, MSVC 19.44.35230, SDK 10.0.26100. Same SPIRV-Tools v2025.5, SPIRV-Cross 57e4efcc84112abcd426dc5ec248b5339bee04f2, and DXC 1.8.2502.8 as above. Tested RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP (1414:008c, 10.0.26100.9818). Both reported debug_layer=unavailable.

One cs_6_6 dispatch per backend. The host bound 2×2 R32_FLOAT SRVs at t0/t1, a point-clamp comparison sampler (LESS_EQUAL) at s2, a point-clamp ordinary sampler at s3, and a raw output buffer at u4. At UV (0.25, 0.25), the shader compares references 0.25 and 0.75 against depth 0.5 and samples ordinary value 0.375.

Both backends returned 3f800000,00000000,3ec00000 (1.0, 0.0, 0.375), with all 13 guard words unchanged and zero mismatches or skips. Changing only the CPU reference at word 1 gave exactly one mismatch on each backend (expected=3f800000 actual=00000000).

Reproduce from a directory containing separate.dxil generated by the earlier comment and the host source below saved as compare-readback.cpp:

cl /nologo /EHsc /std:c++17 /W4 /MT /Fecompare-readback.exe compare-readback.cpp /link d3d12.lib dxgi.lib
$env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT'
.\compare-readback.exe hardware separate.dxil
.\compare-readback.exe warp separate.dxil

This verifies the GPU behavior of the separate-sampler control. The shared-sampler lowering and repository CTest integration are still open.

Standalone D3D12 readback host
#include <d3d12.h>
#include <dxgi1_6.h>
#include <wrl/client.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <cwchar>
#include <fstream>
#include <iterator>
#include <stdexcept>
#include <vector>

using Microsoft::WRL::ComPtr;

static void check(HRESULT hr, const char* operation)
{
    if (SUCCEEDED(hr)) return;
    std::fprintf(stderr, "%s failed (0x%08lx)\n", operation, static_cast<unsigned long>(hr));
    throw std::runtime_error(operation);
}

static ComPtr<IDXGIAdapter1> select_adapter(bool warp)
{
    ComPtr<IDXGIFactory6> factory;
    check(CreateDXGIFactory2(0, IID_PPV_ARGS(&factory)), "Create DXGI factory");
    ComPtr<IDXGIAdapter1> adapter;
    if (warp) {
        check(factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter)), "Select WARP");
        return adapter;
    }
    wchar_t name[128]{};
    const DWORD size = GetEnvironmentVariableW(L"XBOX2WINDOWS_ADAPTER", name, 128);
    if (!size || size >= 128) throw std::runtime_error("Set XBOX2WINDOWS_ADAPTER to a GPU name");
    for (UINT index = 0; ; ++index) {
        HRESULT hr = factory->EnumAdapterByGpuPreference(index, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE,
                                                         IID_PPV_ARGS(&adapter));
        if (hr == DXGI_ERROR_NOT_FOUND) throw std::runtime_error("Named physical adapter not found");
        check(hr, "Enumerate adapter");
        DXGI_ADAPTER_DESC1 desc{};
        check(adapter->GetDesc1(&desc), "Read adapter description");
        if (!(desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) && std::wcsstr(desc.Description, name)) return adapter;
        adapter.Reset();
    }
}

static ComPtr<ID3D12Resource> make_resource(ID3D12Device* device, D3D12_HEAP_TYPE type,
    D3D12_RESOURCE_STATES state, UINT64 width, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
    D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE)
{
    const bool texture = format != DXGI_FORMAT_UNKNOWN;
    D3D12_HEAP_PROPERTIES heap{type, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1};
    D3D12_RESOURCE_DESC desc{};
    desc.Dimension = texture ? D3D12_RESOURCE_DIMENSION_TEXTURE2D : D3D12_RESOURCE_DIMENSION_BUFFER;
    desc.Width = width;
    desc.Height = texture ? 2 : 1;
    desc.DepthOrArraySize = desc.MipLevels = 1;
    desc.Format = format;
    desc.SampleDesc.Count = 1;
    desc.Layout = texture ? D3D12_TEXTURE_LAYOUT_UNKNOWN : D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
    desc.Flags = flags;
    ComPtr<ID3D12Resource> result;
    check(device->CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &desc, state, nullptr,
                                           IID_PPV_ARGS(&result)), "Create resource");
    return result;
}

static void transition(ID3D12GraphicsCommandList* list, ID3D12Resource* resource,
                       D3D12_RESOURCE_STATES from, D3D12_RESOURCE_STATES to)
{
    D3D12_RESOURCE_BARRIER barrier{};
    barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
    barrier.Transition = {resource, D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, from, to};
    list->ResourceBarrier(1, &barrier);
}

int main(int argc, char** argv)
try {
    if (argc != 3 || (std::strcmp(argv[1], "hardware") && std::strcmp(argv[1], "warp"))) {
        std::fprintf(stderr, "Usage: compare-readback hardware|warp shader.dxil\n");
        return 2;
    }
    ComPtr<ID3D12Debug> debug;
    if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug)))) debug->EnableDebugLayer();
    auto adapter = select_adapter(std::strcmp(argv[1], "warp") == 0);
    DXGI_ADAPTER_DESC1 desc{};
    LARGE_INTEGER driver{};
    check(adapter->GetDesc1(&desc), "Read adapter");
    check(adapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &driver), "Read driver");
    std::printf("backend=%s debug_layer=%s\n", argv[1], debug ? "enabled" : "unavailable");
    std::printf("adapter=%ls vendor=%04x device=%04x driver=%u.%u.%u.%u\n",
                desc.Description, desc.VendorId, desc.DeviceId, HIWORD(driver.HighPart), LOWORD(driver.HighPart),
                HIWORD(driver.LowPart), LOWORD(driver.LowPart));

    ComPtr<ID3D12Device> device;
    check(D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&device)), "Create D3D12 device");
    D3D12_FEATURE_DATA_SHADER_MODEL model{D3D_SHADER_MODEL_6_6};
    const HRESULT model_status = device->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &model, sizeof(model));
    if (FAILED(model_status) || model.HighestShaderModel < D3D_SHADER_MODEL_6_6) {
        std::printf("skip: cs_6_6 unavailable, model=0x%x status=0x%08lx\n", model.HighestShaderModel,
                    static_cast<unsigned long>(model_status));
        return 77;
    }

    D3D12_DESCRIPTOR_RANGE textures{D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 2, 0, 0, 0};
    D3D12_ROOT_PARAMETER parameters[2]{};
    parameters[0].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
    parameters[0].DescriptorTable = {1, &textures};
    parameters[1].ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
    parameters[1].Descriptor = {4, 0};
    D3D12_STATIC_SAMPLER_DESC samplers[2]{};
    for (UINT i = 0; i < 2; ++i) {
        auto& s = samplers[i];
        s.Filter = i == 0 ? D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_POINT;
        s.AddressU = s.AddressV = s.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
        s.MaxAnisotropy = 1;
        s.ComparisonFunc = i == 0 ? D3D12_COMPARISON_FUNC_LESS_EQUAL : D3D12_COMPARISON_FUNC_ALWAYS;
        s.MaxLOD = D3D12_FLOAT32_MAX;
        s.ShaderRegister = 2 + i;
    }
    D3D12_ROOT_SIGNATURE_DESC signature{2, parameters, 2, samplers, D3D12_ROOT_SIGNATURE_FLAG_NONE};
    ComPtr<ID3DBlob> blob;
    check(D3D12SerializeRootSignature(&signature, D3D_ROOT_SIGNATURE_VERSION_1, &blob, nullptr),
          "Serialize root signature");
    ComPtr<ID3D12RootSignature> root;
    check(device->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(&root)),
          "Create root signature");
    std::ifstream file(argv[2], std::ios::binary);
    if (!file) throw std::runtime_error("Open shader bytecode");
    const std::vector<char> shader(std::istreambuf_iterator<char>(file), {});
    D3D12_COMPUTE_PIPELINE_STATE_DESC pipeline_desc{};
    pipeline_desc.pRootSignature = root.Get();
    pipeline_desc.CS = {shader.data(), shader.size()};
    ComPtr<ID3D12PipelineState> pipeline;
    check(device->CreateComputePipelineState(&pipeline_desc, IID_PPV_ARGS(&pipeline)), "Create compute pipeline");

    constexpr UINT row_pitch = D3D12_TEXTURE_DATA_PITCH_ALIGNMENT;
    constexpr UINT texture_bytes = 2 * row_pitch;
    constexpr UINT sentinel = 0xc5c5c5c5;
    std::array<UINT, 16> initial{};
    initial.fill(sentinel);
    auto expected = initial;
    expected[0] = 0x3f800000;  // 0.25 <= 0.5
    expected[1] = 0x00000000;  // 0.75 > 0.5
    expected[2] = 0x3ec00000;  // ordinary top-left texel, 0.375
    auto upload = make_resource(device.Get(), D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_STATE_GENERIC_READ,
                                2 * texture_bytes + sizeof(initial));
    auto output = make_resource(device.Get(), D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_STATE_COPY_DEST,
                                sizeof(initial), DXGI_FORMAT_UNKNOWN, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS);
    auto readback = make_resource(device.Get(), D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_STATE_COPY_DEST,
                                  sizeof(initial));
    unsigned char* mapped = nullptr;
    D3D12_RANGE empty{};
    check(upload->Map(0, &empty, reinterpret_cast<void**>(&mapped)), "Map upload");
    const float texels[2][2][2] = {{{0.5f, 0.75f}, {0.25f, 1.0f}}, {{0.375f, 0.875f}, {0.625f, 0.125f}}};
    for (UINT i = 0; i < 2; ++i)
        for (UINT row = 0; row < 2; ++row)
            std::memcpy(mapped + i * texture_bytes + row * row_pitch, texels[i][row], sizeof(texels[i][row]));
    std::memcpy(mapped + 2 * texture_bytes, initial.data(), sizeof(initial));
    upload->Unmap(0, nullptr);

    D3D12_COMMAND_QUEUE_DESC queue_desc{D3D12_COMMAND_LIST_TYPE_DIRECT};
    ComPtr<ID3D12CommandQueue> queue;
    ComPtr<ID3D12CommandAllocator> allocator;
    ComPtr<ID3D12GraphicsCommandList> list;
    check(device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&queue)), "Create queue");
    check(device->CreateCommandAllocator(queue_desc.Type, IID_PPV_ARGS(&allocator)), "Create allocator");
    check(device->CreateCommandList(0, queue_desc.Type, allocator.Get(), pipeline.Get(), IID_PPV_ARGS(&list)),
          "Create command list");
    D3D12_DESCRIPTOR_HEAP_DESC heap_desc{D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 2,
                                       D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE};
    ComPtr<ID3D12DescriptorHeap> heap;
    check(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&heap)), "Create SRV descriptor heap");
    std::array<ComPtr<ID3D12Resource>, 2> inputs;
    auto cpu = heap->GetCPUDescriptorHandleForHeapStart();
    for (UINT i = 0; i < inputs.size(); ++i) {
        inputs[i] = make_resource(device.Get(), D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_STATE_COPY_DEST,
                                  2, DXGI_FORMAT_R32_FLOAT);
        D3D12_TEXTURE_COPY_LOCATION to{};
        to.pResource = inputs[i].Get();
        to.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
        D3D12_TEXTURE_COPY_LOCATION from{};
        from.pResource = upload.Get();
        from.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
        from.PlacedFootprint = {i * texture_bytes, {DXGI_FORMAT_R32_FLOAT, 2, 2, 1, row_pitch}};
        list->CopyTextureRegion(&to, 0, 0, 0, &from, nullptr);
        transition(list.Get(), inputs[i].Get(), D3D12_RESOURCE_STATE_COPY_DEST,
                   D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
        device->CreateShaderResourceView(inputs[i].Get(), nullptr, cpu);
        cpu.ptr += device->GetDescriptorHandleIncrementSize(heap_desc.Type);
    }
    list->CopyBufferRegion(output.Get(), 0, upload.Get(), 2 * texture_bytes, sizeof(initial));
    transition(list.Get(), output.Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
    ID3D12DescriptorHeap* heaps[] = {heap.Get()};
    list->SetDescriptorHeaps(1, heaps);
    list->SetComputeRootSignature(root.Get());
    list->SetComputeRootDescriptorTable(0, heap->GetGPUDescriptorHandleForHeapStart());
    list->SetComputeRootUnorderedAccessView(1, output->GetGPUVirtualAddress());
    list->Dispatch(1, 1, 1);
    transition(list.Get(), output.Get(), D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
    list->CopyBufferRegion(readback.Get(), 0, output.Get(), 0, sizeof(initial));
    check(list->Close(), "Close command list");
    ID3D12CommandList* lists[] = {list.Get()};
    queue->ExecuteCommandLists(1, lists);
    ComPtr<ID3D12Fence> fence;
    check(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence)), "Create fence");
    check(queue->Signal(fence.Get(), 1), "Signal fence");
    HANDLE event = CreateEventW(nullptr, FALSE, FALSE, nullptr);
    if (!event) throw std::runtime_error("Create fence event");
    const HRESULT wait_hr = fence->SetEventOnCompletion(1, event);
    const DWORD waited = SUCCEEDED(wait_hr) ? WaitForSingleObject(event, 15000) : WAIT_FAILED;
    CloseHandle(event);
    check(wait_hr, "Arm fence event");
    if (waited != WAIT_OBJECT_0) throw std::runtime_error("GPU fence wait failed or timed out");
    check(device->GetDeviceRemovedReason(), "Read device status");

    D3D12_RANGE read{0, sizeof(initial)};
    check(readback->Map(0, &read, reinterpret_cast<void**>(&mapped)), "Map readback");
    std::array<UINT, 16> actual{};
    std::memcpy(actual.data(), mapped, sizeof(actual));
    readback->Unmap(0, &empty);
    for (size_t i = 0; i < actual.size(); ++i) {
        if (actual[i] == expected[i]) continue;
        std::fprintf(stderr, "word=%zu expected=%08x actual=%08x\n", i, expected[i], actual[i]);
        return 1;
    }
    std::printf("outputs=%08x,%08x,%08x compared_words=16 mismatches=0\n", actual[0], actual[1], actual[2]);

    auto wrong = expected;
    wrong[1] = 0x3f800000;
    unsigned count = 0;
    for (size_t i = 0; i < actual.size(); ++i) {
        if (actual[i] == wrong[i]) continue;
        std::printf("stale-reference word=%zu expected=%08x actual=%08x\n", i, wrong[i], actual[i]);
        ++count;
    }
    std::printf("stale-reference compared_words=16 mismatches=%u\n", count);
    return count == 1 ? 0 : 1;
} catch (const std::exception& err) {
    std::fprintf(stderr, "%s\n", err.what());
    return 2;
}
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084072435 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084072435). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:03:24Z. --- GPU readback follow-up to the [compile-stage reproducer](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084034682). I dispatched its validated, cross-compiled separate-sampler shader using a standalone D3D12 host. AI-assisted, run locally. Windows 11 25H2 x64 `26200.9974`, Xbox2Windows checkout `edc2e54e7e75fcd7c0f13e98b47ba119d9a08268`, MSVC `19.44.35230`, SDK `10.0.26100`. Same SPIRV-Tools `v2025.5`, SPIRV-Cross `57e4efcc84112abcd426dc5ec248b5339bee04f2`, and DXC `1.8.2502.8` as above. Tested RX 9070 XT (`1002:7550`, driver `32.0.32029.2010`) and WARP (`1414:008c`, `10.0.26100.9818`). Both reported `debug_layer=unavailable`. One `cs_6_6` dispatch per backend. The host bound 2×2 `R32_FLOAT` SRVs at `t0`/`t1`, a point-clamp comparison sampler (`LESS_EQUAL`) at `s2`, a point-clamp ordinary sampler at `s3`, and a raw output buffer at `u4`. At UV `(0.25, 0.25)`, the shader compares references `0.25` and `0.75` against depth `0.5` and samples ordinary value `0.375`. Both backends returned `3f800000,00000000,3ec00000` (`1.0, 0.0, 0.375`), with all 13 guard words unchanged and zero mismatches or skips. Changing only the CPU reference at word 1 gave exactly one mismatch on each backend (`expected=3f800000 actual=00000000`). Reproduce from a directory containing `separate.dxil` generated by the earlier comment and the host source below saved as `compare-readback.cpp`: ```powershell cl /nologo /EHsc /std:c++17 /W4 /MT /Fecompare-readback.exe compare-readback.cpp /link d3d12.lib dxgi.lib $env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT' .\compare-readback.exe hardware separate.dxil .\compare-readback.exe warp separate.dxil ``` This verifies the GPU behavior of the separate-sampler control. The shared-sampler lowering and repository CTest integration are still open. <details> <summary>Standalone D3D12 readback host</summary> ```cpp #include <d3d12.h> #include <dxgi1_6.h> #include <wrl/client.h> #include <array> #include <cstdio> #include <cstring> #include <cwchar> #include <fstream> #include <iterator> #include <stdexcept> #include <vector> using Microsoft::WRL::ComPtr; static void check(HRESULT hr, const char* operation) { if (SUCCEEDED(hr)) return; std::fprintf(stderr, "%s failed (0x%08lx)\n", operation, static_cast<unsigned long>(hr)); throw std::runtime_error(operation); } static ComPtr<IDXGIAdapter1> select_adapter(bool warp) { ComPtr<IDXGIFactory6> factory; check(CreateDXGIFactory2(0, IID_PPV_ARGS(&factory)), "Create DXGI factory"); ComPtr<IDXGIAdapter1> adapter; if (warp) { check(factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter)), "Select WARP"); return adapter; } wchar_t name[128]{}; const DWORD size = GetEnvironmentVariableW(L"XBOX2WINDOWS_ADAPTER", name, 128); if (!size || size >= 128) throw std::runtime_error("Set XBOX2WINDOWS_ADAPTER to a GPU name"); for (UINT index = 0; ; ++index) { HRESULT hr = factory->EnumAdapterByGpuPreference(index, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, IID_PPV_ARGS(&adapter)); if (hr == DXGI_ERROR_NOT_FOUND) throw std::runtime_error("Named physical adapter not found"); check(hr, "Enumerate adapter"); DXGI_ADAPTER_DESC1 desc{}; check(adapter->GetDesc1(&desc), "Read adapter description"); if (!(desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) && std::wcsstr(desc.Description, name)) return adapter; adapter.Reset(); } } static ComPtr<ID3D12Resource> make_resource(ID3D12Device* device, D3D12_HEAP_TYPE type, D3D12_RESOURCE_STATES state, UINT64 width, DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE) { const bool texture = format != DXGI_FORMAT_UNKNOWN; D3D12_HEAP_PROPERTIES heap{type, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1}; D3D12_RESOURCE_DESC desc{}; desc.Dimension = texture ? D3D12_RESOURCE_DIMENSION_TEXTURE2D : D3D12_RESOURCE_DIMENSION_BUFFER; desc.Width = width; desc.Height = texture ? 2 : 1; desc.DepthOrArraySize = desc.MipLevels = 1; desc.Format = format; desc.SampleDesc.Count = 1; desc.Layout = texture ? D3D12_TEXTURE_LAYOUT_UNKNOWN : D3D12_TEXTURE_LAYOUT_ROW_MAJOR; desc.Flags = flags; ComPtr<ID3D12Resource> result; check(device->CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &desc, state, nullptr, IID_PPV_ARGS(&result)), "Create resource"); return result; } static void transition(ID3D12GraphicsCommandList* list, ID3D12Resource* resource, D3D12_RESOURCE_STATES from, D3D12_RESOURCE_STATES to) { D3D12_RESOURCE_BARRIER barrier{}; barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; barrier.Transition = {resource, D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, from, to}; list->ResourceBarrier(1, &barrier); } int main(int argc, char** argv) try { if (argc != 3 || (std::strcmp(argv[1], "hardware") && std::strcmp(argv[1], "warp"))) { std::fprintf(stderr, "Usage: compare-readback hardware|warp shader.dxil\n"); return 2; } ComPtr<ID3D12Debug> debug; if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug)))) debug->EnableDebugLayer(); auto adapter = select_adapter(std::strcmp(argv[1], "warp") == 0); DXGI_ADAPTER_DESC1 desc{}; LARGE_INTEGER driver{}; check(adapter->GetDesc1(&desc), "Read adapter"); check(adapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &driver), "Read driver"); std::printf("backend=%s debug_layer=%s\n", argv[1], debug ? "enabled" : "unavailable"); std::printf("adapter=%ls vendor=%04x device=%04x driver=%u.%u.%u.%u\n", desc.Description, desc.VendorId, desc.DeviceId, HIWORD(driver.HighPart), LOWORD(driver.HighPart), HIWORD(driver.LowPart), LOWORD(driver.LowPart)); ComPtr<ID3D12Device> device; check(D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&device)), "Create D3D12 device"); D3D12_FEATURE_DATA_SHADER_MODEL model{D3D_SHADER_MODEL_6_6}; const HRESULT model_status = device->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &model, sizeof(model)); if (FAILED(model_status) || model.HighestShaderModel < D3D_SHADER_MODEL_6_6) { std::printf("skip: cs_6_6 unavailable, model=0x%x status=0x%08lx\n", model.HighestShaderModel, static_cast<unsigned long>(model_status)); return 77; } D3D12_DESCRIPTOR_RANGE textures{D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 2, 0, 0, 0}; D3D12_ROOT_PARAMETER parameters[2]{}; parameters[0].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; parameters[0].DescriptorTable = {1, &textures}; parameters[1].ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV; parameters[1].Descriptor = {4, 0}; D3D12_STATIC_SAMPLER_DESC samplers[2]{}; for (UINT i = 0; i < 2; ++i) { auto& s = samplers[i]; s.Filter = i == 0 ? D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_POINT; s.AddressU = s.AddressV = s.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; s.MaxAnisotropy = 1; s.ComparisonFunc = i == 0 ? D3D12_COMPARISON_FUNC_LESS_EQUAL : D3D12_COMPARISON_FUNC_ALWAYS; s.MaxLOD = D3D12_FLOAT32_MAX; s.ShaderRegister = 2 + i; } D3D12_ROOT_SIGNATURE_DESC signature{2, parameters, 2, samplers, D3D12_ROOT_SIGNATURE_FLAG_NONE}; ComPtr<ID3DBlob> blob; check(D3D12SerializeRootSignature(&signature, D3D_ROOT_SIGNATURE_VERSION_1, &blob, nullptr), "Serialize root signature"); ComPtr<ID3D12RootSignature> root; check(device->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(&root)), "Create root signature"); std::ifstream file(argv[2], std::ios::binary); if (!file) throw std::runtime_error("Open shader bytecode"); const std::vector<char> shader(std::istreambuf_iterator<char>(file), {}); D3D12_COMPUTE_PIPELINE_STATE_DESC pipeline_desc{}; pipeline_desc.pRootSignature = root.Get(); pipeline_desc.CS = {shader.data(), shader.size()}; ComPtr<ID3D12PipelineState> pipeline; check(device->CreateComputePipelineState(&pipeline_desc, IID_PPV_ARGS(&pipeline)), "Create compute pipeline"); constexpr UINT row_pitch = D3D12_TEXTURE_DATA_PITCH_ALIGNMENT; constexpr UINT texture_bytes = 2 * row_pitch; constexpr UINT sentinel = 0xc5c5c5c5; std::array<UINT, 16> initial{}; initial.fill(sentinel); auto expected = initial; expected[0] = 0x3f800000; // 0.25 <= 0.5 expected[1] = 0x00000000; // 0.75 > 0.5 expected[2] = 0x3ec00000; // ordinary top-left texel, 0.375 auto upload = make_resource(device.Get(), D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_STATE_GENERIC_READ, 2 * texture_bytes + sizeof(initial)); auto output = make_resource(device.Get(), D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_STATE_COPY_DEST, sizeof(initial), DXGI_FORMAT_UNKNOWN, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS); auto readback = make_resource(device.Get(), D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_STATE_COPY_DEST, sizeof(initial)); unsigned char* mapped = nullptr; D3D12_RANGE empty{}; check(upload->Map(0, &empty, reinterpret_cast<void**>(&mapped)), "Map upload"); const float texels[2][2][2] = {{{0.5f, 0.75f}, {0.25f, 1.0f}}, {{0.375f, 0.875f}, {0.625f, 0.125f}}}; for (UINT i = 0; i < 2; ++i) for (UINT row = 0; row < 2; ++row) std::memcpy(mapped + i * texture_bytes + row * row_pitch, texels[i][row], sizeof(texels[i][row])); std::memcpy(mapped + 2 * texture_bytes, initial.data(), sizeof(initial)); upload->Unmap(0, nullptr); D3D12_COMMAND_QUEUE_DESC queue_desc{D3D12_COMMAND_LIST_TYPE_DIRECT}; ComPtr<ID3D12CommandQueue> queue; ComPtr<ID3D12CommandAllocator> allocator; ComPtr<ID3D12GraphicsCommandList> list; check(device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&queue)), "Create queue"); check(device->CreateCommandAllocator(queue_desc.Type, IID_PPV_ARGS(&allocator)), "Create allocator"); check(device->CreateCommandList(0, queue_desc.Type, allocator.Get(), pipeline.Get(), IID_PPV_ARGS(&list)), "Create command list"); D3D12_DESCRIPTOR_HEAP_DESC heap_desc{D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 2, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE}; ComPtr<ID3D12DescriptorHeap> heap; check(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&heap)), "Create SRV descriptor heap"); std::array<ComPtr<ID3D12Resource>, 2> inputs; auto cpu = heap->GetCPUDescriptorHandleForHeapStart(); for (UINT i = 0; i < inputs.size(); ++i) { inputs[i] = make_resource(device.Get(), D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_STATE_COPY_DEST, 2, DXGI_FORMAT_R32_FLOAT); D3D12_TEXTURE_COPY_LOCATION to{}; to.pResource = inputs[i].Get(); to.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; D3D12_TEXTURE_COPY_LOCATION from{}; from.pResource = upload.Get(); from.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; from.PlacedFootprint = {i * texture_bytes, {DXGI_FORMAT_R32_FLOAT, 2, 2, 1, row_pitch}}; list->CopyTextureRegion(&to, 0, 0, 0, &from, nullptr); transition(list.Get(), inputs[i].Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE); device->CreateShaderResourceView(inputs[i].Get(), nullptr, cpu); cpu.ptr += device->GetDescriptorHandleIncrementSize(heap_desc.Type); } list->CopyBufferRegion(output.Get(), 0, upload.Get(), 2 * texture_bytes, sizeof(initial)); transition(list.Get(), output.Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS); ID3D12DescriptorHeap* heaps[] = {heap.Get()}; list->SetDescriptorHeaps(1, heaps); list->SetComputeRootSignature(root.Get()); list->SetComputeRootDescriptorTable(0, heap->GetGPUDescriptorHandleForHeapStart()); list->SetComputeRootUnorderedAccessView(1, output->GetGPUVirtualAddress()); list->Dispatch(1, 1, 1); transition(list.Get(), output.Get(), D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE); list->CopyBufferRegion(readback.Get(), 0, output.Get(), 0, sizeof(initial)); check(list->Close(), "Close command list"); ID3D12CommandList* lists[] = {list.Get()}; queue->ExecuteCommandLists(1, lists); ComPtr<ID3D12Fence> fence; check(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence)), "Create fence"); check(queue->Signal(fence.Get(), 1), "Signal fence"); HANDLE event = CreateEventW(nullptr, FALSE, FALSE, nullptr); if (!event) throw std::runtime_error("Create fence event"); const HRESULT wait_hr = fence->SetEventOnCompletion(1, event); const DWORD waited = SUCCEEDED(wait_hr) ? WaitForSingleObject(event, 15000) : WAIT_FAILED; CloseHandle(event); check(wait_hr, "Arm fence event"); if (waited != WAIT_OBJECT_0) throw std::runtime_error("GPU fence wait failed or timed out"); check(device->GetDeviceRemovedReason(), "Read device status"); D3D12_RANGE read{0, sizeof(initial)}; check(readback->Map(0, &read, reinterpret_cast<void**>(&mapped)), "Map readback"); std::array<UINT, 16> actual{}; std::memcpy(actual.data(), mapped, sizeof(actual)); readback->Unmap(0, &empty); for (size_t i = 0; i < actual.size(); ++i) { if (actual[i] == expected[i]) continue; std::fprintf(stderr, "word=%zu expected=%08x actual=%08x\n", i, expected[i], actual[i]); return 1; } std::printf("outputs=%08x,%08x,%08x compared_words=16 mismatches=0\n", actual[0], actual[1], actual[2]); auto wrong = expected; wrong[1] = 0x3f800000; unsigned count = 0; for (size_t i = 0; i < actual.size(); ++i) { if (actual[i] == wrong[i]) continue; std::printf("stale-reference word=%zu expected=%08x actual=%08x\n", i, wrong[i], actual[i]); ++count; } std::printf("stale-reference compared_words=16 mismatches=%u\n", count); return count == 1 ? 0 : 1; } catch (const std::exception& err) { std::fprintf(stderr, "%s\n", err.what()); return 2; } ``` </details>
rwZephyr commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:06:34Z.


Sampler-split prototype follow-up. Starting from shared.spvasm in the compile-stage reproducer, the prototype adds an ordinary sampler at set 0 binding 5, leaves the comparison sampler at binding 2, and redirects only the ordinary OpSampledImage to the new sampler. The host takes the two slots as separate binding kinds. This is an opt-in scratch pass for the direct, non-array Texture2D<float> compute profile with literal LOD 0.

The transformed SPIR-V passed Vulkan 1.2 validation. Pinned SPIRV-Cross emitted SampleCmpLevelZero with s2 and SampleLevel with s5. DXC compiled the result as cs_6_6. On the RX 9070 XT and WARP, both comparison outputs and the ordinary sample were [1.0, 0.0, 0.375], with all 13 guards exact. The wrong reference failed only at word 1 (expected=3f800000 actual=00000000). An occupied binding and a nonzero comparison LOD were rejected. The already-separated input was preserved, and the four existing address-window/ballot hardware and WARP CTests passed with zero skips.

Run locally on Windows 11 25H2 x64 26200.9974 at Xbox2Windows edc2e54e7e75fcd7c0f13e98b47ba119d9a08268. MSVC 19.44.35230, SDK 10.0.26100, Python 3.12.10, SPIRV-Tools v2025.5, SPIRV-Cross 57e4efcc84112abcd426dc5ec248b5339bee04f2, DXC 1.8.2502.8. RX 9070 XT 1002:7550 driver 32.0.32029.2010, WARP 1414:008c driver 10.0.26100.9818. Debug layer unavailable on both. AI-assisted.

Save the prototype below as split_sampler.py. For the previous standalone host, change s.ShaderRegister = 2 + i; to s.ShaderRegister = i == 0 ? 2 : 5; for this run.

python -B split_sampler.py shared.spvasm lowered.spvasm --ordinary-binding 5
spirv-as --target-env vulkan1.2 lowered.spvasm -o lowered.spv
spirv-val --target-env vulkan1.2 lowered.spv
spirv-cross lowered.spv --hlsl --shader-model 66 --output lowered.hlsl
dxc -T cs_6_6 -E main -Fo lowered.dxil lowered.hlsl
cl /nologo /EHsc /std:c++17 /W4 /MT /Felowered-readback.exe compare-readback.cpp /link d3d12.lib dxgi.lib
$env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT'
.\lowered-readback.exe hardware lowered.dxil
.\lowered-readback.exe warp lowered.dxil
ctest --preset dev --no-tests=error -R '^spirv_(address_window|ballot_extract)_(hardware|warp)$'

Repository integration still needs agreement on who allocates the extra sampler slot and how the bridge passes it to the host. This run covers the source-built profile only.

SPIR-V sampler-split prototype
"""Prototype a sampler split for direct, named compute SPIR-V sampling at LOD 0."""
import argparse
from collections import defaultdict
from pathlib import Path
import shlex


def tokens(line):
    lexer = shlex.shlex(line, posix=False)
    lexer.commenters = ";"
    lexer.whitespace_split = True
    return list(lexer)


def split_sampler(assembly, ordinary_binding):
    lines = assembly.splitlines()
    parsed = [tokens(line) for line in lines]
    definitions = {words[0]: words[2:] for words in parsed if len(words) >= 3 and words[1] == "="}
    definitions_at = {words[0]: i for i, words in enumerate(parsed) if len(words) >= 3 and words[1] == "="}
    entries = [i for i, words in enumerate(parsed) if words[:1] == ["OpEntryPoint"]]
    if len(entries) != 1 or parsed[entries[0]][1] != "GLCompute":
        raise ValueError("Expected a single compute entry point")
    entry = entries[0]

    bindings = {}
    descriptor_sets = {}
    for i, words in enumerate(parsed):
        if len(words) != 4 or words[0] != "OpDecorate":
            continue
        if words[2] == "Binding":
            bindings[words[1]] = (i, int(words[3], 0))
        if words[2] == "DescriptorSet":
            descriptor_sets[words[1]] = int(words[3], 0)

    image_uses = defaultdict(list)
    for words in parsed:
        args = words[2:] if len(words) >= 3 and words[1] == "=" else words
        if args and args[0] not in {"OpName", "OpDecorate"}:
            for operand in args[1:]:
                if definitions.get(operand, [])[:1] == ["OpSampledImage"]:
                    image_uses[operand].append(args)

    kinds_by_sampler = defaultdict(set)
    ordinary_images = defaultdict(list)
    for image, definition in definitions.items():
        if definition[:1] != ["OpSampledImage"]:
            continue
        _, sampled_type, _, loaded_sampler = definition
        load = definitions.get(loaded_sampler, [])
        if len(load) != 3 or load[0] != "OpLoad":
            raise ValueError("Expected a direct sampler load")
        _, sampler_type, sampler = load
        var = definitions.get(sampler, [])
        if (len(var) != 3 or var[0] != "OpVariable" or var[2] != "UniformConstant"
                or definitions.get(var[1]) != ["OpTypePointer", "UniformConstant", sampler_type]
                or definitions.get(sampler_type) != ["OpTypeSampler"]):
            raise ValueError("Expected a standalone UniformConstant sampler")

        sampled = definitions.get(sampled_type, [])
        texture = definitions.get(sampled[1], []) if len(sampled) == 2 and sampled[0] == "OpTypeSampledImage" else []
        if (len(texture) != 8 or texture[0] != "OpTypeImage"
                or definitions.get(texture[1]) != ["OpTypeFloat", "32"]
                or texture[2] != "2D" or texture[4:] != ["0", "0", "1", "Unknown"]):
            raise ValueError("Only non-array float32 Texture2D sampling is supported")

        kinds = set()
        for use in image_uses[image]:
            ordinary = use[0] == "OpImageSampleExplicitLod" and len(use) == 6
            compare = use[0] == "OpImageSampleDrefExplicitLod" and len(use) == 7
            lod = definitions.get(use[-1], [])
            if (not (ordinary or compare) or use[2] != image or use[-2] != "Lod"
                    or len(lod) != 3 or lod[:2] != ["OpConstant", texture[1]]
                    or lod[2] not in {"0", "0.0", "0x0p+0"}):
                raise ValueError("Only ordinary and depth-reference explicit LOD 0 are supported")
            kinds.add("ordinary" if ordinary else "compare")
        if len(kinds) != 1:
            raise ValueError("Each sampled image must have exactly one sampler kind")
        kinds_by_sampler[sampler].update(kinds)
        if kinds == {"ordinary"}:
            ordinary_images[sampler].append((image, sampler_type))

    mixed = [sampler for sampler, kinds in kinds_by_sampler.items() if len(kinds) == 2]
    if not mixed:
        return assembly, None
    if len(mixed) != 1:
        raise ValueError("Expected one sampler with mixed uses")
    sampler = mixed[0]
    if sampler not in parsed[entry][4:] or sampler not in bindings or sampler not in descriptor_sets:
        raise ValueError("Require the sampler's entry-point interface, descriptor set and binding")
    binding_line, comparison_binding = bindings[sampler]
    descriptor_set = descriptor_sets[sampler]
    if any(descriptor_sets.get(var) == descriptor_set and slot == ordinary_binding
           for var, (_, slot) in bindings.items()):
        raise ValueError(f"Requested ordinary binding {ordinary_binding} is occupied in set {descriptor_set}")

    prefix = "%x2w_plain_sampler"
    if any(word.startswith(prefix) for words in parsed for word in words):
        raise ValueError("Reserved sampler split IDs are already in use")
    lines[entry] = " ".join([*parsed[entry], prefix])
    lines[binding_line] += (f"\nOpDecorate {prefix} DescriptorSet {descriptor_set}"
                            f"\nOpDecorate {prefix} Binding {ordinary_binding}")
    lines[definitions_at[sampler]] += f"\n{prefix} = OpVariable {definitions[sampler][1]} UniformConstant"
    for index, (image, sampler_type) in enumerate(ordinary_images[sampler]):
        i = definitions_at[image]
        load = f"{prefix}_{index}"
        lines[i] = f"{load} = OpLoad {sampler_type} {prefix}\n" + " ".join([*parsed[i][:-1], load])
    return "\n".join(lines) + "\n", (descriptor_set, comparison_binding, ordinary_binding)


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("input", type=Path)
    parser.add_argument("output", type=Path)
    parser.add_argument("--ordinary-binding", type=int, required=True)
    args = parser.parse_args()
    if args.ordinary_binding < 0:
        parser.error("--ordinary-binding must be nonnegative")
    try:
        assembly, bindings = split_sampler(args.input.read_text(), args.ordinary_binding)
    except ValueError as error:
        parser.error(str(error))
    args.output.write_text(assembly, encoding="ascii", newline="\n")
    if bindings:
        descriptor_set, comparison, ordinary = bindings
        print(f"descriptor_set={descriptor_set} comparison_binding={comparison} ordinary_binding={ordinary}")
    else:
        print("No mixed sampler use found")


if __name__ == "__main__":
    main()
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084115150 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084115150). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:06:34Z. --- Sampler-split prototype follow-up. Starting from `shared.spvasm` in the [compile-stage reproducer](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084034682), the prototype adds an ordinary sampler at set 0 binding 5, leaves the comparison sampler at binding 2, and redirects only the ordinary `OpSampledImage` to the new sampler. The host takes the two slots as separate binding kinds. This is an opt-in scratch pass for the direct, non-array `Texture2D<float>` compute profile with literal LOD 0. The transformed SPIR-V passed Vulkan 1.2 validation. Pinned SPIRV-Cross emitted `SampleCmpLevelZero` with `s2` and `SampleLevel` with `s5`. DXC compiled the result as `cs_6_6`. On the RX 9070 XT and WARP, both comparison outputs and the ordinary sample were `[1.0, 0.0, 0.375]`, with all 13 guards exact. The wrong reference failed only at word 1 (`expected=3f800000 actual=00000000`). An occupied binding and a nonzero comparison LOD were rejected. The already-separated input was preserved, and the four existing address-window/ballot hardware and WARP CTests passed with zero skips. Run locally on Windows 11 25H2 x64 `26200.9974` at Xbox2Windows `edc2e54e7e75fcd7c0f13e98b47ba119d9a08268`. MSVC `19.44.35230`, SDK `10.0.26100`, Python `3.12.10`, SPIRV-Tools `v2025.5`, SPIRV-Cross `57e4efcc84112abcd426dc5ec248b5339bee04f2`, DXC `1.8.2502.8`. RX 9070 XT `1002:7550` driver `32.0.32029.2010`, WARP `1414:008c` driver `10.0.26100.9818`. Debug layer unavailable on both. AI-assisted. Save the prototype below as `split_sampler.py`. For the [previous standalone host](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084072435), change `s.ShaderRegister = 2 + i;` to `s.ShaderRegister = i == 0 ? 2 : 5;` for this run. ```powershell python -B split_sampler.py shared.spvasm lowered.spvasm --ordinary-binding 5 spirv-as --target-env vulkan1.2 lowered.spvasm -o lowered.spv spirv-val --target-env vulkan1.2 lowered.spv spirv-cross lowered.spv --hlsl --shader-model 66 --output lowered.hlsl dxc -T cs_6_6 -E main -Fo lowered.dxil lowered.hlsl cl /nologo /EHsc /std:c++17 /W4 /MT /Felowered-readback.exe compare-readback.cpp /link d3d12.lib dxgi.lib $env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT' .\lowered-readback.exe hardware lowered.dxil .\lowered-readback.exe warp lowered.dxil ctest --preset dev --no-tests=error -R '^spirv_(address_window|ballot_extract)_(hardware|warp)$' ``` Repository integration still needs agreement on who allocates the extra sampler slot and how the bridge passes it to the host. This run covers the source-built profile only. <details> <summary>SPIR-V sampler-split prototype</summary> ```python """Prototype a sampler split for direct, named compute SPIR-V sampling at LOD 0.""" import argparse from collections import defaultdict from pathlib import Path import shlex def tokens(line): lexer = shlex.shlex(line, posix=False) lexer.commenters = ";" lexer.whitespace_split = True return list(lexer) def split_sampler(assembly, ordinary_binding): lines = assembly.splitlines() parsed = [tokens(line) for line in lines] definitions = {words[0]: words[2:] for words in parsed if len(words) >= 3 and words[1] == "="} definitions_at = {words[0]: i for i, words in enumerate(parsed) if len(words) >= 3 and words[1] == "="} entries = [i for i, words in enumerate(parsed) if words[:1] == ["OpEntryPoint"]] if len(entries) != 1 or parsed[entries[0]][1] != "GLCompute": raise ValueError("Expected a single compute entry point") entry = entries[0] bindings = {} descriptor_sets = {} for i, words in enumerate(parsed): if len(words) != 4 or words[0] != "OpDecorate": continue if words[2] == "Binding": bindings[words[1]] = (i, int(words[3], 0)) if words[2] == "DescriptorSet": descriptor_sets[words[1]] = int(words[3], 0) image_uses = defaultdict(list) for words in parsed: args = words[2:] if len(words) >= 3 and words[1] == "=" else words if args and args[0] not in {"OpName", "OpDecorate"}: for operand in args[1:]: if definitions.get(operand, [])[:1] == ["OpSampledImage"]: image_uses[operand].append(args) kinds_by_sampler = defaultdict(set) ordinary_images = defaultdict(list) for image, definition in definitions.items(): if definition[:1] != ["OpSampledImage"]: continue _, sampled_type, _, loaded_sampler = definition load = definitions.get(loaded_sampler, []) if len(load) != 3 or load[0] != "OpLoad": raise ValueError("Expected a direct sampler load") _, sampler_type, sampler = load var = definitions.get(sampler, []) if (len(var) != 3 or var[0] != "OpVariable" or var[2] != "UniformConstant" or definitions.get(var[1]) != ["OpTypePointer", "UniformConstant", sampler_type] or definitions.get(sampler_type) != ["OpTypeSampler"]): raise ValueError("Expected a standalone UniformConstant sampler") sampled = definitions.get(sampled_type, []) texture = definitions.get(sampled[1], []) if len(sampled) == 2 and sampled[0] == "OpTypeSampledImage" else [] if (len(texture) != 8 or texture[0] != "OpTypeImage" or definitions.get(texture[1]) != ["OpTypeFloat", "32"] or texture[2] != "2D" or texture[4:] != ["0", "0", "1", "Unknown"]): raise ValueError("Only non-array float32 Texture2D sampling is supported") kinds = set() for use in image_uses[image]: ordinary = use[0] == "OpImageSampleExplicitLod" and len(use) == 6 compare = use[0] == "OpImageSampleDrefExplicitLod" and len(use) == 7 lod = definitions.get(use[-1], []) if (not (ordinary or compare) or use[2] != image or use[-2] != "Lod" or len(lod) != 3 or lod[:2] != ["OpConstant", texture[1]] or lod[2] not in {"0", "0.0", "0x0p+0"}): raise ValueError("Only ordinary and depth-reference explicit LOD 0 are supported") kinds.add("ordinary" if ordinary else "compare") if len(kinds) != 1: raise ValueError("Each sampled image must have exactly one sampler kind") kinds_by_sampler[sampler].update(kinds) if kinds == {"ordinary"}: ordinary_images[sampler].append((image, sampler_type)) mixed = [sampler for sampler, kinds in kinds_by_sampler.items() if len(kinds) == 2] if not mixed: return assembly, None if len(mixed) != 1: raise ValueError("Expected one sampler with mixed uses") sampler = mixed[0] if sampler not in parsed[entry][4:] or sampler not in bindings or sampler not in descriptor_sets: raise ValueError("Require the sampler's entry-point interface, descriptor set and binding") binding_line, comparison_binding = bindings[sampler] descriptor_set = descriptor_sets[sampler] if any(descriptor_sets.get(var) == descriptor_set and slot == ordinary_binding for var, (_, slot) in bindings.items()): raise ValueError(f"Requested ordinary binding {ordinary_binding} is occupied in set {descriptor_set}") prefix = "%x2w_plain_sampler" if any(word.startswith(prefix) for words in parsed for word in words): raise ValueError("Reserved sampler split IDs are already in use") lines[entry] = " ".join([*parsed[entry], prefix]) lines[binding_line] += (f"\nOpDecorate {prefix} DescriptorSet {descriptor_set}" f"\nOpDecorate {prefix} Binding {ordinary_binding}") lines[definitions_at[sampler]] += f"\n{prefix} = OpVariable {definitions[sampler][1]} UniformConstant" for index, (image, sampler_type) in enumerate(ordinary_images[sampler]): i = definitions_at[image] load = f"{prefix}_{index}" lines[i] = f"{load} = OpLoad {sampler_type} {prefix}\n" + " ".join([*parsed[i][:-1], load]) return "\n".join(lines) + "\n", (descriptor_set, comparison_binding, ordinary_binding) def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("input", type=Path) parser.add_argument("output", type=Path) parser.add_argument("--ordinary-binding", type=int, required=True) args = parser.parse_args() if args.ordinary_binding < 0: parser.error("--ordinary-binding must be nonnegative") try: assembly, bindings = split_sampler(args.input.read_text(), args.ordinary_binding) except ValueError as error: parser.error(str(error)) args.output.write_text(assembly, encoding="ascii", newline="\n") if bindings: descriptor_set, comparison, ordinary = bindings print(f"descriptor_set={descriptor_set} comparison_binding={comparison} ordinary_binding={ordinary}") else: print("No mixed sampler use found") if __name__ == "__main__": main() ``` </details>
rwZephyr commented 2026-11-24 06:48:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:17:22Z.


Proposed interface for the sampler split: host-reserved ordinary-sampler slot

Following up on the prototype in https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084115150, which left open who allocates the extra sampler slot. I'd like to claim the lowering and binding change, and I'm checking the interface first, as the issue asks.

Proposal. The host reserves a free ordinary-sampler slot and passes it explicitly to the lowering pass. The pass does not choose a slot itself.

  • Input: the SPIR-V module plus (descriptor set, ordinary binding) supplied by the host. The prototype exposes this as --ordinary-binding N.
  • The comparison sampler keeps its original set and binding (set 0, binding 2 in the fixture). Only the ordinary OpImageSampleExplicitLod uses are redirected to a new UniformConstant sampler at the supplied binding, in the same descriptor set.
  • The pass reports descriptor_set, comparison_binding and ordinary_binding so the host can bind an ordinary D3D12_SAMPLER_DESC and a comparison one in separate slots.
  • The pass fails rather than guessing when the supplied binding is already occupied in that set, when it finds more than one sampler with mixed uses, or when a use falls outside the scope below.
  • A module with no mixed sampler use passes through unchanged.

Scope. Direct, non-array Texture2D<float> sampling in compute, at literal LOD 0 only: OpImageSampleExplicitLod and OpImageSampleDrefExplicitLod with a constant zero Lod, from a standalone UniformConstant sampler declared in the entry-point interface. Arrays, other formats, non-constant or nonzero LOD, graphics stages and sampler kinds reached through function parameters are rejected and stay out of scope.

Question. Does a host-supplied slot fit the bridge's binding contract? If the bridge should own allocation instead, for example by taking the lowest free binding in the set or by using a fixed reserved range, I'll follow that. If the slot should be recorded in the named bridge profile rather than passed as an argument, I'll do it that way.

If agreed, the PR would add:

  • the lowering pass behind that interface, opt-in, with no change to modules without mixed sampler use;
  • one CTest that starts from the shared-sampler fixture, validates the transformed SPIR-V (Vulkan 1.2), cross-compiles to HLSL, compiles DXIL cs_6_6, and dispatches on WARP and a physical adapter. It checks the three outputs [1.0, 0.0, 0.375], all 13 guard words, and a wrong-reference control that must fail at exactly word 1. The hardware leg returns 77 when no capable adapter is present;
  • negative cases for an occupied binding and a nonzero comparison LOD;
  • the existing address-window and ballot bridge CTests, rerun unchanged.

What this covers. These results are from the public source-built fixture only. I have not measured the effect on the 807-record compute cohort from https://github.com/R0Y00/Xbox2Windows/pull/656#issuecomment-7084115192; the maintainer can rerun that cohort after integration. The separate CS package WARP readback discrepancy in that comment is unrelated to this change and remains open. This does not touch #671 or #560.

AI-assisted. Prepared with an AI coding assistant; all commands were run locally on Windows 11 with an RX 9070 XT and WARP.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084271313 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084271313). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:17:22Z. --- **Proposed interface for the sampler split: host-reserved ordinary-sampler slot** Following up on the prototype in https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084115150, which left open who allocates the extra sampler slot. I'd like to claim the lowering and binding change, and I'm checking the interface first, as the issue asks. **Proposal.** The host reserves a free ordinary-sampler slot and passes it explicitly to the lowering pass. The pass does not choose a slot itself. - Input: the SPIR-V module plus `(descriptor set, ordinary binding)` supplied by the host. The prototype exposes this as `--ordinary-binding N`. - The comparison sampler keeps its original set and binding (set 0, binding 2 in the fixture). Only the ordinary `OpImageSampleExplicitLod` uses are redirected to a new `UniformConstant` sampler at the supplied binding, in the same descriptor set. - The pass reports `descriptor_set`, `comparison_binding` and `ordinary_binding` so the host can bind an ordinary `D3D12_SAMPLER_DESC` and a comparison one in separate slots. - The pass fails rather than guessing when the supplied binding is already occupied in that set, when it finds more than one sampler with mixed uses, or when a use falls outside the scope below. - A module with no mixed sampler use passes through unchanged. **Scope.** Direct, non-array `Texture2D<float>` sampling in compute, at literal LOD 0 only: `OpImageSampleExplicitLod` and `OpImageSampleDrefExplicitLod` with a constant zero `Lod`, from a standalone `UniformConstant` sampler declared in the entry-point interface. Arrays, other formats, non-constant or nonzero LOD, graphics stages and sampler kinds reached through function parameters are rejected and stay out of scope. **Question.** Does a host-supplied slot fit the bridge's binding contract? If the bridge should own allocation instead, for example by taking the lowest free binding in the set or by using a fixed reserved range, I'll follow that. If the slot should be recorded in the named bridge profile rather than passed as an argument, I'll do it that way. **If agreed, the PR would add:** - the lowering pass behind that interface, opt-in, with no change to modules without mixed sampler use; - one CTest that starts from the shared-sampler fixture, validates the transformed SPIR-V (Vulkan 1.2), cross-compiles to HLSL, compiles DXIL `cs_6_6`, and dispatches on WARP and a physical adapter. It checks the three outputs `[1.0, 0.0, 0.375]`, all 13 guard words, and a wrong-reference control that must fail at exactly word 1. The hardware leg returns 77 when no capable adapter is present; - negative cases for an occupied binding and a nonzero comparison LOD; - the existing address-window and ballot bridge CTests, rerun unchanged. **What this covers.** These results are from the public source-built fixture only. I have not measured the effect on the 807-record compute cohort from https://github.com/R0Y00/Xbox2Windows/pull/656#issuecomment-7084115192; the maintainer can rerun that cohort after integration. The separate CS package WARP readback discrepancy in that comment is unrelated to this change and remains open. This does not touch #671 or #560. _AI-assisted. Prepared with an AI coding assistant; all commands were run locally on Windows 11 with an RX 9070 XT and WARP._
R0Y00 commented 2026-11-24 06:48:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T19:21:17Z.


The host-reserved binding is the right boundary for this opt-in profile. Please proceed with a focused PR from the shared-sampler reproducer. Keep the original comparison binding and require the caller to supply a free ordinary-sampler binding in the same descriptor set. Emit the binding mapping for the host and keep modules outside this profile on the existing path.

For the first PR, keep the tested scope to direct, non-array Texture2D<float> compute sampling with literal LOD zero. Include the occupied binding, nonzero comparison LOD, and already-separated controls from your prototype. Register the source-built compile and readback checks with the existing bridge fixtures. Link the failing DXC diagnostic and your WARP/RX 9070 XT results so the implementation can be reviewed independently. The 807-record rescan can follow once the public fixture is in place.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084324877 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7084324877). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T19:21:17Z. --- The host-reserved binding is the right boundary for this opt-in profile. Please proceed with a focused PR from the shared-sampler reproducer. Keep the original comparison binding and require the caller to supply a free ordinary-sampler binding in the same descriptor set. Emit the binding mapping for the host and keep modules outside this profile on the existing path. For the first PR, keep the tested scope to direct, non-array `Texture2D<float>` compute sampling with literal LOD zero. Include the occupied binding, nonzero comparison LOD, and already-separated controls from your prototype. Register the source-built compile and readback checks with the existing bridge fixtures. Link the failing DXC diagnostic and your WARP/RX 9070 XT results so the implementation can be reviewed independently. The 807-record rescan can follow once the public fixture is in place.
R0Y00 commented 2026-11-24 06:48:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T21:58:45Z.


The scoped bridge implementation merged in #681. At 6f620f7 the source-built fixture passed all eight SPIR-V tests across WARP and RX 9070 XT. The same fixture demonstrates the unsplit DXC failure, valid SPIR-V and DXIL after the split, ordinary and comparison readbacks, and wrong-reference and descriptor controls. Closing the focused implementation as complete. The 807-record fixed-profile rescan remains a separate measurement and has no new result here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7086457242 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/670#issuecomment-7086457242). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T21:58:45Z. --- The scoped bridge implementation merged in #681. At 6f620f7 the source-built fixture passed all eight SPIR-V tests across WARP and RX 9070 XT. The same fixture demonstrates the unsplit DXC failure, valid SPIR-V and DXIL after the split, ordinary and comparison readbacks, and wrong-reference and descriptor controls. Closing the focused implementation as complete. The 807-record fixed-profile rescan remains a separate measurement and has no new result here.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#664
No description provided.