summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-07-13 15:34:04 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-07-13 15:53:34 +0100
commit2ec73fad5120d57ebd0f63841373c8858e5dd43d (patch)
tree8a1b89215b03371fa4715716016ae3e127a14a3b /helpers
parent46584eaae13051a5d1b3bc3f49f9b38d423a1e86 (diff)
d3dtrace: Fix size computation for full DXTC locks.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/d3d8size.hpp1
-rw-r--r--helpers/d3d9size.hpp2
-rw-r--r--helpers/d3dcommonsize.hpp16
3 files changed, 8 insertions, 11 deletions
diff --git a/helpers/d3d8size.hpp b/helpers/d3d8size.hpp
index 21c53464..b446a4b5 100644
--- a/helpers/d3d8size.hpp
+++ b/helpers/d3d8size.hpp
@@ -128,7 +128,6 @@ _getFormatSize(D3DFORMAT Format, size_t & BlockSize, UINT & BlockWidth, UINT & B
default:
os::log("apitrace: warning: %s: unknown D3DFMT %u\n", __FUNCTION__, Format);
BlockWidth = 0;
- BlockHeight = 0;
break;
}
}
diff --git a/helpers/d3d9size.hpp b/helpers/d3d9size.hpp
index 29b6fb1e..a6aca446 100644
--- a/helpers/d3d9size.hpp
+++ b/helpers/d3d9size.hpp
@@ -167,7 +167,6 @@ _getFormatSize(D3DFORMAT Format, size_t & BlockSize, UINT & BlockWidth, UINT & B
* Height * RowPitch will match the expected size.
*/
BlockWidth = 0;
- BlockHeight = 0;
BlockSize = 0;
break;
@@ -182,7 +181,6 @@ _getFormatSize(D3DFORMAT Format, size_t & BlockSize, UINT & BlockWidth, UINT & B
default:
os::log("apitrace: warning: %s: unknown D3DFMT %u\n", __FUNCTION__, Format);
BlockWidth = 0;
- BlockHeight = 0;
break;
}
}
diff --git a/helpers/d3dcommonsize.hpp b/helpers/d3dcommonsize.hpp
index 2ebbbc48..766d49e8 100644
--- a/helpers/d3dcommonsize.hpp
+++ b/helpers/d3dcommonsize.hpp
@@ -134,19 +134,19 @@ _getLockSize(D3DFORMAT Format, bool Partial, UINT Width, UINT Height, INT RowPit
// Planar YUV
size = (Height + (Height + 1)/2) * RowPitch;
} else {
+ size_t BlockSize;
+ UINT BlockWidth;
+ UINT BlockHeight;
+ _getFormatSize(Format, BlockSize, BlockWidth, BlockHeight);
+ assert(BlockHeight);
+ Height = (Height + BlockHeight - 1) / BlockHeight;
+
size = Height * RowPitch;
if (Partial || Height == 1) {
// Must take pixel size in consideration
-
- size_t BlockSize;
- UINT BlockWidth;
- UINT BlockHeight;
- _getFormatSize(Format, BlockSize, BlockWidth, BlockHeight);
-
- if (BlockWidth && BlockHeight) {
+ if (BlockWidth) {
Width = (Width + BlockWidth - 1) / BlockWidth;
- Height = (Height + BlockHeight - 1) / BlockHeight;
size = (Width * BlockSize + 7)/ 8;
if (Height > 1) {
size += (Height - 1) * RowPitch;