Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing #455 (D3D12 Backend) #487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions demo/d3d12/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
/* nuklear - 1.32.0 - public domain */

/*
* === IMPORTATE NOTE FOR D3D12 ===
*
* Due to a bug in the Windows SDK that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define/describe shortly the bug in the comment so that it is greppable. Then I will merge. Thanks a lot!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and maybe squash the commits - it is a small change we could keep together 😉.

* 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>
Expand Down
4 changes: 2 additions & 2 deletions demo/d3d12/nuklear_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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));
}

Expand Down