aboutsummaryrefslogtreecommitdiff
path: root/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp')
-rw-r--r--external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
index 749612220..34a444085 100644
--- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
+++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
@@ -417,9 +417,9 @@ void SamplerTest::initPrograms (SourceCollections& sourceCollections) const
<< "{\n"
<< " fragColor = ";
- if (m_samplerLod > 0.0f)
+ if (m_samplerLod > 0.0f || !m_imageViewType.isNormalized())
{
- DE_ASSERT(m_imageViewType.isNormalized());
+ DE_ASSERT(m_imageViewType.isNormalized() || (m_samplerLod == 0.0f && !m_imageViewType.isNormalized()));
fragmentSrc << "textureLod(texSampler, vtxTexCoords." << texCoordSwizzle << ", " << std::fixed << m_samplerLod << ")";
}
else
@@ -1328,10 +1328,18 @@ void ExactSamplingCase::initPrograms (vk::SourceCollections& programCollection)
<< "\n"
<< "layout(location = 0) out " << colorType << " outColor;\n"
<< "\n"
- << "void main() {\n"
- << " outColor = texture(texSampler, fragTexCoord);\n"
- << "}\n"
- ;
+ << "void main() {\n";
+
+ if (m_params.unnormalizedCoordinates)
+ {
+ fragmentShader << " outColor = textureLod(texSampler, fragTexCoord, 0.0f);";
+ }
+ else
+ {
+ fragmentShader << " outColor = texture(texSampler, fragTexCoord);\n";
+ }
+
+ fragmentShader << "}\n";
programCollection.glslSources.add("frag") << glu::FragmentSource{fragmentShader.str()};
}
@@ -1370,8 +1378,6 @@ vk::VkExtent3D ExactSamplingInstance::getTextureExtent (void) const
tcu::TestStatus ExactSamplingInstance::iterate (void)
{
- const auto& vki = m_context.getInstanceInterface();
- const auto physDevice = m_context.getPhysicalDevice();
const auto& vkd = m_context.getDeviceInterface();
const auto device = m_context.getDevice();
auto& allocator = m_context.getDefaultAllocator();
@@ -1536,12 +1542,8 @@ tcu::TestStatus ExactSamplingInstance::iterate (void)
const auto descriptorSet = vk::makeDescriptorSet(vkd, device, descriptorPool.get(), descriptorSetLayout.get());
// Texture sampler. When using a solid color, test linear filtering. Linear filtering may incur in a small precission loss, but
- // it should be minimal and we should get the same color when converting back to the original format. Anisotropy should be
- // irrelevant too, so it is enabled and set to the maximum level if available.
+ // it should be minimal and we should get the same color when converting back to the original format.
const auto minMagFilter = (m_params.solidColor ? vk::VK_FILTER_LINEAR : vk::VK_FILTER_NEAREST);
- const bool anisotropySupported = (vk::getPhysicalDeviceFeatures(vki, physDevice).samplerAnisotropy == VK_TRUE);
- const bool anisotropyEnable = (!unnorm && m_params.solidColor && anisotropySupported);
- const float maxAnisotropy = (anisotropyEnable ? vk::getPhysicalDeviceProperties(vki, physDevice).limits.maxSamplerAnisotropy : 1.0f);
const auto addressMode = (unnorm ? vk::VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE : vk::VK_SAMPLER_ADDRESS_MODE_REPEAT);
const auto unnormalizedCoordinates = (unnorm ? VK_TRUE : VK_FALSE);
@@ -1557,8 +1559,8 @@ tcu::TestStatus ExactSamplingInstance::iterate (void)
addressMode, // VkSamplerAddressMode addressModeV;
addressMode, // VkSamplerAddressMode addressModeW;
0.0f, // float mipLodBias;
- (anisotropyEnable ? VK_TRUE : VK_FALSE), // VkBool32 anisotropyEnable;
- maxAnisotropy, // float maxAnisotropy;
+ VK_FALSE, // VkBool32 anisotropyEnable;
+ 1.0f, // float maxAnisotropy;
VK_FALSE, // VkBool32 compareEnable;
vk::VK_COMPARE_OP_NEVER, // VkCompareOp compareOp;
0.0f, // float minLod;