aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlocke-lunarg <locke@lunarg.com>2020-04-16 18:17:48 -0600
committerLocke Lin <47329816+locke-lunarg@users.noreply.github.com>2020-04-17 12:59:09 -0600
commit8824107d57d32b613e1365bdb1fdd79e02be022b (patch)
tree6100c1e2e58692ecc6f6c7ccd7e066d434507608
parent454ab259c1b82c392c1cb3cbb164b73ac52a9478 (diff)
downloadusermoji-8824107d57d32b613e1365bdb1fdd79e02be022b.tar.xz
icd: Set texel size is 32
4 bytes is too small for many format. It causes fail in some situation. 32 bytes is the biggest size in the whole format, so it should be better.
-rw-r--r--icd/generated/mock_icd.cpp4
-rw-r--r--scripts/mock_icd_generator.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/icd/generated/mock_icd.cpp b/icd/generated/mock_icd.cpp
index f400e976..ecc188a5 100644
--- a/icd/generated/mock_icd.cpp
+++ b/icd/generated/mock_icd.cpp
@@ -858,9 +858,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateImage(
{
unique_lock_t lock(global_lock);
*pImage = (VkImage)global_unique_handle++;
- // TODO: A texel size is 4 bytes for now whatever the format is. It could be changed to more accurate size if need be.
+ // TODO: A pixel size is 32 bytes. This accounts for the largest possible pixel size of any format. It could be changed to more accurate size if need be.
image_memory_size_map[device][*pImage] = pCreateInfo->extent.width * pCreateInfo->extent.height * pCreateInfo->extent.depth *
- 4 * pCreateInfo->arrayLayers * (pCreateInfo->mipLevels > 1 ? 2 : 1);
+ 32 * pCreateInfo->arrayLayers * (pCreateInfo->mipLevels > 1 ? 2 : 1);
// plane count
switch (pCreateInfo->format) {
case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py
index 74c5c7eb..bf48520f 100644
--- a/scripts/mock_icd_generator.py
+++ b/scripts/mock_icd_generator.py
@@ -951,9 +951,9 @@ CUSTOM_C_INTERCEPTS = {
'vkCreateImage': '''
unique_lock_t lock(global_lock);
*pImage = (VkImage)global_unique_handle++;
- // TODO: A texel size is 4 bytes for now whatever the format is. It could be changed to more accurate size if need be.
+ // TODO: A pixel size is 32 bytes. This accounts for the largest possible pixel size of any format. It could be changed to more accurate size if need be.
image_memory_size_map[device][*pImage] = pCreateInfo->extent.width * pCreateInfo->extent.height * pCreateInfo->extent.depth *
- 4 * pCreateInfo->arrayLayers * (pCreateInfo->mipLevels > 1 ? 2 : 1);
+ 32 * pCreateInfo->arrayLayers * (pCreateInfo->mipLevels > 1 ? 2 : 1);
// plane count
switch (pCreateInfo->format) {
case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: