|
|
@@ -39,12 +39,6 @@
|
|
|
|
|
|
#include "SDL_shaders_d3d12.h"
|
|
|
|
|
|
-#if defined(_MSC_VER) && !defined(__clang__)
|
|
|
-#define SDL_COMPOSE_ERROR(str) SDL_FUNCTION ", " str
|
|
|
-#else
|
|
|
-#define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(SDL_FUNCTION) ", " str
|
|
|
-#endif
|
|
|
-
|
|
|
// Set up for C function definitions, even when using C++
|
|
|
#ifdef __cplusplus
|
|
|
extern "C" {
|
|
|
@@ -556,7 +550,7 @@ static HRESULT D3D12_IssueBatch(D3D12_RenderData *data)
|
|
|
// Issue the command list
|
|
|
result = ID3D12GraphicsCommandList2_Close(data->commandList);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12_IssueBatch"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("D3D12_IssueBatch", result);
|
|
|
return result;
|
|
|
}
|
|
|
ID3D12CommandQueue_ExecuteCommandLists(data->commandQueue, 1, (ID3D12CommandList *const *)&data->commandList);
|
|
|
@@ -695,7 +689,7 @@ static D3D12_PipelineState *D3D12_CreatePipelineState(SDL_Renderer *renderer,
|
|
|
D3D_GUID(SDL_IID_ID3D12PipelineState),
|
|
|
(void **)&pipelineState);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateGraphicsPipelineState"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateGraphicsPipelineState", result);
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
@@ -752,7 +746,7 @@ static HRESULT D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, si
|
|
|
(void **)&data->vertexBuffers[vbidx].resource);
|
|
|
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreatePlacedResource [vertex buffer]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreatePlacedResource [vertex buffer]", result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -865,13 +859,13 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
|
|
|
result = DXGIGetDebugInterfaceFunc(0, D3D_GUID(SDL_IID_IDXGIDebug1), (void **)&data->dxgiDebug);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("DXGIGetDebugInterface1"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("DXGIGetDebugInterface1", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
result = DXGIGetDebugInterfaceFunc(0, D3D_GUID(SDL_IID_IDXGIInfoQueue), (void **)&dxgiInfoQueue);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("DXGIGetDebugInterface1"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("DXGIGetDebugInterface1", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -884,7 +878,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
|
|
|
result = pCreateDXGIFactory2(creationFlags, D3D_GUID(SDL_IID_IDXGIFactory6), (void **)&data->dxgiFactory);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("CreateDXGIFactory"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("CreateDXGIFactory", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -895,7 +889,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_IDXGIAdapter4),
|
|
|
(void **)&data->dxgiAdapter);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory6::EnumAdapterByGPUPreference"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGIFactory6::EnumAdapterByGPUPreference", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -904,7 +898,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12Device1),
|
|
|
(void **)&d3dDevice);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12CreateDevice"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("D3D12CreateDevice", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -916,7 +910,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
|
|
|
result = ID3D12Device1_QueryInterface(d3dDevice, D3D_GUID(SDL_IID_ID3D12InfoQueue), (void **)&infoQueue);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device to ID3D12InfoQueue"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device to ID3D12InfoQueue", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -934,7 +928,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
|
|
|
result = ID3D12Device_QueryInterface(d3dDevice, D3D_GUID(SDL_IID_ID3D12Device1), (void **)&data->d3dDevice);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device to ID3D12Device1"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device to ID3D12Device1", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -948,7 +942,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12CommandQueue),
|
|
|
(void **)&data->commandQueue);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandQueue"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommandQueue", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -961,7 +955,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12DescriptorHeap),
|
|
|
(void **)&data->rtvDescriptorHeap);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [rtv]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateDescriptorHeap [rtv]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
data->rtvDescriptorSize = ID3D12Device1_GetDescriptorHandleIncrementSize(d3dDevice, D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
|
|
@@ -972,7 +966,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12DescriptorHeap),
|
|
|
(void **)&data->textureRTVDescriptorHeap);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [texture rtv]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateDescriptorHeap [texture rtv]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -985,7 +979,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12DescriptorHeap),
|
|
|
(void **)&data->srvDescriptorHeap);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [srv]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateDescriptorHeap [srv]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
rootDescriptorHeaps[0] = data->srvDescriptorHeap;
|
|
|
@@ -1000,7 +994,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12DescriptorHeap),
|
|
|
(void **)&data->samplerDescriptorHeap);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [sampler]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateDescriptorHeap [sampler]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
rootDescriptorHeaps[1] = data->samplerDescriptorHeap;
|
|
|
@@ -1013,7 +1007,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12CommandAllocator),
|
|
|
(void **)&data->commandAllocators[i]);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandAllocator"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommandAllocator", result);
|
|
|
goto done;
|
|
|
}
|
|
|
}
|
|
|
@@ -1027,7 +1021,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12GraphicsCommandList2),
|
|
|
(void **)&data->commandList);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandList"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommandList", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1041,7 +1035,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12Fence),
|
|
|
(void **)&data->fence);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateFence"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateFence", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1049,7 +1043,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
|
|
|
data->fenceEvent = pCreateEventExW(NULL, NULL, 0, EVENT_MODIFY_STATE | SYNCHRONIZE);
|
|
|
if (!data->fenceEvent) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("CreateEventEx"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("CreateEventEx", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1064,7 +1058,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12RootSignature),
|
|
|
(void **)&data->rootSignatures[i]);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateRootSignature"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateRootSignature", result);
|
|
|
goto done;
|
|
|
}
|
|
|
}
|
|
|
@@ -1248,7 +1242,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|
|
NULL, // Allow on all displays.
|
|
|
&swapChain);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForHwnd"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGIFactory2::CreateSwapChainForHwnd", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1256,7 +1250,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|
|
|
|
|
result = IDXGISwapChain1_QueryInterface(swapChain, D3D_GUID(SDL_IID_IDXGISwapChain4), (void **)&data->swapChain);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain1::QueryInterface"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain1::QueryInterface", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1265,7 +1259,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|
|
*/
|
|
|
result = IDXGISwapChain4_SetMaximumFrameLatency(data->swapChain, 1);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain4::SetMaximumFrameLatency"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain4::SetMaximumFrameLatency", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -1290,7 +1284,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|
|
(colorspace_support & DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)) {
|
|
|
result = IDXGISwapChain3_SetColorSpace1(data->swapChain, colorspace);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain3::SetColorSpace1"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain3::SetColorSpace1", result);
|
|
|
goto done;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1346,7 +1340,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
|
|
DXGI_FORMAT_UNKNOWN,
|
|
|
data->swapFlags);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::ResizeBuffers"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain::ResizeBuffers", result);
|
|
|
goto done;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1361,7 +1355,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
|
|
if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) {
|
|
|
result = IDXGISwapChain4_SetRotation(data->swapChain, data->rotation); // NOLINT(clang-analyzer-core.NullDereference)
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain4::SetRotation"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain4::SetRotation", result);
|
|
|
goto done;
|
|
|
}
|
|
|
}
|
|
|
@@ -1373,7 +1367,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
|
|
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
|
|
result = D3D12_XBOX_CreateBackBufferTarget(data->d3dDevice, renderer->window->w, renderer->window->h, (void **)&data->renderTargets[i]);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12_XBOX_CreateBackBufferTarget"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("D3D12_XBOX_CreateBackBufferTarget", result);
|
|
|
goto done;
|
|
|
}
|
|
|
#else
|
|
|
@@ -1382,7 +1376,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&data->renderTargets[i]);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain4::GetBuffer"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain4::GetBuffer", result);
|
|
|
goto done;
|
|
|
}
|
|
|
#endif
|
|
|
@@ -1561,7 +1555,7 @@ static bool D3D12_CreatePalette(SDL_Renderer *renderer, SDL_TexturePalette *pale
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&palettedata->texture);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [texture]", result);
|
|
|
}
|
|
|
palettedata->resourceState = D3D12_RESOURCE_STATE_COPY_DEST;
|
|
|
|
|
|
@@ -1672,7 +1666,7 @@ static bool D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&textureData->mainTexture);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [texture]", result);
|
|
|
}
|
|
|
}
|
|
|
textureData->mainResourceState = D3D12_RESOURCE_STATE_COPY_DEST;
|
|
|
@@ -1699,7 +1693,7 @@ static bool D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&textureData->mainTextureU);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [texture]", result);
|
|
|
}
|
|
|
}
|
|
|
textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST;
|
|
|
@@ -1718,7 +1712,7 @@ static bool D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&textureData->mainTextureV);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [texture]", result);
|
|
|
}
|
|
|
}
|
|
|
textureData->mainResourceStateV = D3D12_RESOURCE_STATE_COPY_DEST;
|
|
|
@@ -1924,7 +1918,7 @@ static bool D3D12_UpdateTextureInternal(D3D12_RenderData *rendererData, ID3D12Re
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&rendererData->uploadBuffers[rendererData->currentUploadBuffer]);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [create upload buffer]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [create upload buffer]", result);
|
|
|
}
|
|
|
|
|
|
// Get a write-only pointer to data in the upload buffer:
|
|
|
@@ -1935,7 +1929,7 @@ static bool D3D12_UpdateTextureInternal(D3D12_RenderData *rendererData, ID3D12Re
|
|
|
(void **)&textureMemory);
|
|
|
if (FAILED(result)) {
|
|
|
D3D_SAFE_RELEASE(rendererData->uploadBuffers[rendererData->currentUploadBuffer]);
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Resource::Map [map staging texture]", result);
|
|
|
}
|
|
|
|
|
|
src = (const Uint8 *)pixels;
|
|
|
@@ -2185,7 +2179,7 @@ static bool D3D12_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&textureData->stagingBuffer);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [create upload buffer]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Device::CreateCommittedResource [create upload buffer]", result);
|
|
|
}
|
|
|
|
|
|
// Get a write-only pointer to data in the upload buffer:
|
|
|
@@ -2195,7 +2189,7 @@ static bool D3D12_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
|
|
(void **)&textureMemory);
|
|
|
if (FAILED(result)) {
|
|
|
D3D_SAFE_RELEASE(rendererData->uploadBuffers[rendererData->currentUploadBuffer]);
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Resource::Map [map staging texture]", result);
|
|
|
}
|
|
|
|
|
|
SDL_zero(pitchedDesc);
|
|
|
@@ -2456,7 +2450,7 @@ static bool D3D12_UpdateVertexBuffer(SDL_Renderer *renderer,
|
|
|
vertexBuffer = rendererData->vertexBuffers[vbidx].resource;
|
|
|
result = ID3D12Resource_Map(vertexBuffer, 0, &range, (void **)&vertexBufferData);
|
|
|
if (FAILED(result)) {
|
|
|
- return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [vertex buffer]"), result);
|
|
|
+ return WIN_SetErrorFromHRESULT("ID3D12Resource::Map [vertex buffer]", result);
|
|
|
}
|
|
|
SDL_memcpy(vertexBufferData, vertexData, dataSizeInBytes);
|
|
|
ID3D12Resource_Unmap(vertexBuffer, 0, NULL);
|
|
|
@@ -3272,7 +3266,7 @@ static SDL_Surface *D3D12_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rec
|
|
|
D3D_GUID(SDL_IID_ID3D12Resource),
|
|
|
(void **)&readbackBuffer);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateTexture2D [create staging texture]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Device::CreateTexture2D [create staging texture]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -3332,7 +3326,7 @@ static SDL_Surface *D3D12_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rec
|
|
|
NULL,
|
|
|
(void **)&textureMemory);
|
|
|
if (FAILED(result)) {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("ID3D12Resource::Map [map staging texture]", result);
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
@@ -3392,9 +3386,9 @@ static bool D3D12_RenderPresent(SDL_Renderer *renderer)
|
|
|
} else if (result == DXGI_ERROR_INVALID_CALL) {
|
|
|
// We probably went through a fullscreen <-> windowed transition
|
|
|
D3D12_CreateWindowSizeDependentResources(renderer);
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::Present"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain::Present", result);
|
|
|
} else {
|
|
|
- WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::Present"), result);
|
|
|
+ WIN_SetErrorFromHRESULT("IDXGISwapChain::Present", result);
|
|
|
}
|
|
|
return false;
|
|
|
} else {
|