diff --git a/demo/d3d12/main.c b/demo/d3d12/main.c index d8bb406..a6873ba 100644 --- a/demo/d3d12/main.c +++ b/demo/d3d12/main.c @@ -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 diff --git a/demo/d3d12/nuklear_d3d12.h b/demo/d3d12/nuklear_d3d12.h index a235d69..b05b7ab 100644 --- a/demo/d3d12/nuklear_d3d12.h +++ b/demo/d3d12/nuklear_d3d12.h @@ -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)); }