Fixed compiler warnings

- Using ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart now again as intended (I don't know why at some point of time MSFT had this function the way it was used previously...)

Revert "Fixed compiler warnings"
... well it had a reason why I did what I did ...
This reverts commit 97c7a6b805b9189ae4bb229d667b786d144bec75.

Fixed a bug with modern directx versions

added note for the winsdk issue
This commit is contained in:
Ludwig Füchsl 2022-08-04 10:21:03 +02:00 committed by Ludwig Füchsl
parent 93a057b3fe
commit b8cecd37c0
2 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,17 @@
/* nuklear - 1.32.0 - public domain */
/*
* === IMPORTATE NOTE FOR D3D12 ===
*
* Due to a bug in the Windows SDK that
* was fixed in version 10.0.22000.0 the
* D3D12 Backend requires this version as
* a minimum! Compiling with a lower version
* will result in compiler warnings and a
* crashing application!
*
*/
#define COBJMACROS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

View File

@ -611,7 +611,7 @@ nk_d3d12_init(ID3D12Device *device, int width, int height, unsigned int max_vert
desc.SampleDesc.Quality = 0;
desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
hr = ID3D12Device_CreateCommittedResource(device, &d3d12.heap_prop_upload, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_COPY_SOURCE, NULL, &IID_ID3D12Resource, &d3d12.upload_buffer);
hr = ID3D12Device_CreateCommittedResource(device, &d3d12.heap_prop_upload, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &IID_ID3D12Resource, &d3d12.upload_buffer);
NK_ASSERT(SUCCEEDED(hr));
}
/* Create constant buffer */
@ -812,7 +812,7 @@ nk_d3d12_font_stash_end(ID3D12GraphicsCommandList *command_list)
desc.SampleDesc.Quality = 0;
desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
hr = ID3D12Device_CreateCommittedResource(d3d12.device, &d3d12.heap_prop_upload, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_COPY_SOURCE, NULL, &IID_ID3D12Resource, &d3d12.font_upload_buffer);
hr = ID3D12Device_CreateCommittedResource(d3d12.device, &d3d12.heap_prop_upload, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &IID_ID3D12Resource, &d3d12.font_upload_buffer);
NK_ASSERT(SUCCEEDED(hr));
}