Commit 21be09d8 by Alexis Hetu Committed by Alexis Hétu

Enable samplerAnisotropy

- Enabled the feature - Removed restriction from SpirvShader::getImageSampler() - Added support for it in SpirvShader::convertFilterMode() The rest of the logic to compute anisotropic filtering was still there. Tests: dEQP-VK.texture.filtering_anisotropy.* Bug: b/146438763 Change-Id: I2a36d00b6da88091202abe6d4f4f7f9b49507eb3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39668 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 0a9fbfe1
......@@ -90,11 +90,6 @@ SpirvShader::ImageSampler *SpirvShader::getImageSampler(uint32_t inst, vk::Sampl
samplerState.studioSwing = (sampler->ycbcrConversion->ycbcrRange == VK_SAMPLER_YCBCR_RANGE_ITU_NARROW);
samplerState.swappedChroma = (sampler->ycbcrConversion->components.r != VK_COMPONENT_SWIZZLE_R);
}
if(sampler->anisotropyEnable != VK_FALSE)
{
UNSUPPORTED("anisotropyEnable");
}
}
routine = emitSamplerRoutine(instruction, samplerState);
......@@ -229,6 +224,11 @@ std::shared_ptr<rr::Routine> SpirvShader::emitSamplerRoutine(ImageInstruction in
sw::FilterType SpirvShader::convertFilterMode(const vk::Sampler *sampler)
{
if(sampler->anisotropyEnable == VK_TRUE)
{
return FILTER_ANISOTROPIC;
}
switch(sampler->magFilter)
{
case VK_FILTER_NEAREST:
......
......@@ -64,7 +64,7 @@ const VkPhysicalDeviceFeatures &PhysicalDevice::getFeatures() const
VK_FALSE, // largePoints
VK_FALSE, // alphaToOne
VK_FALSE, // multiViewport
VK_FALSE, // samplerAnisotropy
VK_TRUE, // samplerAnisotropy
VK_TRUE, // textureCompressionETC2
VK_FALSE, // textureCompressionASTC_LDR
VK_FALSE, // textureCompressionBC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment