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

D3D12: fix D3D12_VERTEX_BUFFER_VIEW stride when both vertex layout handles are valid #3250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

falia18
Copy link

@falia18 falia18 commented Feb 8, 2024

Fix for this issue: https://github.com/falia18/bgfx/tree/pr-example/fix-d3d12-layout-issue
To repro launch 01-cubes with --d3d12, it gives this:
image

The fix makes the layout selection consistant (when both layouts are valid) between these lines:

const uint16_t layoutIdx = !isValid(vb.m_layoutHandle) ? stream.m_layoutHandle.idx : vb.m_layoutHandle.idx;

bgfx/src/renderer_d3d12.cpp

Lines 6893 to 6895 in a9f6104

const uint16_t layoutIdx = isValid(draw.m_stream[idx].m_layoutHandle)
? draw.m_stream[idx].m_layoutHandle.idx
: vb.m_layoutHandle.idx;

(It's my first PR sorry if I messed up something)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant