Fixing texture size.

This commit is contained in:
Ben Vanik 2014-01-20 16:41:21 -08:00
parent 67cc57e918
commit 3c98e65997
2 changed files with 5 additions and 2 deletions

View File

@ -1170,9 +1170,9 @@ int D3D11GraphicsDriver::FetchTexture2D(
uint32_t width = fetch.size_2d.width;
uint32_t height = fetch.size_2d.height;
uint32_t data_pitch = XEROUNDUP(width, 256);
uint32_t data_pitch = MAX(256, XENEXTPOW2(width));
// TODO(benvanik): block height rounding?
uint32_t data_height = XEROUNDUP(height, 256);
uint32_t data_height = height;
size_t data_size = data_pitch * data_height * info.bpp;
D3D11_TEXTURE2D_DESC texture_desc;

View File

@ -142,6 +142,9 @@ typedef XECACHEALIGN volatile void xe_aligned_void_t;
#define XESELECTBITS(value, a, b) ((value & XEBITMASK(a, b)) >> a)
#define XEROUNDUP(v, multiple) ((v) + (multiple) - 1 - ((v) - 1) % (multiple))
static inline uint32_t XENEXTPOW2(uint32_t v) {
v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v;
}
#define XESUCCEED() goto XECLEANUP
#define XEFAIL() goto XECLEANUP