Skip to content

d3d12: Device loss due to invalid usage of CreateShaderResourceView #5097

@nical

Description

@nical

Description
A clear and concise description of what the bug is.

Repro steps

The following triggers a device loss in Firefox:

<script>
document.addEventListener("DOMContentLoaded", async () => {
    const adpt = await self.navigator.gpu.requestAdapter({})
    const dev = await adpt.requestDevice({})
    const tex = dev.createTexture({
        "size": {"width": 88},
        "format": "stencil8",
        "usage": GPUTextureUsage.TEXTURE_BINDING
    })
    tex.createView()
    dev.createSampler({})
})
</script>

Log:

D3D12 ERROR: ID3D12Device::CreateShaderResourceView: The Plane Slice 0 cannot be used when the resource format is R24G8_TYPELESS and the view format is X24_TYPELESS_G8_UINT.  See documentation for the set of valid view format names for this resource format, determining which how the resource (or part of it) will appear to shader. [ STATE_CREATION ERROR #29: CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE]
D3D12: Removing Device.
D3D12 ERROR: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_INVALID_CALL: There is strong evidence that the application has performed an illegal or undefined operation, and such a condition could not be returned to the application cleanly through a return code). [ EXECUTION ERROR #232: DEVICE_REMOVAL_PROCESS_AT_FAULT]
Exception thrown at 0x00007FFA9C07CF19 in firefox.exe: Microsoft C++ exception: _com_error at memory location 0x0000001DE87F9A80.
Exception thrown at 0x00007FFA9C07CF19 in firefox.exe: Microsoft C++ exception: _com_error at memory location 0x0000001DE87F9DF8.
Exception thrown at 0x00007FFA9C07CF19 in firefox.exe: Microsoft C++ exception: _com_error at memory location 0x0000001DE87FAB80.

Platform

Windows with d3d12

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: dx12Issues with DX12 or DXGItype: bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions