mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-14 06:00:14 +02:00
Fixed bug with CaptureTexture of 1D textures for Direct3D 11
This commit is contained in:
parent
b736e9edc3
commit
a58ad988bb
@ -171,11 +171,13 @@ namespace
|
|||||||
return E_UNEXPECTED;
|
return E_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const size_t msize = (metadata.dimension == TEX_DIMENSION_TEXTURE2D)
|
||||||
|
? std::min<size_t>(img->rowPitch, mapped.RowPitch) : img->rowPitch;
|
||||||
|
|
||||||
auto sptr = static_cast<const uint8_t*>(mapped.pData);
|
auto sptr = static_cast<const uint8_t*>(mapped.pData);
|
||||||
uint8_t* dptr = img->pixels;
|
uint8_t* dptr = img->pixels;
|
||||||
for (size_t h = 0; h < lines; ++h)
|
for (size_t h = 0; h < lines; ++h)
|
||||||
{
|
{
|
||||||
const size_t msize = std::min<size_t>(img->rowPitch, mapped.RowPitch);
|
|
||||||
memcpy(dptr, sptr, msize);
|
memcpy(dptr, sptr, msize);
|
||||||
sptr += mapped.RowPitch;
|
sptr += mapped.RowPitch;
|
||||||
dptr += img->rowPitch;
|
dptr += img->rowPitch;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user