Skip to content

Fix incorrect calculations of row pitch in d3d12 implementation #48

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

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

Conversation

Florian-Simon-RedArtGames

With a 160x144 texture, the pitch would be aligned to be 1024 pixels wide, not 768 as D3D12 calculates it to be. This was causing issues on our end, where we would be drawing pixels with offsets that would accumulate over each row of pixels.

The width does not need to be a power of 2 - it turns out it just needs to be a multiple of 256, which is what D3D12_TEXTURE_DATA_PITCH_ALIGNMENT is defined to be.

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