Commit 962c222a by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Enable anisotropy feature when available

If anisotropic filtering is used, the feature must be enabled at device creation time. This was missing. Bug: angleproject:2901 Change-Id: I86db55f8b1696dc04eae922b941512f786aa12b8 Reviewed-on: https://chromium-review.googlesource.com/c/1479264 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@google.com>
parent 08573730
...@@ -931,6 +931,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF ...@@ -931,6 +931,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
enabledFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; enabledFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
enabledFeatures.features.inheritedQueries = mPhysicalDeviceFeatures.inheritedQueries; enabledFeatures.features.inheritedQueries = mPhysicalDeviceFeatures.inheritedQueries;
enabledFeatures.features.robustBufferAccess = mPhysicalDeviceFeatures.robustBufferAccess; enabledFeatures.features.robustBufferAccess = mPhysicalDeviceFeatures.robustBufferAccess;
enabledFeatures.features.samplerAnisotropy = mPhysicalDeviceFeatures.samplerAnisotropy;
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT divisorFeatures = {}; VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT divisorFeatures = {};
divisorFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; divisorFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
......
...@@ -2736,6 +2736,41 @@ TEST_P(SamplerInStructAndOtherVariableTest, SamplerInStructAndOtherVariable) ...@@ -2736,6 +2736,41 @@ TEST_P(SamplerInStructAndOtherVariableTest, SamplerInStructAndOtherVariable)
runSamplerInStructTest(); runSamplerInStructTest();
} }
// GL_EXT_texture_filter_anisotropic
class TextureAnisotropyTest : public Texture2DTest
{
protected:
void uploadTexture()
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
GLColor texDataRed[1] = {GLColor::red};
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, texDataRed);
EXPECT_GL_NO_ERROR();
}
};
// Tests that setting anisotropic filtering doesn't cause failures at draw time.
TEST_P(TextureAnisotropyTest, AnisotropyFunctional)
{
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_filter_anisotropic"));
setUpProgram();
uploadTexture();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 2.0f);
EXPECT_GL_NO_ERROR();
drawQuad(mProgram, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor::red);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() - 1, getWindowHeight() - 1, GLColor::red);
}
// GL_OES_texture_border_clamp // GL_OES_texture_border_clamp
class TextureBorderClampTest : public Texture2DTest class TextureBorderClampTest : public Texture2DTest
{ {
...@@ -4377,6 +4412,12 @@ ANGLE_INSTANTIATE_TEST(SamplerInStructAndOtherVariableTest, ...@@ -4377,6 +4412,12 @@ ANGLE_INSTANTIATE_TEST(SamplerInStructAndOtherVariableTest,
ES2_OPENGL(), ES2_OPENGL(),
ES2_OPENGLES(), ES2_OPENGLES(),
ES2_VULKAN()); ES2_VULKAN());
ANGLE_INSTANTIATE_TEST(TextureAnisotropyTest,
ES2_D3D11(),
ES2_D3D9(),
ES2_OPENGL(),
ES2_OPENGLES(),
ES2_VULKAN());
ANGLE_INSTANTIATE_TEST(TextureBorderClampTest, ANGLE_INSTANTIATE_TEST(TextureBorderClampTest,
ES2_D3D11(), ES2_D3D11(),
ES2_D3D9(), ES2_D3D9(),
......
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