From 04cef0025a77fdd85f618f892944dcb4e8849614 Mon Sep 17 00:00:00 2001 From: WinterSnowfall Date: Wed, 5 Mar 2025 13:12:22 +0200 Subject: [PATCH] [d3d9] CheckDeviceFormat will error out for Vertex/IndexBuffer RTypes --- src/d3d9/d3d9_adapter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d3d9/d3d9_adapter.cpp b/src/d3d9/d3d9_adapter.cpp index 2d4bd25db..520eba423 100644 --- a/src/d3d9/d3d9_adapter.cpp +++ b/src/d3d9/d3d9_adapter.cpp @@ -114,7 +114,10 @@ namespace dxvk { DWORD Usage, D3DRESOURCETYPE RType, D3D9Format CheckFormat) { - if(unlikely(AdapterFormat == D3D9Format::Unknown)) + if (unlikely(AdapterFormat == D3D9Format::Unknown)) + return D3DERR_INVALIDCALL; + + if (unlikely(RType == D3DRTYPE_VERTEXBUFFER || RType == D3DRTYPE_INDEXBUFFER)) return D3DERR_INVALIDCALL; if (!IsSupportedAdapterFormat(AdapterFormat)) @@ -168,9 +171,6 @@ namespace dxvk { if (RType == D3DRTYPE_CUBETEXTURE && mapping.Aspect != VK_IMAGE_ASPECT_COLOR_BIT) return D3DERR_NOTAVAILABLE; - if (RType == D3DRTYPE_VERTEXBUFFER || RType == D3DRTYPE_INDEXBUFFER) - return D3D_OK; - // Let's actually ask Vulkan now that we got some quirks out the way! VkFormat format = mapping.FormatColor; if (unlikely(mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED)) {