зеркало из https://github.com/AvaloniaUI/angle.git
Vulkan: Split features for dynamic state
When a driver bug with dynamic state is encountered, it is hard to debug which dynamic state exactly is causing an issue, due to the current granularity of disabling all entire state from an extension. With this change, every dynamic state gets its own ANGLE feature, and can be toggled as necessary. Disabling the supportsExtendedDynamicState* features implicitly disables all dependent features. Bug: b/285124778 Bug: b/275210062 Bug: fuchsia:107106 Bug: angleproject:5906 Change-Id: Ic291279872df2d0eb58618ff364ab118bdcc4a9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4577553 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
This commit is contained in:
Родитель
46c92a0afd
Коммит
b0e9bbd79f
|
@ -665,28 +665,71 @@ struct FeaturesVk : FeatureSetBase
|
|||
"Prefer adding HOST_VISIBLE flag for DEVICE_LOCAL memory when picking memory types",
|
||||
&members, "http://anglebug.com/7047"};
|
||||
|
||||
FeatureInfo forceStaticVertexStrideState = {
|
||||
"forceStaticVertexStrideState", FeatureCategory::VulkanWorkarounds,
|
||||
"Force static state for VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT due to "
|
||||
"driver bugs",
|
||||
&members, "https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=107106"};
|
||||
|
||||
FeatureInfo forceStaticPrimitiveRestartState = {
|
||||
"forceStaticPrimitiveRestartState", FeatureCategory::VulkanWorkarounds,
|
||||
"Force static state for VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE due to "
|
||||
"driver bugs",
|
||||
&members, "https://issuetracker.google.com/275210062"};
|
||||
|
||||
FeatureInfo supportsExtendedDynamicState = {
|
||||
"supportsExtendedDynamicState", FeatureCategory::VulkanFeatures,
|
||||
"VkDevice supports VK_EXT_extended_dynamic_state extension", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useVertexInputBindingStrideDynamicState = {
|
||||
"useVertexInputBindingStrideDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Vertex Input Bininding Stride dynamic state from VK_EXT_extended_dynamic_state",
|
||||
&members, "http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useCullModeDynamicState = {
|
||||
"useCullModeDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Cull Mode dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useFrontFaceDynamicState = {
|
||||
"useFrontFaceDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Front Face dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useDepthTestEnableDynamicState = {
|
||||
"useDepthTestEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Depth Test Enable dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useDepthWriteEnableDynamicState = {
|
||||
"useDepthWriteEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Depth Write Enable dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useDepthCompareOpDynamicState = {
|
||||
"useDepthCompareOpDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Depth Compare Op dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useStencilTestEnableDynamicState = {
|
||||
"useStencilTestEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Stencil Test Enable dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useStencilOpDynamicState = {
|
||||
"useStencilOpDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Stencil Op dynamic state from VK_EXT_extended_dynamic_state", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo supportsExtendedDynamicState2 = {
|
||||
"supportsExtendedDynamicState2", FeatureCategory::VulkanFeatures,
|
||||
"VkDevice supports VK_EXT_extended_dynamic_state2 extension", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo usePrimitiveRestartEnableDynamicState = {
|
||||
"usePrimitiveRestartEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Primitive Restart Enable dynamic state from VK_EXT_extended_dynamic_state2",
|
||||
&members, "http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useRasterizerDiscardEnableDynamicState = {
|
||||
"useRasterizerDiscardEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Rasterizer Discard Enable dynamic state from VK_EXT_extended_dynamic_state2",
|
||||
&members, "http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo useDepthBiasEnableDynamicState = {
|
||||
"useDepthBiasEnableDynamicState", FeatureCategory::VulkanWorkarounds,
|
||||
"Use the Depth Bias Enable dynamic state from VK_EXT_extended_dynamic_state2", &members,
|
||||
"http://anglebug.com/5906"};
|
||||
|
||||
FeatureInfo supportsLogicOpDynamicState = {
|
||||
"supportsLogicOpDynamicState", FeatureCategory::VulkanFeatures,
|
||||
"VkDevice supports the logicOp feature of VK_EXT_extended_dynamic_state2 extension",
|
||||
|
|
|
@ -885,24 +885,6 @@
|
|||
],
|
||||
"issue": "http://anglebug.com/7047"
|
||||
},
|
||||
{
|
||||
"name": "force_static_vertex_stride_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Force static state for VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT due to ",
|
||||
"driver bugs"
|
||||
],
|
||||
"issue": "https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=107106"
|
||||
},
|
||||
{
|
||||
"name": "force_static_primitive_restart_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Force static state for VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE due to ",
|
||||
"driver bugs"
|
||||
],
|
||||
"issue": "https://issuetracker.google.com/275210062"
|
||||
},
|
||||
{
|
||||
"name": "supports_extended_dynamic_state",
|
||||
"category": "Features",
|
||||
|
@ -911,6 +893,70 @@
|
|||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_vertex_input_binding_stride_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Vertex Input Bininding Stride dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_cull_mode_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Cull Mode dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_front_face_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Front Face dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_depth_test_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Depth Test Enable dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_depth_write_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Depth Write Enable dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_depth_compare_op_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Depth Compare Op dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_stencil_test_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Stencil Test Enable dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_stencil_op_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Stencil Op dynamic state from VK_EXT_extended_dynamic_state"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "supports_extended_dynamic_state2",
|
||||
"category": "Features",
|
||||
|
@ -919,6 +965,30 @@
|
|||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_primitive_restart_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Primitive Restart Enable dynamic state from VK_EXT_extended_dynamic_state2"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_rasterizer_discard_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Rasterizer Discard Enable dynamic state from VK_EXT_extended_dynamic_state2"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "use_depth_bias_enable_dynamic_state",
|
||||
"category": "Workarounds",
|
||||
"description": [
|
||||
"Use the Depth Bias Enable dynamic state from VK_EXT_extended_dynamic_state2"
|
||||
],
|
||||
"issue": "http://anglebug.com/5906"
|
||||
},
|
||||
{
|
||||
"name": "supports_logic_op_dynamic_state",
|
||||
"category": "Features",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"include/platform/FeaturesMtl_autogen.h":
|
||||
"d7f77feaba4b7c9ecb2dfaf8c58434cd",
|
||||
"include/platform/FeaturesVk_autogen.h":
|
||||
"63f16083728c67a5f5bdabf7bc54ecfe",
|
||||
"f241e22d99f6015a2430d3a924b0f104",
|
||||
"include/platform/FrontendFeatures_autogen.h":
|
||||
"391ebdb90344949e7060cb867a456511",
|
||||
"include/platform/d3d_features.json":
|
||||
|
@ -20,9 +20,9 @@
|
|||
"include/platform/mtl_features.json":
|
||||
"c1430ea5f79a6da446914b467058d9e7",
|
||||
"include/platform/vk_features.json":
|
||||
"76be20c67c167b75e98e48f7b737d1d7",
|
||||
"4bf60b8b8430c680ca789cb48257ea3d",
|
||||
"util/angle_features_autogen.cpp":
|
||||
"e10294f432232273082f6502c2496f80",
|
||||
"4b1d44675b6ed47f2b72194f090c2be9",
|
||||
"util/angle_features_autogen.h":
|
||||
"06ef295619d231b91439914a78e9cdc0"
|
||||
"77c7720ee17584cc374947e74cad8966"
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
"e2fdeb9840527e3d0dc959a67bafdd0e",
|
||||
"src/tests/restricted_traces/restricted_traces.json":
|
||||
"020e7b7275244ec4e66d240bb5c573e0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1063,33 +1063,51 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
|
|||
DIRTY_BIT_DYNAMIC_BLEND_CONSTANTS, DIRTY_BIT_DYNAMIC_STENCIL_COMPARE_MASK,
|
||||
DIRTY_BIT_DYNAMIC_STENCIL_WRITE_MASK, DIRTY_BIT_DYNAMIC_STENCIL_REFERENCE,
|
||||
};
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useVertexInputBindingStrideDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits |= DirtyBits{
|
||||
DIRTY_BIT_DYNAMIC_CULL_MODE, DIRTY_BIT_DYNAMIC_FRONT_FACE,
|
||||
DIRTY_BIT_DYNAMIC_DEPTH_TEST_ENABLE, DIRTY_BIT_DYNAMIC_DEPTH_WRITE_ENABLE,
|
||||
DIRTY_BIT_DYNAMIC_DEPTH_COMPARE_OP, DIRTY_BIT_DYNAMIC_STENCIL_TEST_ENABLE,
|
||||
DIRTY_BIT_DYNAMIC_STENCIL_OP,
|
||||
};
|
||||
|
||||
if (!getFeatures().forceStaticVertexStrideState.enabled)
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_VERTEX_BUFFERS);
|
||||
}
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_VERTEX_BUFFERS);
|
||||
}
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (mRenderer->useCullModeDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits |= DirtyBits{
|
||||
DIRTY_BIT_DYNAMIC_RASTERIZER_DISCARD_ENABLE,
|
||||
DIRTY_BIT_DYNAMIC_DEPTH_BIAS_ENABLE,
|
||||
};
|
||||
|
||||
if (!getFeatures().forceStaticPrimitiveRestartState.enabled)
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_PRIMITIVE_RESTART_ENABLE);
|
||||
}
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_CULL_MODE);
|
||||
}
|
||||
if (getFeatures().supportsLogicOpDynamicState.enabled)
|
||||
if (mRenderer->useFrontFaceDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_FRONT_FACE);
|
||||
}
|
||||
if (mRenderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_TEST_ENABLE);
|
||||
}
|
||||
if (mRenderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_WRITE_ENABLE);
|
||||
}
|
||||
if (mRenderer->useDepthCompareOpDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_COMPARE_OP);
|
||||
}
|
||||
if (mRenderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_TEST_ENABLE);
|
||||
}
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_OP);
|
||||
}
|
||||
if (mRenderer->usePrimitiveRestartEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_PRIMITIVE_RESTART_ENABLE);
|
||||
}
|
||||
if (mRenderer->useRasterizerDiscardEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_RASTERIZER_DISCARD_ENABLE);
|
||||
}
|
||||
if (mRenderer->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_BIAS_ENABLE);
|
||||
}
|
||||
if (mRenderer->useLogicOpDynamicState())
|
||||
{
|
||||
mDynamicStateDirtyBits.set(DIRTY_BIT_DYNAMIC_LOGIC_OP);
|
||||
}
|
||||
|
@ -1254,30 +1272,50 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
|
|||
}
|
||||
|
||||
// Dynamic state in VK_EXT_extended_dynamic_state:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useCullModeDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_CULL_FACE_ENABLED);
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_CULL_FACE);
|
||||
}
|
||||
if (mRenderer->useFrontFaceDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_FRONT_FACE);
|
||||
}
|
||||
if (mRenderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_DEPTH_TEST_ENABLED);
|
||||
}
|
||||
if (mRenderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_DEPTH_MASK);
|
||||
}
|
||||
if (mRenderer->useDepthCompareOpDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_DEPTH_FUNC);
|
||||
}
|
||||
if (mRenderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_STENCIL_TEST_ENABLED);
|
||||
}
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_STENCIL_FUNCS_FRONT);
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_STENCIL_FUNCS_BACK);
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_STENCIL_OPS_FRONT);
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_STENCIL_OPS_BACK);
|
||||
}
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
// Dynamic state in VK_EXT_extended_dynamic_state2:
|
||||
if (mRenderer->usePrimitiveRestartEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_PRIMITIVE_RESTART_ENABLED);
|
||||
}
|
||||
if (mRenderer->useRasterizerDiscardEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_RASTERIZER_DISCARD_ENABLED);
|
||||
}
|
||||
if (mRenderer->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_POLYGON_OFFSET_FILL_ENABLED);
|
||||
|
||||
if (!getFeatures().forceStaticPrimitiveRestartState.enabled)
|
||||
{
|
||||
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_PRIMITIVE_RESTART_ENABLED);
|
||||
}
|
||||
}
|
||||
|
||||
angle::PerfMonitorCounterGroup vulkanGroup;
|
||||
|
@ -2639,8 +2677,7 @@ angle::Result ContextVk::handleDirtyGraphicsVertexBuffers(DirtyBits::Iterator *d
|
|||
const gl::AttribArray<VkDeviceSize> &bufferOffsets =
|
||||
vertexArrayVk->getCurrentArrayBufferOffsets();
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
!getFeatures().forceStaticVertexStrideState.enabled)
|
||||
if (mRenderer->useVertexInputBindingStrideDynamicState())
|
||||
{
|
||||
const gl::AttribArray<GLuint> &bufferStrides =
|
||||
vertexArrayVk->getCurrentArrayBufferStrides();
|
||||
|
@ -4952,7 +4989,7 @@ void ContextVk::updateViewport(FramebufferVk *framebufferVk,
|
|||
|
||||
void ContextVk::updateFrontFace()
|
||||
{
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useFrontFaceDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_FRONT_FACE);
|
||||
}
|
||||
|
@ -5020,7 +5057,7 @@ void ContextVk::updateDepthTestEnabled(const gl::State &glState)
|
|||
const gl::DepthStencilState depthStencilState = glState.getDepthStencilState();
|
||||
gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_TEST_ENABLE);
|
||||
}
|
||||
|
@ -5036,7 +5073,7 @@ void ContextVk::updateDepthWriteEnabled(const gl::State &glState)
|
|||
const gl::DepthStencilState depthStencilState = glState.getDepthStencilState();
|
||||
gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_WRITE_ENABLE);
|
||||
}
|
||||
|
@ -5049,7 +5086,7 @@ void ContextVk::updateDepthWriteEnabled(const gl::State &glState)
|
|||
|
||||
void ContextVk::updateDepthFunc(const gl::State &glState)
|
||||
{
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useDepthCompareOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_COMPARE_OP);
|
||||
}
|
||||
|
@ -5065,7 +5102,7 @@ void ContextVk::updateStencilTestEnabled(const gl::State &glState)
|
|||
const gl::DepthStencilState depthStencilState = glState.getDepthStencilState();
|
||||
gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_TEST_ENABLE);
|
||||
}
|
||||
|
@ -5129,7 +5166,7 @@ void ContextVk::updateRasterizerDiscardEnabled(bool isPrimitivesGeneratedQueryAc
|
|||
isEmulatingRasterizerDiscardDuringPrimitivesGeneratedQuery(
|
||||
isPrimitivesGeneratedQueryActive);
|
||||
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (mRenderer->useRasterizerDiscardEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_RASTERIZER_DISCARD_ENABLE);
|
||||
}
|
||||
|
@ -5423,7 +5460,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
onDepthStencilAccessChange();
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_STENCIL_FUNCS_FRONT:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_OP);
|
||||
}
|
||||
|
@ -5437,7 +5474,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
onDepthStencilAccessChange();
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_STENCIL_FUNCS_BACK:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_OP);
|
||||
}
|
||||
|
@ -5451,7 +5488,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
onDepthStencilAccessChange();
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_STENCIL_OPS_FRONT:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_OP);
|
||||
}
|
||||
|
@ -5463,7 +5500,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
onDepthStencilAccessChange();
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_STENCIL_OPS_BACK:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useStencilOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_STENCIL_OP);
|
||||
}
|
||||
|
@ -5481,7 +5518,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
break;
|
||||
case gl::State::DIRTY_BIT_CULL_FACE_ENABLED:
|
||||
case gl::State::DIRTY_BIT_CULL_FACE:
|
||||
if (getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (mRenderer->useCullModeDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_CULL_MODE);
|
||||
}
|
||||
|
@ -5495,7 +5532,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
updateFrontFace();
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_POLYGON_OFFSET_FILL_ENABLED:
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (mRenderer->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_BIAS_ENABLE);
|
||||
}
|
||||
|
@ -5517,8 +5554,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_LINE_WIDTH);
|
||||
break;
|
||||
case gl::State::DIRTY_BIT_PRIMITIVE_RESTART_ENABLED:
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled &&
|
||||
!getFeatures().forceStaticPrimitiveRestartState.enabled)
|
||||
if (mRenderer->usePrimitiveRestartEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_PRIMITIVE_RESTART_ENABLE);
|
||||
}
|
||||
|
@ -5800,7 +5836,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
break;
|
||||
case gl::State::EXTENDED_DIRTY_BIT_POLYGON_OFFSET_POINT_ENABLED:
|
||||
case gl::State::EXTENDED_DIRTY_BIT_POLYGON_OFFSET_LINE_ENABLED:
|
||||
if (getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (mRenderer->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_DEPTH_BIAS_ENABLE);
|
||||
}
|
||||
|
@ -5817,7 +5853,7 @@ angle::Result ContextVk::syncState(const gl::Context *context,
|
|||
&mGraphicsPipelineTransition, glState.isLogicOpEnabled());
|
||||
break;
|
||||
case gl::State::EXTENDED_DIRTY_BIT_LOGIC_OP:
|
||||
if (getFeatures().supportsLogicOpDynamicState.enabled)
|
||||
if (mRenderer->useLogicOpDynamicState())
|
||||
{
|
||||
mGraphicsDirtyBits.set(DIRTY_BIT_DYNAMIC_LOGIC_OP);
|
||||
}
|
||||
|
|
|
@ -1655,10 +1655,7 @@ ANGLE_INLINE angle::Result ContextVk::onVertexAttributeChange(size_t attribIndex
|
|||
GLuint relativeOffset,
|
||||
const vk::BufferHelper *vertexBuffer)
|
||||
{
|
||||
const GLuint staticStride = getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
!getFeatures().forceStaticVertexStrideState.enabled
|
||||
? 0
|
||||
: stride;
|
||||
const GLuint staticStride = mRenderer->useVertexInputBindingStrideDynamicState() ? 0 : stride;
|
||||
|
||||
invalidateCurrentGraphicsPipeline();
|
||||
|
||||
|
|
|
@ -3116,7 +3116,7 @@ void RendererVk::initDeviceExtensionEntryPoints()
|
|||
{
|
||||
InitTransformFeedbackEXTFunctions(mDevice);
|
||||
}
|
||||
if (mFeatures.supportsLogicOpDynamicState.enabled)
|
||||
if (useLogicOpDynamicState())
|
||||
{
|
||||
// VK_EXT_extended_dynamic_state2 is only partially core in Vulkan 1.3. If the logicOp
|
||||
// dynamic state (only from the extension) is used, need to load the entry points from the
|
||||
|
@ -4388,9 +4388,35 @@ void RendererVk::initFeatures(DisplayVk *displayVk,
|
|||
ANGLE_FEATURE_CONDITION(&mFeatures, supportsExtendedDynamicState,
|
||||
mExtendedDynamicStateFeatures.extendedDynamicState == VK_TRUE);
|
||||
|
||||
// By default, use all state from VK_EXT_extended_dynamic_state, unless they hit driver bugs.
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useVertexInputBindingStrideDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled && !isARM);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useCullModeDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useDepthCompareOpDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useDepthTestEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useDepthWriteEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useFrontFaceDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useStencilOpDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useStencilTestEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled);
|
||||
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, supportsExtendedDynamicState2,
|
||||
mExtendedDynamicState2Features.extendedDynamicState2 == VK_TRUE);
|
||||
|
||||
// By default, use all state from VK_EXT_extended_dynamic_state, unless they hit driver bugs.
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, usePrimitiveRestartEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState2.enabled && !isARM);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useRasterizerDiscardEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState2.enabled);
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, useDepthBiasEnableDynamicState,
|
||||
mFeatures.supportsExtendedDynamicState2.enabled);
|
||||
|
||||
// Disabled on Intel/Mesa due to driver bug (crbug.com/1379201). This bug is fixed since Mesa
|
||||
// 22.2.0.
|
||||
const bool isMesaLessThan22_2 =
|
||||
|
@ -4402,14 +4428,6 @@ void RendererVk::initFeatures(DisplayVk *displayVk,
|
|||
mExtendedDynamicState2Features.extendedDynamicState2LogicOp == VK_TRUE &&
|
||||
!(IsLinux() && isIntel && isMesaLessThan22_2) && !(IsAndroid() && isGalaxyS23));
|
||||
|
||||
// Avoid dynamic state for vertex input binding stride on buggy drivers.
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, forceStaticVertexStrideState,
|
||||
mFeatures.supportsExtendedDynamicState.enabled && isARM);
|
||||
|
||||
// Avoid dynamic state for primitive restart on buggy drivers.
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, forceStaticPrimitiveRestartState,
|
||||
mFeatures.supportsExtendedDynamicState2.enabled && isARM);
|
||||
|
||||
// Support GL_QCOM_shading_rate extension
|
||||
ANGLE_FEATURE_CONDITION(&mFeatures, supportsFragmentShadingRate,
|
||||
canSupportFragmentShadingRate(deviceExtensionNames));
|
||||
|
|
|
@ -650,6 +650,70 @@ class RendererVk : angle::NonCopyable
|
|||
return getFeatures().preferLinearFilterForYUV.enabled ? VK_FILTER_LINEAR : defaultFilter;
|
||||
}
|
||||
|
||||
// Convenience helpers to check for dynamic state ANGLE features which depend on the more
|
||||
// encompassing feature for support of the relevant extension. When the extension-support
|
||||
// feature is disabled, the derived dynamic state is automatically disabled.
|
||||
ANGLE_INLINE bool useVertexInputBindingStrideDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useVertexInputBindingStrideDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useCullModeDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useCullModeDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useDepthCompareOpDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useDepthCompareOpDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useDepthTestEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useDepthTestEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useDepthWriteEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useDepthWriteEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useFrontFaceDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useFrontFaceDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useStencilOpDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useStencilOpDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useStencilTestEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState.enabled &&
|
||||
getFeatures().useStencilTestEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool usePrimitiveRestartEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState2.enabled &&
|
||||
getFeatures().usePrimitiveRestartEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useRasterizerDiscardEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState2.enabled &&
|
||||
getFeatures().useRasterizerDiscardEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useDepthBiasEnableDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState2.enabled &&
|
||||
getFeatures().useDepthBiasEnableDynamicState.enabled;
|
||||
}
|
||||
ANGLE_INLINE bool useLogicOpDynamicState()
|
||||
{
|
||||
return getFeatures().supportsExtendedDynamicState2.enabled &&
|
||||
getFeatures().supportsLogicOpDynamicState.enabled;
|
||||
}
|
||||
|
||||
angle::Result allocateScopedQueueSerialIndex(vk::ScopedQueueSerialIndex *indexOut);
|
||||
angle::Result allocateQueueSerialIndex(SerialIndex *serialIndexOut);
|
||||
size_t getLargestQueueSerialIndexEverAllocated() const
|
||||
|
|
|
@ -387,24 +387,97 @@ void CalculateResolveOffset(const UtilsVk::BlitResolveParameters ¶ms, int32_
|
|||
offset[1] = params.dstOffset[1] - params.srcOffset[1] * srcOffsetFactorY;
|
||||
}
|
||||
|
||||
// Sets the appropriate settings in the pipeline for either the shader to output stencil, regardless
|
||||
// of whether its done through the reference value or the shader stencil export extension.
|
||||
void SetStencilStateForWrite(vk::GraphicsPipelineDesc *desc)
|
||||
void SetDepthStateForWrite(RendererVk *renderer, vk::GraphicsPipelineDesc *desc)
|
||||
{
|
||||
desc->setStencilTestEnabled(true);
|
||||
desc->setStencilFrontFuncs(VK_COMPARE_OP_ALWAYS);
|
||||
desc->setStencilBackFuncs(VK_COMPARE_OP_ALWAYS);
|
||||
desc->setStencilFrontOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE);
|
||||
desc->setStencilBackOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE);
|
||||
if (!renderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
desc->setDepthTestEnabled(VK_TRUE);
|
||||
}
|
||||
if (!renderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
desc->setDepthWriteEnabled(VK_TRUE);
|
||||
}
|
||||
if (!renderer->useDepthCompareOpDynamicState())
|
||||
{
|
||||
desc->setDepthFunc(VK_COMPARE_OP_ALWAYS);
|
||||
}
|
||||
}
|
||||
|
||||
void SetStencilDynamicStateForWrite(vk::RenderPassCommandBuffer *commandBuffer)
|
||||
void SetDepthStateForUnused(RendererVk *renderer, vk::GraphicsPipelineDesc *desc)
|
||||
{
|
||||
commandBuffer->setStencilTestEnable(true);
|
||||
commandBuffer->setStencilOp(VK_STENCIL_FACE_FRONT_BIT, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_COMPARE_OP_ALWAYS);
|
||||
commandBuffer->setStencilOp(VK_STENCIL_FACE_BACK_BIT, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_COMPARE_OP_ALWAYS);
|
||||
if (!renderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
desc->setDepthTestEnabled(VK_FALSE);
|
||||
}
|
||||
if (!renderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
desc->setDepthWriteEnabled(VK_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void SetDepthDynamicStateForWrite(RendererVk *renderer, vk::RenderPassCommandBuffer *commandBuffer)
|
||||
{
|
||||
if (renderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_TRUE);
|
||||
}
|
||||
if (renderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthWriteEnable(VK_TRUE);
|
||||
}
|
||||
if (renderer->useDepthCompareOpDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthCompareOp(VK_COMPARE_OP_ALWAYS);
|
||||
}
|
||||
}
|
||||
|
||||
void SetDepthDynamicStateForUnused(RendererVk *renderer, vk::RenderPassCommandBuffer *commandBuffer)
|
||||
{
|
||||
if (renderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_FALSE);
|
||||
}
|
||||
if (renderer->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthWriteEnable(VK_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the appropriate settings in the pipeline for either the shader to output stencil, regardless
|
||||
// of whether its done through the reference value or the shader stencil export extension.
|
||||
void SetStencilStateForWrite(RendererVk *renderer, vk::GraphicsPipelineDesc *desc)
|
||||
{
|
||||
if (!renderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
desc->setStencilTestEnabled(true);
|
||||
}
|
||||
if (!renderer->useStencilOpDynamicState())
|
||||
{
|
||||
desc->setStencilFrontFuncs(VK_COMPARE_OP_ALWAYS);
|
||||
desc->setStencilBackFuncs(VK_COMPARE_OP_ALWAYS);
|
||||
desc->setStencilFrontOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE);
|
||||
desc->setStencilBackOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
void SetStencilDynamicStateForWrite(RendererVk *renderer,
|
||||
vk::RenderPassCommandBuffer *commandBuffer)
|
||||
{
|
||||
if (renderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setStencilTestEnable(true);
|
||||
}
|
||||
if (renderer->useStencilOpDynamicState())
|
||||
{
|
||||
commandBuffer->setStencilOp(VK_STENCIL_FACE_FRONT_BIT, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE,
|
||||
VK_COMPARE_OP_ALWAYS);
|
||||
commandBuffer->setStencilOp(VK_STENCIL_FACE_BACK_BIT, VK_STENCIL_OP_REPLACE,
|
||||
VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE,
|
||||
VK_COMPARE_OP_ALWAYS);
|
||||
}
|
||||
}
|
||||
|
||||
namespace unresolve
|
||||
|
@ -1094,22 +1167,36 @@ void ResetDynamicState(ContextVk *contextVk, vk::RenderPassCommandBuffer *comman
|
|||
// - stencil func: UtilsVk sets this when enabling stencil test
|
||||
// - stencil ops: UtilsVk sets this when enabling stencil test
|
||||
|
||||
RendererVk *renderer = contextVk->getRenderer();
|
||||
|
||||
// Reset all other dynamic state, since it can affect UtilsVk functions:
|
||||
if (contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (renderer->useCullModeDynamicState())
|
||||
{
|
||||
commandBuffer->setCullMode(VK_CULL_MODE_NONE);
|
||||
}
|
||||
if (renderer->useFrontFaceDynamicState())
|
||||
{
|
||||
commandBuffer->setFrontFace(VK_FRONT_FACE_COUNTER_CLOCKWISE);
|
||||
}
|
||||
if (renderer->useDepthTestEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_FALSE);
|
||||
}
|
||||
if (renderer->useStencilTestEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setStencilTestEnable(VK_FALSE);
|
||||
}
|
||||
if (contextVk->getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (renderer->useRasterizerDiscardEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setRasterizerDiscardEnable(VK_FALSE);
|
||||
}
|
||||
if (renderer->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setDepthBiasEnable(VK_FALSE);
|
||||
if (!contextVk->getFeatures().forceStaticPrimitiveRestartState.enabled)
|
||||
{
|
||||
commandBuffer->setPrimitiveRestartEnable(VK_FALSE);
|
||||
}
|
||||
}
|
||||
if (renderer->usePrimitiveRestartEnableDynamicState())
|
||||
{
|
||||
commandBuffer->setPrimitiveRestartEnable(VK_FALSE);
|
||||
}
|
||||
if (contextVk->getFeatures().supportsFragmentShadingRate.enabled)
|
||||
{
|
||||
|
@ -1119,7 +1206,7 @@ void ResetDynamicState(ContextVk *contextVk, vk::RenderPassCommandBuffer *comman
|
|||
VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR};
|
||||
commandBuffer->setFragmentShadingRate(&fragmentSize, shadingRateCombinerOp);
|
||||
}
|
||||
if (contextVk->getFeatures().supportsLogicOpDynamicState.enabled)
|
||||
if (renderer->useLogicOpDynamicState())
|
||||
{
|
||||
commandBuffer->setLogicOp(VK_LOGIC_OP_COPY);
|
||||
}
|
||||
|
@ -2185,6 +2272,8 @@ angle::Result UtilsVk::clearFramebuffer(ContextVk *contextVk,
|
|||
FramebufferVk *framebuffer,
|
||||
const ClearFramebufferParameters ¶ms)
|
||||
{
|
||||
RendererVk *renderer = contextVk->getRenderer();
|
||||
|
||||
ANGLE_TRY(ensureImageClearResourcesInitialized(contextVk));
|
||||
|
||||
const gl::Rectangle &scissoredRenderArea = params.clearArea;
|
||||
|
@ -2227,16 +2316,10 @@ angle::Result UtilsVk::clearFramebuffer(ContextVk *contextVk,
|
|||
|
||||
// Clear depth by enabling depth clamping and setting the viewport depth range to the clear
|
||||
// value if possible. Otherwise use the shader to export depth.
|
||||
const bool supportsDepthClamp =
|
||||
contextVk->getRenderer()->getPhysicalDeviceFeatures().depthClamp == VK_TRUE;
|
||||
const bool supportsDepthClamp = renderer->getPhysicalDeviceFeatures().depthClamp == VK_TRUE;
|
||||
if (params.clearDepth)
|
||||
{
|
||||
if (!contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
{
|
||||
pipelineDesc.setDepthTestEnabled(true);
|
||||
pipelineDesc.setDepthWriteEnabled(true);
|
||||
pipelineDesc.setDepthFunc(VK_COMPARE_OP_ALWAYS);
|
||||
}
|
||||
SetDepthStateForWrite(renderer, &pipelineDesc);
|
||||
if (supportsDepthClamp)
|
||||
{
|
||||
// Note: this path requires the depthClamp Vulkan feature.
|
||||
|
@ -2245,9 +2328,9 @@ angle::Result UtilsVk::clearFramebuffer(ContextVk *contextVk,
|
|||
}
|
||||
|
||||
// Clear stencil by enabling stencil write with the right mask.
|
||||
if (params.clearStencil && !contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (params.clearStencil)
|
||||
{
|
||||
SetStencilStateForWrite(&pipelineDesc);
|
||||
SetStencilStateForWrite(renderer, &pipelineDesc);
|
||||
}
|
||||
|
||||
vk::ShaderLibrary &shaderLibrary = contextVk->getShaderLibrary();
|
||||
|
@ -2291,11 +2374,9 @@ angle::Result UtilsVk::clearFramebuffer(ContextVk *contextVk,
|
|||
const VkRect2D scissor = gl_vk::GetRect(params.clearArea);
|
||||
commandBuffer->setScissor(0, 1, &scissor);
|
||||
|
||||
if (params.clearDepth && contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (params.clearDepth)
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_TRUE);
|
||||
commandBuffer->setDepthWriteEnable(VK_TRUE);
|
||||
commandBuffer->setDepthCompareOp(VK_COMPARE_OP_ALWAYS);
|
||||
SetDepthDynamicStateForWrite(renderer, commandBuffer);
|
||||
}
|
||||
|
||||
if (params.clearStencil)
|
||||
|
@ -2308,10 +2389,7 @@ angle::Result UtilsVk::clearFramebuffer(ContextVk *contextVk,
|
|||
commandBuffer->setStencilWriteMask(params.stencilMask, params.stencilMask);
|
||||
commandBuffer->setStencilReference(clearStencilValue, clearStencilValue);
|
||||
|
||||
if (contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
{
|
||||
SetStencilDynamicStateForWrite(commandBuffer);
|
||||
}
|
||||
SetStencilDynamicStateForWrite(contextVk->getRenderer(), commandBuffer);
|
||||
}
|
||||
|
||||
ASSERT(contextVk->hasStartedRenderPassWithQueueSerial(
|
||||
|
@ -2500,6 +2578,7 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
|
|||
// constant.
|
||||
//
|
||||
// The second method is implemented in this function, which shares code with the resolve method.
|
||||
RendererVk *renderer = contextVk->getRenderer();
|
||||
|
||||
ANGLE_TRY(ensureBlitResolveResourcesInitialized(contextVk));
|
||||
|
||||
|
@ -2591,16 +2670,14 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
|
|||
pipelineDesc.setColorWriteMasks(0, gl::DrawBufferMask(), gl::DrawBufferMask());
|
||||
}
|
||||
pipelineDesc.setRenderPassDesc(framebuffer->getRenderPassDesc());
|
||||
if (blitDepth && !contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (blitDepth)
|
||||
{
|
||||
pipelineDesc.setDepthTestEnabled(VK_TRUE);
|
||||
pipelineDesc.setDepthWriteEnabled(VK_TRUE);
|
||||
pipelineDesc.setDepthFunc(VK_COMPARE_OP_ALWAYS);
|
||||
SetDepthStateForWrite(renderer, &pipelineDesc);
|
||||
}
|
||||
|
||||
if (blitStencil && !contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (blitStencil)
|
||||
{
|
||||
SetStencilStateForWrite(&pipelineDesc);
|
||||
SetStencilStateForWrite(renderer, &pipelineDesc);
|
||||
}
|
||||
|
||||
// All deferred clear must have been flushed, otherwise it will conflict with params.blitArea.
|
||||
|
@ -2694,11 +2771,9 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
|
|||
VkRect2D scissor = gl_vk::GetRect(params.blitArea);
|
||||
commandBuffer->setScissor(0, 1, &scissor);
|
||||
|
||||
if (blitDepth && contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (blitDepth)
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_TRUE);
|
||||
commandBuffer->setDepthWriteEnable(VK_TRUE);
|
||||
commandBuffer->setDepthCompareOp(VK_COMPARE_OP_ALWAYS);
|
||||
SetDepthDynamicStateForWrite(renderer, commandBuffer);
|
||||
}
|
||||
|
||||
if (blitStencil)
|
||||
|
@ -2710,10 +2785,7 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
|
|||
commandBuffer->setStencilWriteMask(kCompleteMask, kCompleteMask);
|
||||
commandBuffer->setStencilReference(kUnusedReference, kUnusedReference);
|
||||
|
||||
if (contextVk->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
{
|
||||
SetStencilDynamicStateForWrite(commandBuffer);
|
||||
}
|
||||
SetStencilDynamicStateForWrite(renderer, commandBuffer);
|
||||
}
|
||||
|
||||
// Note: this utility starts the render pass directly, thus bypassing
|
||||
|
@ -3608,6 +3680,8 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
const FramebufferVk *framebuffer,
|
||||
const UnresolveParameters ¶ms)
|
||||
{
|
||||
RendererVk *renderer = contextVk->getRenderer();
|
||||
|
||||
// Get attachment count and pointers to resolve images and views.
|
||||
gl::DrawBuffersArray<vk::ImageHelper *> colorSrc = {};
|
||||
gl::DrawBuffersArray<const vk::ImageView *> colorSrcView = {};
|
||||
|
@ -3678,9 +3752,6 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
pipelineDesc.setRasterizationSamples(framebuffer->getSamples());
|
||||
pipelineDesc.setRenderPassDesc(framebuffer->getRenderPassDesc());
|
||||
|
||||
const bool hasExtendedDynamicState =
|
||||
contextVk->getFeatures().supportsExtendedDynamicState.enabled;
|
||||
|
||||
vk::RenderPassCommandBuffer *commandBuffer =
|
||||
&contextVk->getStartedRenderPassCommands().getCommandBuffer();
|
||||
|
||||
|
@ -3719,16 +3790,14 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
|
||||
ANGLE_TRY(ensureUnresolveResourcesInitialized(contextVk, function, totalBindingCount));
|
||||
|
||||
if (params.unresolveDepth && !hasExtendedDynamicState)
|
||||
if (params.unresolveDepth)
|
||||
{
|
||||
pipelineDesc.setDepthTestEnabled(VK_TRUE);
|
||||
pipelineDesc.setDepthWriteEnabled(VK_TRUE);
|
||||
pipelineDesc.setDepthFunc(VK_COMPARE_OP_ALWAYS);
|
||||
SetDepthStateForWrite(renderer, &pipelineDesc);
|
||||
}
|
||||
|
||||
if (unresolveStencilWithShaderExport && !hasExtendedDynamicState)
|
||||
if (unresolveStencilWithShaderExport)
|
||||
{
|
||||
SetStencilStateForWrite(&pipelineDesc);
|
||||
SetStencilStateForWrite(renderer, &pipelineDesc);
|
||||
}
|
||||
|
||||
VkDescriptorSet descriptorSet;
|
||||
|
@ -3785,11 +3854,9 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
&mUnresolve[flags], &pipelineDesc, descriptorSet, nullptr, 0,
|
||||
commandBuffer));
|
||||
|
||||
if (params.unresolveDepth && hasExtendedDynamicState)
|
||||
if (params.unresolveDepth)
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_TRUE);
|
||||
commandBuffer->setDepthWriteEnable(VK_TRUE);
|
||||
commandBuffer->setDepthCompareOp(VK_COMPARE_OP_ALWAYS);
|
||||
SetDepthDynamicStateForWrite(renderer, commandBuffer);
|
||||
}
|
||||
|
||||
if (unresolveStencilWithShaderExport)
|
||||
|
@ -3801,10 +3868,7 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
commandBuffer->setStencilWriteMask(kCompleteMask, kCompleteMask);
|
||||
commandBuffer->setStencilReference(kUnusedReference, kUnusedReference);
|
||||
|
||||
if (hasExtendedDynamicState)
|
||||
{
|
||||
SetStencilDynamicStateForWrite(commandBuffer);
|
||||
}
|
||||
SetStencilDynamicStateForWrite(renderer, commandBuffer);
|
||||
}
|
||||
|
||||
// This draw call is made before ContextVk gets a chance to start the occlusion query. As
|
||||
|
@ -3822,13 +3886,8 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
// Disable color and depth output, and only let stencil through.
|
||||
pipelineDesc.setColorWriteMasks(0, gl::DrawBufferMask(), gl::DrawBufferMask());
|
||||
|
||||
if (!hasExtendedDynamicState)
|
||||
{
|
||||
pipelineDesc.setDepthTestEnabled(VK_FALSE);
|
||||
pipelineDesc.setDepthWriteEnabled(VK_FALSE);
|
||||
|
||||
SetStencilStateForWrite(&pipelineDesc);
|
||||
}
|
||||
SetDepthStateForUnused(renderer, &pipelineDesc);
|
||||
SetStencilStateForWrite(renderer, &pipelineDesc);
|
||||
|
||||
vk::RefCounted<vk::ShaderModule> *exportStencilShader = nullptr;
|
||||
ANGLE_TRY(shaderLibrary.getExportStencil_frag(contextVk, 0, &exportStencilShader));
|
||||
|
@ -3856,13 +3915,8 @@ angle::Result UtilsVk::unresolve(ContextVk *contextVk,
|
|||
exportStencilShader, &mExportStencil, &pipelineDesc,
|
||||
exportStencilDescriptorSet, nullptr, 0, commandBuffer));
|
||||
|
||||
if (hasExtendedDynamicState)
|
||||
{
|
||||
commandBuffer->setDepthTestEnable(VK_FALSE);
|
||||
commandBuffer->setDepthWriteEnable(VK_FALSE);
|
||||
|
||||
SetStencilDynamicStateForWrite(commandBuffer);
|
||||
}
|
||||
SetDepthDynamicStateForUnused(renderer, commandBuffer);
|
||||
SetStencilDynamicStateForWrite(renderer, commandBuffer);
|
||||
|
||||
constexpr uint8_t kCompareMask = 0xFF;
|
||||
constexpr uint8_t kReference = 0xFF;
|
||||
|
|
|
@ -172,8 +172,7 @@ VertexArrayVk::VertexArrayVk(ContextVk *contextVk, const gl::VertexArrayState &s
|
|||
mCurrentArrayBufferStrides.fill(0);
|
||||
|
||||
mBindingDirtyBitsRequiresPipelineUpdate.set(gl::VertexArray::DIRTY_BINDING_DIVISOR);
|
||||
if (!contextVk->getRenderer()->getFeatures().supportsExtendedDynamicState.enabled ||
|
||||
contextVk->getRenderer()->getFeatures().forceStaticVertexStrideState.enabled)
|
||||
if (!contextVk->getRenderer()->useVertexInputBindingStrideDynamicState())
|
||||
{
|
||||
mBindingDirtyBitsRequiresPipelineUpdate.set(gl::VertexArray::DIRTY_BINDING_STRIDE);
|
||||
}
|
||||
|
|
|
@ -2912,8 +2912,7 @@ const void *GraphicsPipelineDesc::getPipelineSubsetMemory(GraphicsPipelineSubset
|
|||
sizeof(GraphicsPipelineDesc));
|
||||
|
||||
size_t vertexInputReduceSize = 0;
|
||||
if (mVertexInput.inputAssembly.bits.supportsDynamicState1 &&
|
||||
!mVertexInput.inputAssembly.bits.forceStaticVertexStrideState)
|
||||
if (mVertexInput.inputAssembly.bits.useVertexInputBindingStrideDynamicState)
|
||||
{
|
||||
vertexInputReduceSize = sizeof(PackedVertexInputAttributes::strides);
|
||||
}
|
||||
|
@ -2957,9 +2956,9 @@ bool GraphicsPipelineDesc::keyEqual(const GraphicsPipelineDesc &other,
|
|||
const void *otherKey = other.getPipelineSubsetMemory(subset, &otherKeySize);
|
||||
|
||||
// Compare the relevant part of the desc memory. Note that due to workarounds (e.g.
|
||||
// forceStaticVertexStrideState), |this| or |other| may produce different key sizes. In that
|
||||
// case, comparing the minimum of the two is sufficient; if the workarounds are different, the
|
||||
// comparison would fail anyway.
|
||||
// useVertexInputBindingStrideDynamicState), |this| or |other| may produce different key sizes.
|
||||
// In that case, comparing the minimum of the two is sufficient; if the workarounds are
|
||||
// different, the comparison would fail anyway.
|
||||
return memcmp(key, otherKey, std::min(keySize, otherKeySize)) == 0;
|
||||
}
|
||||
|
||||
|
@ -2988,10 +2987,8 @@ void GraphicsPipelineDesc::initDefaults(const ContextVk *contextVk, GraphicsPipe
|
|||
|
||||
SetBitField(mVertexInput.inputAssembly.bits.topology, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);
|
||||
mVertexInput.inputAssembly.bits.primitiveRestartEnable = 0;
|
||||
mVertexInput.inputAssembly.bits.supportsDynamicState1 =
|
||||
contextVk->getFeatures().supportsExtendedDynamicState.enabled;
|
||||
mVertexInput.inputAssembly.bits.forceStaticVertexStrideState =
|
||||
contextVk->getFeatures().forceStaticVertexStrideState.enabled;
|
||||
mVertexInput.inputAssembly.bits.useVertexInputBindingStrideDynamicState =
|
||||
contextVk->getRenderer()->useVertexInputBindingStrideDynamicState();
|
||||
mVertexInput.inputAssembly.bits.padding = 0;
|
||||
}
|
||||
|
||||
|
@ -3348,8 +3345,7 @@ void GraphicsPipelineDesc::initializePipelineVertexInputState(
|
|||
// If using dynamic state for stride, the value for stride is unconditionally 0 here.
|
||||
// |ContextVk::handleDirtyGraphicsVertexBuffers| implements the same fix when setting stride
|
||||
// dynamically.
|
||||
ASSERT(!context->getFeatures().supportsExtendedDynamicState.enabled ||
|
||||
context->getFeatures().forceStaticVertexStrideState.enabled ||
|
||||
ASSERT(!context->getRenderer()->useVertexInputBindingStrideDynamicState() ||
|
||||
bindingDesc.stride == 0);
|
||||
|
||||
if (attribType != programAttribType)
|
||||
|
@ -3421,19 +3417,13 @@ void GraphicsPipelineDesc::initializePipelineVertexInputState(
|
|||
static_cast<VkBool32>(inputAssembly.bits.primitiveRestartEnable);
|
||||
|
||||
// Dynamic state
|
||||
if (context->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (context->getRenderer()->useVertexInputBindingStrideDynamicState() && vertexAttribCount > 0)
|
||||
{
|
||||
if (vertexAttribCount > 0 && !context->getFeatures().forceStaticVertexStrideState.enabled)
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE);
|
||||
}
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE);
|
||||
}
|
||||
if (context->getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (context->getRenderer()->usePrimitiveRestartEnableDynamicState())
|
||||
{
|
||||
if (!context->getFeatures().forceStaticPrimitiveRestartState.enabled)
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE);
|
||||
}
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3625,19 +3615,40 @@ void GraphicsPipelineDesc::initializePipelineShadersState(
|
|||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK);
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK);
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_STENCIL_REFERENCE);
|
||||
if (context->getFeatures().supportsExtendedDynamicState.enabled)
|
||||
if (context->getRenderer()->useCullModeDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_CULL_MODE_EXT);
|
||||
}
|
||||
if (context->getRenderer()->useFrontFaceDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_FRONT_FACE_EXT);
|
||||
}
|
||||
if (context->getRenderer()->useDepthTestEnableDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE);
|
||||
}
|
||||
if (context->getRenderer()->useDepthWriteEnableDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE);
|
||||
}
|
||||
if (context->getRenderer()->useDepthCompareOpDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_DEPTH_COMPARE_OP);
|
||||
}
|
||||
if (context->getRenderer()->useStencilTestEnableDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE);
|
||||
}
|
||||
if (context->getRenderer()->useStencilOpDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_STENCIL_OP);
|
||||
}
|
||||
if (context->getFeatures().supportsExtendedDynamicState2.enabled)
|
||||
if (context->getRenderer()->useRasterizerDiscardEnableDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE);
|
||||
}
|
||||
if (context->getRenderer()->useDepthBiasEnableDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE);
|
||||
}
|
||||
if (context->getFeatures().supportsFragmentShadingRate.enabled)
|
||||
|
@ -3766,7 +3777,7 @@ void GraphicsPipelineDesc::initializePipelineFragmentOutputState(
|
|||
|
||||
// Dynamic state
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS);
|
||||
if (context->getFeatures().supportsLogicOpDynamicState.enabled)
|
||||
if (context->getRenderer()->useLogicOpDynamicState())
|
||||
{
|
||||
dynamicStateListOut->push_back(VK_DYNAMIC_STATE_LOGIC_OP_EXT);
|
||||
}
|
||||
|
@ -3803,8 +3814,7 @@ void GraphicsPipelineDesc::updateVertexInput(ContextVk *contextVk,
|
|||
"Adjust transition bits");
|
||||
transition->set(kBit);
|
||||
|
||||
if (!contextVk->getFeatures().supportsExtendedDynamicState.enabled ||
|
||||
contextVk->getFeatures().forceStaticVertexStrideState.enabled)
|
||||
if (!contextVk->getRenderer()->useVertexInputBindingStrideDynamicState())
|
||||
{
|
||||
SetBitField(mVertexInput.vertex.strides[attribIndex], stride);
|
||||
transition->set(ANGLE_GET_INDEXED_TRANSITION_BIT(
|
||||
|
|
|
@ -410,11 +410,9 @@ struct PackedInputAssemblyState final
|
|||
// Dynamic in VK_EXT_extended_dynamic_state2
|
||||
uint32_t primitiveRestartEnable : 1; // ds2
|
||||
|
||||
// Support for VK_EXT_extended_dynamic_state. Used by GraphicsPipelineDesc::hash() to
|
||||
// exclude |vertexStrides| from the hash
|
||||
uint32_t supportsDynamicState1 : 1;
|
||||
// Workaround driver bug with dynamic vertex stride.
|
||||
uint32_t forceStaticVertexStrideState : 1;
|
||||
// Whether dynamic state for vertex stride from VK_EXT_extended_dynamic_state can be used
|
||||
// for. Used by GraphicsPipelineDesc::hash() to exclude |vertexStrides| from the hash
|
||||
uint32_t useVertexInputBindingStrideDynamicState : 1;
|
||||
|
||||
// Whether the pipeline is robust (vertex input copy)
|
||||
uint32_t isRobustContext : 1;
|
||||
|
@ -424,7 +422,7 @@ struct PackedInputAssemblyState final
|
|||
// Which attributes are actually active in the program and should affect the pipeline.
|
||||
uint32_t programActiveAttributeLocations : gl::MAX_VERTEX_ATTRIBS;
|
||||
|
||||
uint32_t padding : 23 - gl::MAX_VERTEX_ATTRIBS;
|
||||
uint32_t padding : 24 - gl::MAX_VERTEX_ATTRIBS;
|
||||
} bits;
|
||||
};
|
||||
|
||||
|
@ -863,9 +861,8 @@ class GraphicsPipelineDesc final
|
|||
|
||||
void setSupportsDynamicStateForTest(bool supports)
|
||||
{
|
||||
mVertexInput.inputAssembly.bits.supportsDynamicState1 = supports;
|
||||
mVertexInput.inputAssembly.bits.forceStaticVertexStrideState = false;
|
||||
mShaders.shaders.bits.nonZeroStencilWriteMaskWorkaround = false;
|
||||
mVertexInput.inputAssembly.bits.useVertexInputBindingStrideDynamicState = supports;
|
||||
mShaders.shaders.bits.nonZeroStencilWriteMaskWorkaround = false;
|
||||
}
|
||||
|
||||
// Helpers to dump the state
|
||||
|
|
|
@ -508,18 +508,15 @@ TEST_P(AttributeLayoutBufferIndexed, Test)
|
|||
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND(AttributeLayoutNonIndexed,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2));
|
||||
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND(AttributeLayoutMemoryIndexed,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2));
|
||||
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND(AttributeLayoutBufferIndexed,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2));
|
||||
|
||||
#define STRINGIFY2(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY2(X)
|
||||
|
|
|
@ -3828,11 +3828,8 @@ ANGLE_INSTANTIATE_TEST(BlitFramebufferANGLETest,
|
|||
ES3_VULKAN().enable(Feature::EmulatedPrerotation270),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES2_METAL(),
|
||||
ES2_METAL().disable(Feature::HasShaderStencilOutput));
|
||||
|
||||
|
@ -3843,11 +3840,8 @@ ANGLE_INSTANTIATE_TEST_ES3_AND(BlitFramebufferTest,
|
|||
ES3_VULKAN().enable(Feature::EmulatedPrerotation270),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().enable(Feature::DisableFlippingBlitWithCommand),
|
||||
ES3_METAL().disable(Feature::HasShaderStencilOutput));
|
||||
|
||||
|
|
|
@ -3485,11 +3485,8 @@ ANGLE_INSTANTIATE_TEST_COMBINE_4(MaskedScissoredClearTest,
|
|||
ANGLE_ALL_TEST_PLATFORMS_ES3,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VulkanClearTest);
|
||||
ANGLE_INSTANTIATE_TEST_COMBINE_4(VulkanClearTest,
|
||||
|
|
|
@ -4056,34 +4056,26 @@ TEST_P(MultisampledRenderToTextureWithAdvancedBlendTest, RenderbufferClearThenDr
|
|||
drawTestCommon(true, InitMethod::Clear);
|
||||
}
|
||||
|
||||
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND_ES31_AND(MultisampledRenderToTextureTest,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND_ES31_AND(
|
||||
MultisampledRenderToTextureTest,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MultisampledRenderToTextureES3Test);
|
||||
ANGLE_INSTANTIATE_TEST_ES3_AND(MultisampledRenderToTextureES3Test,
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MultisampledRenderToTextureES31Test);
|
||||
ANGLE_INSTANTIATE_TEST_ES31_AND(MultisampledRenderToTextureES31Test,
|
||||
ES31_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES31_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState));
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES31_VULKAN().disable(Feature::SupportsExtendedDynamicState2));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MultisampledRenderToTextureWithAdvancedBlendTest);
|
||||
ANGLE_INSTANTIATE_TEST_ES3(MultisampledRenderToTextureWithAdvancedBlendTest);
|
||||
|
|
|
@ -10553,30 +10553,26 @@ ANGLE_INSTANTIATE_TEST_ES2(LineLoopStateChangeTest);
|
|||
ANGLE_INSTANTIATE_TEST_ES2(StateChangeRenderTest);
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(StateChangeTestES3);
|
||||
ANGLE_INSTANTIATE_TEST_ES3_AND(StateChangeTestES3,
|
||||
ES3_VULKAN().disable(Feature::SupportsIndexTypeUint8),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES3_VULKAN().enable(Feature::ForceStaticVertexStrideState),
|
||||
ES3_VULKAN().enable(Feature::ForceStaticPrimitiveRestartState));
|
||||
ANGLE_INSTANTIATE_TEST_ES3_AND(
|
||||
StateChangeTestES3,
|
||||
ES3_VULKAN().disable(Feature::SupportsIndexTypeUint8),
|
||||
ES3_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES3_VULKAN().disable(Feature::UseVertexInputBindingStrideDynamicState),
|
||||
ES3_VULKAN().disable(Feature::UsePrimitiveRestartEnableDynamicState));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(StateChangeTestES31);
|
||||
ANGLE_INSTANTIATE_TEST_ES31_AND(StateChangeTestES31,
|
||||
ES31_VULKAN().disable(Feature::SupportsIndexTypeUint8),
|
||||
ES31_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES31_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState2)
|
||||
.disable(Feature::SupportsLogicOpDynamicState),
|
||||
ES31_VULKAN().enable(Feature::ForceStaticVertexStrideState),
|
||||
ES31_VULKAN().enable(Feature::ForceStaticPrimitiveRestartState));
|
||||
ANGLE_INSTANTIATE_TEST_ES31_AND(
|
||||
StateChangeTestES31,
|
||||
ES31_VULKAN().disable(Feature::SupportsIndexTypeUint8),
|
||||
ES31_VULKAN()
|
||||
.disable(Feature::SupportsExtendedDynamicState)
|
||||
.disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES31_VULKAN().disable(Feature::SupportsExtendedDynamicState2),
|
||||
ES31_VULKAN().disable(Feature::UseVertexInputBindingStrideDynamicState),
|
||||
ES31_VULKAN().disable(Feature::UsePrimitiveRestartEnableDynamicState));
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(StateChangeTestWebGL2);
|
||||
ANGLE_INSTANTIATE_TEST_COMBINE_1(StateChangeTestWebGL2,
|
||||
|
|
|
@ -165,8 +165,6 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{
|
|||
{Feature::ForceNearestMipFiltering, "forceNearestMipFiltering"},
|
||||
{Feature::ForceNonCSBaseMipmapGeneration, "forceNonCSBaseMipmapGeneration"},
|
||||
{Feature::ForceRobustResourceInit, "forceRobustResourceInit"},
|
||||
{Feature::ForceStaticPrimitiveRestartState, "forceStaticPrimitiveRestartState"},
|
||||
{Feature::ForceStaticVertexStrideState, "forceStaticVertexStrideState"},
|
||||
{Feature::ForceSubmitImmutableTextureUpdates, "forceSubmitImmutableTextureUpdates"},
|
||||
{Feature::ForceTextureLodOffset1, "forceTextureLodOffset1"},
|
||||
{Feature::ForceTextureLodOffset2, "forceTextureLodOffset2"},
|
||||
|
@ -365,15 +363,26 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{
|
|||
{Feature::UnsizedSRGBReadPixelsDoesntTransform, "unsizedSRGBReadPixelsDoesntTransform"},
|
||||
{Feature::UploadDataToIosurfacesWithStagingBuffers, "uploadDataToIosurfacesWithStagingBuffers"},
|
||||
{Feature::UploadTextureDataInChunks, "uploadTextureDataInChunks"},
|
||||
{Feature::UseCullModeDynamicState, "useCullModeDynamicState"},
|
||||
{Feature::UseDepthBiasEnableDynamicState, "useDepthBiasEnableDynamicState"},
|
||||
{Feature::UseDepthCompareOpDynamicState, "useDepthCompareOpDynamicState"},
|
||||
{Feature::UseDepthTestEnableDynamicState, "useDepthTestEnableDynamicState"},
|
||||
{Feature::UseDepthWriteEnableDynamicState, "useDepthWriteEnableDynamicState"},
|
||||
{Feature::UseFrontFaceDynamicState, "useFrontFaceDynamicState"},
|
||||
{Feature::UseInstancedPointSpriteEmulation, "useInstancedPointSpriteEmulation"},
|
||||
{Feature::UseMultipleDescriptorsForExternalFormats, "useMultipleDescriptorsForExternalFormats"},
|
||||
{Feature::UseNonZeroStencilWriteMaskStaticState, "useNonZeroStencilWriteMaskStaticState"},
|
||||
{Feature::UsePrimitiveRestartEnableDynamicState, "usePrimitiveRestartEnableDynamicState"},
|
||||
{Feature::UseRasterizerDiscardEnableDynamicState, "useRasterizerDiscardEnableDynamicState"},
|
||||
{Feature::UseResetCommandBufferBitForSecondaryPools,
|
||||
"useResetCommandBufferBitForSecondaryPools"},
|
||||
{Feature::UseShadowBuffersWhenAppropriate, "useShadowBuffersWhenAppropriate"},
|
||||
{Feature::UseStencilOpDynamicState, "useStencilOpDynamicState"},
|
||||
{Feature::UseStencilTestEnableDynamicState, "useStencilTestEnableDynamicState"},
|
||||
{Feature::UseSystemMemoryForConstantBuffers, "useSystemMemoryForConstantBuffers"},
|
||||
{Feature::UseUnusedBlocksWithStandardOrSharedLayout,
|
||||
"useUnusedBlocksWithStandardOrSharedLayout"},
|
||||
{Feature::UseVertexInputBindingStrideDynamicState, "useVertexInputBindingStrideDynamicState"},
|
||||
{Feature::UseVmaForImageSuballocation, "useVmaForImageSuballocation"},
|
||||
{Feature::VaryingsRequireMatchingPrecisionInSpirv, "varyingsRequireMatchingPrecisionInSpirv"},
|
||||
{Feature::VertexIDDoesNotIncludeBaseVertex, "vertexIDDoesNotIncludeBaseVertex"},
|
||||
|
|
|
@ -157,8 +157,6 @@ enum class Feature
|
|||
ForceNearestMipFiltering,
|
||||
ForceNonCSBaseMipmapGeneration,
|
||||
ForceRobustResourceInit,
|
||||
ForceStaticPrimitiveRestartState,
|
||||
ForceStaticVertexStrideState,
|
||||
ForceSubmitImmutableTextureUpdates,
|
||||
ForceTextureLodOffset1,
|
||||
ForceTextureLodOffset2,
|
||||
|
@ -339,13 +337,24 @@ enum class Feature
|
|||
UnsizedSRGBReadPixelsDoesntTransform,
|
||||
UploadDataToIosurfacesWithStagingBuffers,
|
||||
UploadTextureDataInChunks,
|
||||
UseCullModeDynamicState,
|
||||
UseDepthBiasEnableDynamicState,
|
||||
UseDepthCompareOpDynamicState,
|
||||
UseDepthTestEnableDynamicState,
|
||||
UseDepthWriteEnableDynamicState,
|
||||
UseFrontFaceDynamicState,
|
||||
UseInstancedPointSpriteEmulation,
|
||||
UseMultipleDescriptorsForExternalFormats,
|
||||
UseNonZeroStencilWriteMaskStaticState,
|
||||
UsePrimitiveRestartEnableDynamicState,
|
||||
UseRasterizerDiscardEnableDynamicState,
|
||||
UseResetCommandBufferBitForSecondaryPools,
|
||||
UseShadowBuffersWhenAppropriate,
|
||||
UseStencilOpDynamicState,
|
||||
UseStencilTestEnableDynamicState,
|
||||
UseSystemMemoryForConstantBuffers,
|
||||
UseUnusedBlocksWithStandardOrSharedLayout,
|
||||
UseVertexInputBindingStrideDynamicState,
|
||||
UseVmaForImageSuballocation,
|
||||
VaryingsRequireMatchingPrecisionInSpirv,
|
||||
VertexIDDoesNotIncludeBaseVertex,
|
||||
|
|
Загрузка…
Ссылка в новой задаче