Skip to content

Commit

Permalink
Fix: Test PVRTC extension and always use power-of-two dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Mar 2, 2024
1 parent 1918ab4 commit 41e9c5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,18 @@ ImageAllocator::ImageAllocator (deRandom& random, deBool dedicated, std::vector<
else
m_colorFormat = (VkFormat)optimalformats[deRandom_getUint32(&random) % optimalformats.size()];

int widthAlignment = (isYCbCr420Format(m_colorFormat) || isYCbCr422Format(m_colorFormat)) ? 2 : 1;
int heightAlignment = isYCbCr420Format(m_colorFormat) ? 2 : 1;
if (!isPvrtcFormat(m_colorFormat)) {
int widthAlignment = (isYCbCr420Format(m_colorFormat) || isYCbCr422Format(m_colorFormat)) ? 2 : 1;
int heightAlignment = isYCbCr420Format(m_colorFormat) ? 2 : 1;

// Random small size for causing potential alignment issues
m_size = tcu::IVec2((deRandom_getUint32(&random) % 16 + 3) & ~(widthAlignment - 1),
(deRandom_getUint32(&random) % 16 + 3) & ~(heightAlignment - 1));
} else {
m_size = tcu::IVec2(pow(2, deRandom_getUint32(&random) % 4),
pow(2, deRandom_getUint32(&random) % 4));
}

// Random small size for causing potential alignment issues
m_size = tcu::IVec2((deRandom_getUint32(&random) % 16 + 3) & ~(widthAlignment - 1),
(deRandom_getUint32(&random) % 16 + 3) & ~(heightAlignment - 1));
// Pick random memory type from the supported set
m_memoryType = memoryTypes[deRandom_getUint32(&random) % memoryTypes.size()];
}
Expand Down
1 change: 1 addition & 0 deletions external/vulkancts/modules/vulkan/vktTestCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ vector<string> filterExtensions (const vector<VkExtensionProperties>& extensions
"VK_NV_representative_fragment_test",
"VK_NV_shader_atomic_float16_vector",
"VK_MVK_macos_surface",
"VK_IMG_format_pvrtc"
};

const char* exclusions[] =
Expand Down

0 comments on commit 41e9c5d

Please sign in to comment.