Commit 13ac9422 by James Dong Committed by Commit Bot

Vulkan: add support for shadow samplers.

Adds support for ES 3.0 shadow samplers. Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.texture.shadow.2d.*' Bug: angleproject:3211 Change-Id: Ic82ecfe19290fb952fcb0ba423691b5bac87c4a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1652021Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent fce1e2d1
......@@ -1203,8 +1203,8 @@ angle::Result TextureVk::syncState(const gl::Context *context,
samplerInfo.mipLodBias = 0.0f;
samplerInfo.anisotropyEnable = anisotropyEnable;
samplerInfo.maxAnisotropy = maxAnisotropy;
samplerInfo.compareEnable = VK_FALSE;
samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
samplerInfo.compareEnable = samplerState.getCompareMode() == GL_COMPARE_REF_TO_TEXTURE;
samplerInfo.compareOp = gl_vk::GetCompareOp(samplerState.getCompareFunc());
samplerInfo.minLod = samplerState.getMinLod();
samplerInfo.maxLod = samplerState.getMaxLod();
samplerInfo.borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK;
......
......@@ -776,6 +776,32 @@ VkComponentSwizzle GetSwizzle(const GLenum swizzle)
}
}
VkCompareOp GetCompareOp(const GLenum compareFunc)
{
switch (compareFunc)
{
case GL_NEVER:
return VK_COMPARE_OP_NEVER;
case GL_LESS:
return VK_COMPARE_OP_LESS;
case GL_EQUAL:
return VK_COMPARE_OP_EQUAL;
case GL_LEQUAL:
return VK_COMPARE_OP_LESS_OR_EQUAL;
case GL_GREATER:
return VK_COMPARE_OP_GREATER;
case GL_NOTEQUAL:
return VK_COMPARE_OP_NOT_EQUAL;
case GL_GEQUAL:
return VK_COMPARE_OP_GREATER_OR_EQUAL;
case GL_ALWAYS:
return VK_COMPARE_OP_ALWAYS;
default:
UNREACHABLE();
return VK_COMPARE_OP_ALWAYS;
}
}
void GetOffset(const gl::Offset &glOffset, VkOffset3D *vkOffset)
{
vkOffset->x = glOffset.x;
......
......@@ -531,6 +531,7 @@ VkCullModeFlags GetCullMode(const gl::RasterizerState &rasterState);
VkFrontFace GetFrontFace(GLenum frontFace, bool invertCullFace);
VkSampleCountFlagBits GetSamples(GLint sampleCount);
VkComponentSwizzle GetSwizzle(const GLenum swizzle);
VkCompareOp GetCompareOp(const GLenum compareFunc);
constexpr angle::PackedEnumMap<gl::DrawElementsType, VkIndexType> kIndexTypeMap = {
{gl::DrawElementsType::UnsignedByte, VK_INDEX_TYPE_UINT16},
......
......@@ -541,7 +541,17 @@
3188 VULKAN : dEQP-GLES3.functional.fbo.completeness.layer.3d* = SKIP
3189 VULKAN : dEQP-GLES3.functional.fbo.color.tex2darray.* = SKIP
3188 VULKAN : dEQP-GLES3.functional.fbo.color.tex3d.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.format.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.size.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.wrap.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.filtering.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.mipmap.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.swizzle.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.shadow.2d_array.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.specification.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.vertex.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.units.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.texture.compressed.* = SKIP
3189 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.* = SKIP
// Formats:
......
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