|
|
@@ -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" {
|
|
|
@@ -580,7 +574,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);
|
|
|
@@ -719,7 +713,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;
|
|
|
}
|
|
|
|
|
|
@@ -776,7 +770,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;
|
|
|
}
|
|
|
|
|
|
@@ -889,13 +883,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;
|
|
|
}
|
|
|
|
|
|
@@ -908,7 +902,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;
|
|
|
}
|
|
|
|
|
|
@@ -919,7 +913,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;
|
|
|
}
|
|
|
|
|
|
@@ -928,7 +922,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;
|
|
|
}
|
|
|
|
|
|
@@ -940,7 +934,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;
|
|
|
}
|
|
|
|
|
|
@@ -958,7 +952,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;
|
|
|
}
|
|
|
|
|
|
@@ -972,7 +966,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;
|
|
|
}
|
|
|
|
|
|
@@ -985,7 +979,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);
|
|
|
@@ -996,7 +990,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;
|
|
|
}
|
|
|
|
|
|
@@ -1009,7 +1003,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;
|
|
|
@@ -1024,7 +1018,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;
|
|
|
@@ -1037,7 +1031,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;
|
|
|
}
|
|
|
}
|
|
|
@@ -1051,7 +1045,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;
|
|
|
}
|
|
|
|
|
|
@@ -1065,7 +1059,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;
|
|
|
}
|
|
|
|
|
|
@@ -1073,7 +1067,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;
|
|
|
}
|
|
|
|
|
|
@@ -1088,7 +1082,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;
|
|
|
}
|
|
|
}
|
|
|
@@ -1272,7 +1266,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;
|
|
|
}
|
|
|
|
|
|
@@ -1280,7 +1274,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;
|
|
|
}
|
|
|
|
|
|
@@ -1289,7 +1283,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;
|
|
|
}
|
|
|
|
|
|
@@ -1314,7 +1308,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 {
|
|
|
@@ -1370,7 +1364,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 {
|
|
|
@@ -1385,7 +1379,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;
|
|
|
}
|
|
|
}
|
|
|
@@ -1397,7 +1391,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
|
|
|
@@ -1406,7 +1400,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
|
|
|
@@ -1585,7 +1579,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;
|
|
|
|
|
|
@@ -1696,7 +1690,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;
|
|
|
@@ -1723,7 +1717,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;
|
|
|
@@ -1742,7 +1736,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;
|
|
|
@@ -1948,7 +1942,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:
|
|
|
@@ -1959,7 +1953,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;
|
|
|
@@ -2209,7 +2203,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:
|
|
|
@@ -2219,7 +2213,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);
|
|
|
@@ -2480,7 +2474,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);
|
|
|
@@ -3297,7 +3291,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;
|
|
|
}
|
|
|
|
|
|
@@ -3357,7 +3351,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;
|
|
|
}
|
|
|
|
|
|
@@ -3417,9 +3411,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 {
|