X Tutup
Skip to content

Fix bad D3D12 SRV breaking MSAA with OpenXR#113585

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
brycehutchings:fix_d3d12_array_multisample
Dec 5, 2025
Merged

Fix bad D3D12 SRV breaking MSAA with OpenXR#113585
akien-mga merged 1 commit intogodotengine:masterfrom
brycehutchings:fix_d3d12_array_multisample

Conversation

@brycehutchings
Copy link
Contributor

I found MSAA+D3D12+OpenXR was broken. The first error I see is this when I try:

E 0:00:06:696   RenderingDeviceDriverD3D12::render_pipeline_create: Create(Graphics)PipelineState failed with error 0x887a0005.
  <C++ Error>   Condition "!(((HRESULT)(res)) >= 0)" is true. Returning: PipelineID()
  <C++ Source>  drivers\d3d12\rendering_device_driver_d3d12.cpp:5402 @ RenderingDeviceDriverD3D12::render_pipeline_create()

and then it spews errors because the device is lost (0x887a0005=DXGI_ERROR_DEVICE_REMOVED). I used --gpu-validation --gpu-abort which showed that the original error was here in RenderingDeviceDriverD3D12::uniform_set_create:

device->CreateShaderResourceView(texture_info->resource, &texture_info->view_descs.srv, desc_heap_walkers.resources.get_curr_cpu_handle());

The validation layer said:

DX ERROR: ID3D12Device::CreateShaderResourceView: The Dimensions of the View are invalid due to at least one of the following conditions. [...] With the current FirstArraySlice, ArraySize (value = 0) must be between 1 and 2, inclusively, or -1 to default to all slices from FirstArraySlice, in order that the View fit on the Texture. [ STATE_CREATION ERROR #31: ]

This was a bit misleading because the ArraySize was set correctly in the Texture2DMSArray section, but it was looking at the Texture2DArray section (which is uninitialized) because the ViewDimension was set wrong. So thankfully this was a 2 letter fix.

@BastiaanOlij
Copy link
Contributor

cc @clayjohn

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga akien-mga added this to the 4.6 milestone Dec 5, 2025
@akien-mga akien-mga merged commit 4b448fd into godotengine:master Dec 5, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Very Bad

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup