Commit dd196e0b by Luc Ferron Committed by Commit Bot

Vulkan: Implement color mask and depth mask bits

These two features are heavily used in the functional.depth_stencil_clear.* dEQP tests. Enable a bunch of color/depth/stencil clear tests, however there is still 2 tests in particular that are giving me trouble. I will work on them separately in a subsequent change. Bug: angleproject:2443 Bug: angleproject:2455 Change-Id: Ic93420c7b525b424e9641f78265e264ddb163ab1 Reviewed-on: https://chromium-review.googlesource.com/996035 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 5fec7ab2
...@@ -521,7 +521,7 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits ...@@ -521,7 +521,7 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits
mPipelineDesc->updateBlendEquations(glState.getBlendState()); mPipelineDesc->updateBlendEquations(glState.getBlendState());
break; break;
case gl::State::DIRTY_BIT_COLOR_MASK: case gl::State::DIRTY_BIT_COLOR_MASK:
WARN() << "DIRTY_BIT_COLOR_MASK unimplemented"; mPipelineDesc->updateColorWriteMask(glState.getBlendState());
break; break;
case gl::State::DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED: case gl::State::DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED:
WARN() << "DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED unimplemented"; WARN() << "DIRTY_BIT_SAMPLE_ALPHA_TO_COVERAGE_ENABLED unimplemented";
...@@ -545,7 +545,7 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits ...@@ -545,7 +545,7 @@ void ContextVk::syncState(const gl::Context *context, const gl::State::DirtyBits
mPipelineDesc->updateDepthFunc(glState.getDepthStencilState()); mPipelineDesc->updateDepthFunc(glState.getDepthStencilState());
break; break;
case gl::State::DIRTY_BIT_DEPTH_MASK: case gl::State::DIRTY_BIT_DEPTH_MASK:
WARN() << "DIRTY_BIT_DEPTH_MASK unimplemented"; mPipelineDesc->updateDepthWriteEnabled(glState.getDepthStencilState());
break; break;
case gl::State::DIRTY_BIT_STENCIL_TEST_ENABLED: case gl::State::DIRTY_BIT_STENCIL_TEST_ENABLED:
mPipelineDesc->updateStencilTestEnabled(glState.getDepthStencilState()); mPipelineDesc->updateStencilTestEnabled(glState.getDepthStencilState());
......
...@@ -724,6 +724,19 @@ void PipelineDesc::updateBlendFuncs(const gl::BlendState &blendState) ...@@ -724,6 +724,19 @@ void PipelineDesc::updateBlendFuncs(const gl::BlendState &blendState)
} }
} }
void PipelineDesc::updateColorWriteMask(const gl::BlendState &blendState)
{
for (auto &blendAttachmentState : mColorBlendStateInfo.attachments)
{
int colorMask = blendState.colorMaskRed ? VK_COLOR_COMPONENT_R_BIT : 0;
colorMask |= blendState.colorMaskGreen ? VK_COLOR_COMPONENT_G_BIT : 0;
colorMask |= blendState.colorMaskBlue ? VK_COLOR_COMPONENT_B_BIT : 0;
colorMask |= blendState.colorMaskAlpha ? VK_COLOR_COMPONENT_A_BIT : 0;
blendAttachmentState.colorWriteMask = static_cast<uint8_t>(colorMask);
}
}
void PipelineDesc::updateDepthTestEnabled(const gl::DepthStencilState &depthStencilState) void PipelineDesc::updateDepthTestEnabled(const gl::DepthStencilState &depthStencilState)
{ {
mDepthStencilStateInfo.depthTestEnable = static_cast<uint8_t>(depthStencilState.depthTest); mDepthStencilStateInfo.depthTestEnable = static_cast<uint8_t>(depthStencilState.depthTest);
...@@ -734,6 +747,11 @@ void PipelineDesc::updateDepthFunc(const gl::DepthStencilState &depthStencilStat ...@@ -734,6 +747,11 @@ void PipelineDesc::updateDepthFunc(const gl::DepthStencilState &depthStencilStat
mDepthStencilStateInfo.depthCompareOp = PackGLCompareFunc(depthStencilState.depthFunc); mDepthStencilStateInfo.depthCompareOp = PackGLCompareFunc(depthStencilState.depthFunc);
} }
void PipelineDesc::updateDepthWriteEnabled(const gl::DepthStencilState &depthStencilState)
{
mDepthStencilStateInfo.depthWriteEnable = (depthStencilState.depthMask == GL_FALSE ? 0 : 1);
}
void PipelineDesc::updateStencilTestEnabled(const gl::DepthStencilState &depthStencilState) void PipelineDesc::updateStencilTestEnabled(const gl::DepthStencilState &depthStencilState)
{ {
mDepthStencilStateInfo.stencilTestEnable = static_cast<uint8_t>(depthStencilState.stencilTest); mDepthStencilStateInfo.stencilTestEnable = static_cast<uint8_t>(depthStencilState.stencilTest);
......
...@@ -297,10 +297,12 @@ class PipelineDesc final ...@@ -297,10 +297,12 @@ class PipelineDesc final
void updateBlendColor(const gl::ColorF &color); void updateBlendColor(const gl::ColorF &color);
void updateBlendFuncs(const gl::BlendState &blend_state); void updateBlendFuncs(const gl::BlendState &blend_state);
void updateBlendEquations(const gl::BlendState &blend_state); void updateBlendEquations(const gl::BlendState &blend_state);
void updateColorWriteMask(const gl::BlendState &blendState);
// Depth/stencil states. // Depth/stencil states.
void updateDepthTestEnabled(const gl::DepthStencilState &depthStencilState); void updateDepthTestEnabled(const gl::DepthStencilState &depthStencilState);
void updateDepthFunc(const gl::DepthStencilState &depthStencilState); void updateDepthFunc(const gl::DepthStencilState &depthStencilState);
void updateDepthWriteEnabled(const gl::DepthStencilState &depthStencilState);
void updateStencilTestEnabled(const gl::DepthStencilState &depthStencilState); void updateStencilTestEnabled(const gl::DepthStencilState &depthStencilState);
void updateStencilFrontFuncs(GLint ref, const gl::DepthStencilState &depthStencilState); void updateStencilFrontFuncs(GLint ref, const gl::DepthStencilState &depthStencilState);
void updateStencilBackFuncs(GLint ref, const gl::DepthStencilState &depthStencilState); void updateStencilBackFuncs(GLint ref, const gl::DepthStencilState &depthStencilState);
......
...@@ -188,12 +188,12 @@ ...@@ -188,12 +188,12 @@
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 2455 VULKAN : dEQP-GLES2.functional.color_clear.masked_scissor* = SKIP
2161 VULKAN : dEQP-GLES2.functional.color_clear.complex_* = 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.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.depth_stencil_clear.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.depth_stencil_clear.depth_stencil = 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
2161 VULKAN : dEQP-GLES2.functional.shaders.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.shaders.* = 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