Skip to content

WIP: 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
Open
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
2 changes: 1 addition & 1 deletion PluginSource/source/RenderAPI_D3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ void* RenderAPI_D3D12::BeginModifyTexture(void* textureHandle, int textureWidth,

// Fill data
// Clamp to minimum rowPitch of RGBA32
*outRowPitch = static_cast<int>(max(align_pow2(textureWidth * 4), 256));
*outRowPitch = (textureWidth * 4 + D3D12_TEXTURE_DATA_PITCH_ALIGNMENT - 1) & ~(D3D12_TEXTURE_DATA_PITCH_ALIGNMENT - 1);
const UINT64 kDataSize = get_aligned_size(textureWidth, textureHeight, 4, *outRowPitch);
if (!get_upload_resource(&s_upload_texture, kDataSize, D3D12_UPLOAD_HEAP_TEXTURE_BUFFER_NAME))
return NULL;
Expand Down