-
Notifications
You must be signed in to change notification settings - Fork 521
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
NK_UINT_DRAW_INDEX not working for D3D11 implementation #236
Comments
Hi. I seems you're hitting the problem stated in this comment. Specifically:
|
Now, I cannot be 100% sure, but I think you need to fix this line: - ID3D11DeviceContext_IASetIndexBuffer(context, d3d11.index_buffer, DXGI_FORMAT_R16_UINT, 0);
+ ID3D11DeviceContext_IASetIndexBuffer(context, d3d11.index_buffer, DXGI_FORMAT_R32_UINT, 0); |
Hello there, thank you for the suggestion as it almost fixes the issue, but I also had to increase the MAX_VERTEX_BUFFER and MAX_INDEX_BUFFER (MAX_INDEX_BUFFER being MAX_VERTEX_BUFFER / 4) to a much larger number. Now it is able to render an ungodly amount of things without any problems what-so-ever. Thank you! |
@Hecklezz Cool. Would you be willing to open a PR that adds the changes required for this to work on the demo? |
Isn't the default ushort the intended default behavior though? |
Yes, but I was thinking of having some ifdefs on |
What do you think is an appropriate MAX_VERTEX_BUFFER and MAX_INDEX_BUFFER size as the default for when using uint instead of ushort for the draw index? |
Hmm, good question. The current values are already 2x/4x larger than ushort max. Idk what you're drawing and if it is a realistic workload, but I would probably leave those as is. |
What I was drawing was just testing extreme unrealistic cases, and if left to draw "everything" instead of things that were culled, or too far away, etc. So alright, I guess it can be left as they currently are. |
Do you think something like this will suffice-
|
Yea, that seems good to me |
I should not add NK_UINT_DRAW_INDEX to the demo though right? Leave that up to the end-user to add themselves? |
Correct |
Thanks again! |
If I draw a tonne of things at once, I reach the limit of the maximum number of indices or vertexes of the default ushort size. However, I read that defining NK_UINT_DRAW_INDEX will increase this limit to a uint which should be way more than enough for what I need it for.
However, if I have this define added, even when barely drawing anything for e.g. just using the nuklear demo, this happens (defined)-
Click to expand
when it should look normal like this (not defined)-
Click to expand
Does anyone know how to properly fix this in the D3D11 implementation, or perhaps what I am doing wrong?
The demo used is from here-
https://github.com/Immediate-Mode-UI/Nuklear/tree/master/demo/d3d11
Thank you.
The text was updated successfully, but these errors were encountered: