Commit abaeb415 by Michael Spang Committed by Commit Bot

Vulkan: Fix setupDraw when VK_EXT_transform_feedback is not enabled

There's no dirty bit handler if VK_EXT_transform_feedback disabled, but we're setting that dirty bit in syncState. This results in calling a null method pointer. Skip the invalidate if the extension is not enabled. gl::LogMessage::~LogMessage() at ./../../third_party/angle/src/common/debug.cpp:0 rx::ContextVk::setupDraw(gl::Context const*, gl::PrimitiveMode, int, int, int, gl::DrawElementsType, void const*, angle::BitSetT<11ul, unsigned long, unsigned long>, rx::vk::priv::SecondaryCommandBuffer**) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:844 rx::ContextVk::drawArrays(gl::Context const*, gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:1698 gl::Context::drawArrays(gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/Context.inl.h:112 gl::DrawArrays(unsigned int, int, int) at ./../../third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp:926 (anonymous namespace)::AttributeLayoutNonIndexed::Draw(int, unsigned int, unsigned short const*) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:431 (anonymous namespace)::AttributeLayoutTest::Run(bool) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:305 [This stack is from the added assert; calling a null function pointer crashes without producing a useful stack trace.] Bug: angleproject:4326 Change-Id: I036ae322bddc4865229fa3fe7ea72a4344b99f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2011408 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 13881af3
...@@ -841,6 +841,7 @@ angle::Result ContextVk::setupDraw(const gl::Context *context, ...@@ -841,6 +841,7 @@ angle::Result ContextVk::setupDraw(const gl::Context *context,
// Flush any relevant dirty bits. // Flush any relevant dirty bits.
for (size_t dirtyBit : dirtyBits) for (size_t dirtyBit : dirtyBits)
{ {
ASSERT(mGraphicsDirtyBitHandlers[dirtyBit]);
ANGLE_TRY((this->*mGraphicsDirtyBitHandlers[dirtyBit])(context, *commandBufferOut)); ANGLE_TRY((this->*mGraphicsDirtyBitHandlers[dirtyBit])(context, *commandBufferOut));
} }
...@@ -1026,6 +1027,7 @@ angle::Result ContextVk::setupDispatch(const gl::Context *context, ...@@ -1026,6 +1027,7 @@ angle::Result ContextVk::setupDispatch(const gl::Context *context,
// Flush any relevant dirty bits. // Flush any relevant dirty bits.
for (size_t dirtyBit : dirtyBits) for (size_t dirtyBit : dirtyBits)
{ {
ASSERT(mComputeDirtyBitHandlers[dirtyBit]);
ANGLE_TRY((this->*mComputeDirtyBitHandlers[dirtyBit])(context, *commandBufferOut)); ANGLE_TRY((this->*mComputeDirtyBitHandlers[dirtyBit])(context, *commandBufferOut));
} }
...@@ -2749,7 +2751,10 @@ void ContextVk::onDrawFramebufferChange(FramebufferVk *framebufferVk) ...@@ -2749,7 +2751,10 @@ void ContextVk::onDrawFramebufferChange(FramebufferVk *framebufferVk)
void ContextVk::invalidateCurrentTransformFeedbackBuffers() void ContextVk::invalidateCurrentTransformFeedbackBuffers()
{ {
mGraphicsDirtyBits.set(DIRTY_BIT_TRANSFORM_FEEDBACK_BUFFERS); if (getFeatures().supportsTransformFeedbackExtension.enabled)
{
mGraphicsDirtyBits.set(DIRTY_BIT_TRANSFORM_FEEDBACK_BUFFERS);
}
if (getFeatures().emulateTransformFeedback.enabled) if (getFeatures().emulateTransformFeedback.enabled)
{ {
mGraphicsDirtyBits.set(DIRTY_BIT_DESCRIPTOR_SETS); mGraphicsDirtyBits.set(DIRTY_BIT_DESCRIPTOR_SETS);
......
...@@ -641,8 +641,10 @@ TEST_P(DrawBuffersTestES3, 2DArrayTextures) ...@@ -641,8 +641,10 @@ TEST_P(DrawBuffersTestES3, 2DArrayTextures)
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(DrawBuffersTest); ANGLE_INSTANTIATE_TEST(DrawBuffersTest,
ANGLE_ALL_TEST_PLATFORMS_ES2,
ANGLE_ALL_TEST_PLATFORMS_ES3,
WithNoTransformFeedback(ES2_VULKAN()));
ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersWebGL2Test); ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersWebGL2Test);
ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersTestES3); ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersTestES3);
...@@ -196,6 +196,15 @@ std::ostream &operator<<(std::ostream &stream, const PlatformParameters &pp) ...@@ -196,6 +196,15 @@ std::ostream &operator<<(std::ostream &stream, const PlatformParameters &pp)
stream << "_CommandGraph"; stream << "_CommandGraph";
} }
if (pp.eglParameters.transformFeedbackFeature == EGL_FALSE)
{
stream << "_NoTransformFeedback";
}
else if (pp.eglParameters.transformFeedbackFeature == EGL_TRUE)
{
stream << "_TransformFeedback";
}
return stream; return stream;
} }
......
...@@ -213,6 +213,14 @@ inline PlatformParameters WithNoCommandGraph(const PlatformParameters &params) ...@@ -213,6 +213,14 @@ inline PlatformParameters WithNoCommandGraph(const PlatformParameters &params)
withNoCommandGraph.eglParameters.commandGraphFeature = EGL_FALSE; withNoCommandGraph.eglParameters.commandGraphFeature = EGL_FALSE;
return withNoCommandGraph; return withNoCommandGraph;
} }
inline PlatformParameters WithNoTransformFeedback(const PlatformParameters &params)
{
PlatformParameters withNoTransformFeedback = params;
withNoTransformFeedback.eglParameters.transformFeedbackFeature = EGL_FALSE;
return withNoTransformFeedback;
}
} // namespace angle } // namespace angle
#endif // ANGLE_TEST_CONFIGS_H_ #endif // ANGLE_TEST_CONFIGS_H_
...@@ -59,6 +59,7 @@ struct EGLPlatformParameters ...@@ -59,6 +59,7 @@ struct EGLPlatformParameters
EGLint debugLayersEnabled = EGL_DONT_CARE; EGLint debugLayersEnabled = EGL_DONT_CARE;
EGLint contextVirtualization = EGL_DONT_CARE; EGLint contextVirtualization = EGL_DONT_CARE;
EGLint commandGraphFeature = EGL_DONT_CARE; EGLint commandGraphFeature = EGL_DONT_CARE;
EGLint transformFeedbackFeature = EGL_DONT_CARE;
angle::PlatformMethods *platformMethods = nullptr; angle::PlatformMethods *platformMethods = nullptr;
}; };
......
...@@ -182,6 +182,12 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow, ...@@ -182,6 +182,12 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow,
disabledFeatureOverrides.push_back("command_graph"); disabledFeatureOverrides.push_back("command_graph");
} }
if (params.transformFeedbackFeature == EGL_FALSE)
{
disabledFeatureOverrides.push_back("supports_transform_feedback_extension");
disabledFeatureOverrides.push_back("emulate_transform_feedback");
}
if (!disabledFeatureOverrides.empty()) if (!disabledFeatureOverrides.empty())
{ {
if (strstr(extensionString, "EGL_ANGLE_feature_control") == nullptr) if (strstr(extensionString, "EGL_ANGLE_feature_control") == nullptr)
......
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