Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

DX12 Backend runtime failure with VS 2022

Open IgorAlexey opened this issue 2 years ago • 4 comments

This implementation may be utilizing an obsolete DirectX12 method, the compilation is successful, however the window appears white and then shuts after a second.

build log:

compilation header save succeeded; see d3d12\nuklear_d3d12_vertex_shader.h
compilation header save succeeded; see d3d12\nuklear_d3d12_pixel_shader.h
main.c
d3d12\nuklear_d3d12.h(517): warning C4244: 'function': conversion from 'SIZE_T' to 'int', possible loss of data
d3d12\nuklear_d3d12.h(523): warning C4244: 'function': conversion from 'SIZE_T' to 'int', possible loss of data
d3d12\nuklear_d3d12.h(680): warning C4002: too many arguments for function-like macro invocation 'ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart'
d3d12\nuklear_d3d12.h(681): warning C4002: too many arguments for function-like macro invocation 'ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart'
main.c(135): warning C4002: too many arguments for function-like macro invocation 'ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart'
d3d12\main.c(136) : warning C4700: uninitialized local variable 'descriptor_handle' used

I don't know what is the cause.

IgorAlexey avatar Apr 29 '22 13:04 IgorAlexey

@Sororfortuna ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart required 2 arguments during the development of the backend ~~(Never inteded or documented by MSFT). Seems that this issue in the C-Api is gone by now.~~ Still having the same issue like you described when running the application (Also around the call to ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart). Need to do more debugging on why this no longer works with the WinSDK...

Ohjurot avatar Aug 04 '22 08:08 Ohjurot

@Sororfortuna can you tell me wich windows sdk version you are using? There seems to be a bug in the D3D12 binding on the SDK versions before 10.0.22000.0 - I used the new SDK on my inital development. From the errors that you get, it seems that you use the old version of the SDK... For me with the new SDK version the application works fine. Using any older SDK and I get the same compiler warning and runtime behaviour.

Ohjurot avatar Aug 04 '22 10:08 Ohjurot

@Sororfortuna can you tell me wich windows sdk version you are using? There seems to be a bug in the D3D12 binding on the SDK versions before 10.0.22000.0 - I used the new SDK on my inital development. From the errors that you get, it seems that you use the old version of the SDK... For me with the new SDK version the application works fine. Using any older SDK and I get the same compiler warning and runtime behaviour.

I'm sure it was the latest at the creation of the issue as I kept it updated; I'll try the same again soon, Thanks!

IgorAlexey avatar Aug 04 '22 22:08 IgorAlexey

I am having an issue with it as well, I am trying to use the d3d12 backend in C++, I had to convert the header to use the C++ API and the upload buffers are failing to be created, hr is not an error value but the buffers are NULL (d3d12.upload_buffer and d3d12.font_upload_buffer). I think the requested size might be too large .

saidwho12 avatar Jul 31 '23 21:07 saidwho12