Skip to content

Commit 7280d3d

Browse files
Sean FengAngle LUCI CQ
authored andcommitted
Turn off preferSubmitAtFBOBoundary and add early submit logic
Disabling preferSubmitAtFBOBoundary for MALI GPUs and submit pending commands at the draw call time if the number of write-commands in the current render pass reaches a threshold to avoid delaying the submission too much. Bug: angleproject:447444701 Change-Id: I413a4beb7147afd4f064286433a76014b19a49c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6994438 Reviewed-by: Charlie Lao <[email protected]> Reviewed-by: Amirali Abdolrashidi <[email protected]> Auto-Submit: Sean Feng <[email protected]> Commit-Queue: Shahbaz Youssefi <[email protected]>
1 parent 2027314 commit 7280d3d

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

src/libANGLE/renderer/vulkan/ContextVk.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,16 @@ angle::Result ContextVk::setupDraw(const gl::Context *context,
15791579
mGraphicsPipelineDesc->updateTopology(&mGraphicsPipelineTransition, mCurrentDrawMode);
15801580
}
15811581

1582+
// Submit pending commands if the number of write-commands in the current render pass reaches a
1583+
// threshold to avoid delaying the submission too much.
1584+
if (ANGLE_UNLIKELY(mRenderPassCommands->getCommandBuffer().getRenderPassWriteCommandCount() >
1585+
mRenderer->getMinRenderPassWriteCommandCountToEarlySubmit()) &&
1586+
(mCommandsPendingSubmissionCount > 0))
1587+
{
1588+
ANGLE_TRY(submitCommands(nullptr, nullptr));
1589+
mCommandsPendingSubmissionCount = 0;
1590+
}
1591+
15821592
// Must be called before the command buffer is started. Can call finish.
15831593
VertexArrayVk *vertexArrayVk = getVertexArray();
15841594
if (vertexArrayVk->getStreamingVertexAttribsMask().any())

src/libANGLE/renderer/vulkan/vk_renderer.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,8 @@ Renderer::Renderer()
19501950
mNativeVectorWidthHalf(0),
19511951
mPreferredVectorWidthDouble(0),
19521952
mPreferredVectorWidthHalf(0),
1953-
mMinCommandCountToSubmit(0)
1953+
mMinCommandCountToSubmit(0),
1954+
mMinRPWriteCommandCountToEarlySubmit(UINT32_MAX)
19541955
{
19551956
VkFormatProperties invalid = {0, 0, kInvalidFormatFeatureFlags};
19561957
mFormatProperties.fill(invalid);
@@ -5709,10 +5710,18 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames,
57095710
// improves performance. Most app traces shows frame time reduced and manhattan 3.1 offscreen
57105711
// score improves 7%.
57115712
ANGLE_FEATURE_CONDITION(&mFeatures, preferSubmitAtFBOBoundary,
5712-
isTileBasedRenderer || isSwiftShader);
5713+
((isTileBasedRenderer || isSwiftShader) && !isARMProprietary));
5714+
57135715
ANGLE_FEATURE_CONDITION(&mFeatures, forceSubmitExceptionsAtFBOBoundary, !isQualcommProprietary);
57145716
mMinCommandCountToSubmit = isQualcommProprietary ? 1024 : 32;
57155717

5718+
// The number of minimum write commands in the command buffer to trigger one submission of
5719+
// pending commands at draw call time
5720+
if (isARMProprietary)
5721+
{
5722+
mMinRPWriteCommandCountToEarlySubmit = 128;
5723+
}
5724+
57165725
// In order to support immutable samplers tied to external formats, we need to overallocate
57175726
// descriptor counts for such immutable samplers
57185727
ANGLE_FEATURE_CONDITION(&mFeatures, useMultipleDescriptorsForExternalFormats, true);

src/libANGLE/renderer/vulkan/vk_renderer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,11 @@ class Renderer : angle::NonCopyable
727727

728728
angle::Result onFrameBoundary(const gl::Context *contextGL);
729729

730+
uint32_t getMinRenderPassWriteCommandCountToEarlySubmit() const
731+
{
732+
return mMinRPWriteCommandCountToEarlySubmit;
733+
}
734+
730735
private:
731736
angle::Result setupDevice(vk::ErrorContext *context,
732737
const angle::FeatureOverrides &featureOverrides,
@@ -1130,6 +1135,10 @@ class Renderer : angle::NonCopyable
11301135
// The number of minimum commands in the command buffer to prefer submit at FBO boundary or
11311136
// immediately submit when the device is idle after calling to flush.
11321137
uint32_t mMinCommandCountToSubmit;
1138+
1139+
// The number of minimum write commands in the command buffer to trigger one submission of
1140+
// pending commands at draw call time
1141+
uint32_t mMinRPWriteCommandCountToEarlySubmit;
11331142
};
11341143

11351144
ANGLE_INLINE Serial Renderer::generateQueueSerial(SerialIndex index)

0 commit comments

Comments
 (0)