Commit 64e5ed2a by Luc Ferron Committed by Commit Bot

Vulkan: Fix scissor clears + enable dEQP tests

Vulkan does not support receiving out of bounds numbers for the scissor region but no validation errors are sent. This change clips the region received to fit the current viewport and it fixes many dEQP tests. Bug:angleproject:2356 Change-Id: I5dcf739366ba1f62b56593eaaccedf5f14d0c200 Reviewed-on: https://chromium-review.googlesource.com/957758Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
parent dbb9c534
...@@ -701,8 +701,20 @@ void PipelineDesc::updateRenderPassDesc(const RenderPassDesc &renderPassDesc) ...@@ -701,8 +701,20 @@ void PipelineDesc::updateRenderPassDesc(const RenderPassDesc &renderPassDesc)
void PipelineDesc::updateScissor(const gl::Rectangle &rect) void PipelineDesc::updateScissor(const gl::Rectangle &rect)
{ {
mScissor = {{rect.x, rect.y}, gl::Rectangle intersection;
{static_cast<uint32_t>(rect.width), static_cast<uint32_t>(rect.height)}}; gl::Rectangle clipRect(static_cast<GLuint>(mViewport.x), static_cast<GLuint>(mViewport.y),
static_cast<GLuint>(mViewport.width),
static_cast<GLuint>(mViewport.height));
// Coordinates outside surface aren't valid in Vulkan but not error is returned, the scissor is
// just ignored.
if (ClipRectangle(rect, clipRect, &intersection))
{
mScissor = ConvertGlRectToVkRect(intersection);
}
else
{
mScissor = ConvertGlRectToVkRect(rect);
}
} }
// AttachmentOpsArray implementation. // AttachmentOpsArray implementation.
......
...@@ -298,6 +298,12 @@ bool GetAvailableValidationLayers(const std::vector<VkLayerProperties> &layerPro ...@@ -298,6 +298,12 @@ bool GetAvailableValidationLayers(const std::vector<VkLayerProperties> &layerPro
namespace vk namespace vk
{ {
VkRect2D ConvertGlRectToVkRect(const gl::Rectangle &source)
{
return {{source.x, source.y},
{static_cast<uint32_t>(source.width), static_cast<uint32_t>(source.height)}};
}
Error::Error(VkResult result) : mResult(result), mFile(nullptr), mLine(0) Error::Error(VkResult result) : mResult(result), mFile(nullptr), mLine(0)
{ {
ASSERT(result == VK_SUCCESS); ASSERT(result == VK_SUCCESS);
......
...@@ -91,6 +91,8 @@ struct Format; ...@@ -91,6 +91,8 @@ struct Format;
template <typename T> template <typename T>
struct ImplTypeHelper; struct ImplTypeHelper;
VkRect2D ConvertGlRectToVkRect(const gl::Rectangle &source);
// clang-format off // clang-format off
#define ANGLE_IMPL_TYPE_HELPER_GL(OBJ) \ #define ANGLE_IMPL_TYPE_HELPER_GL(OBJ) \
template<> \ template<> \
......
...@@ -178,9 +178,11 @@ ...@@ -178,9 +178,11 @@
1028 WIN LINUX MAC : dEQP-GLES2.functional.fbo.completeness.renderable.texture.depth.srgb8 = FAIL 1028 WIN LINUX MAC : dEQP-GLES2.functional.fbo.completeness.renderable.texture.depth.srgb8 = FAIL
// Vulkan failures // Vulkan failures
2161 VULKAN : dEQP-GLES2.functional.color_clear.masked_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.color_clear.complex_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.color_clear.long_masked_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.prerequisite.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.prerequisite.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.implementation_limits.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.implementation_limits.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.color_clear.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.depth_stencil_clear.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.depth_stencil_clear.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.buffer.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.buffer.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.light_amount.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.light_amount.* = SKIP
......
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