Skip to content

Commit

Permalink
Vulkan: add feature control for client buffer merge
Browse files Browse the repository at this point in the history
add feature control for client attribute buffer
merge. default is off to reduce memeory usage for
some application.

Bug: b/328301788
Change-Id: I5bfd39fb1ea656ebb29bd2dc21726b60bbc1a8d2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5410942
Commit-Queue: Hailin Zhang <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
  • Loading branch information
Hailin Zhang authored and Angle LUCI CQ committed Apr 3, 2024
1 parent ceb3c0e commit dc643d9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/platform/autogen/FeaturesVk_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,13 @@ struct FeaturesVk : FeatureSetBase
&members, "https://issuetracker.google.com/328837151"
};

FeatureInfo enableMergeClientAttribBuffer = {
"enableMergeClientAttribBuffer",
FeatureCategory::VulkanFeatures,
"Enable merge for client attrib buffer if possible",
&members, "https://issuetracker.google.com/328301788"
};

};

inline FeaturesVk::FeaturesVk() = default;
Expand Down
8 changes: 8 additions & 0 deletions include/platform/vk_features.json
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,14 @@
"enable additional blend factors for dithering"
],
"issue": "https://issuetracker.google.com/328837151"
},
{
"name": "enable_merge_client_attrib_buffer",
"category": "Features",
"description": [
"Enable merge for client attrib buffer if possible"
],
"issue": "https://issuetracker.google.com/328301788"
}
]
}
4 changes: 4 additions & 0 deletions src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ bool ShouldCombineAttributes(vk::Renderer *renderer,
const gl::VertexAttribute &attrib,
const gl::VertexBinding &binding)
{
if (!renderer->getFeatures().enableMergeClientAttribBuffer.enabled)
{
return false;
}
const vk::Format &vertexFormat = renderer->getFormat(attrib.format->id);
return !vertexFormat.getVertexLoadRequiresConversion(false) && binding.getDivisor() == 0 &&
ClientBindingAligned(attrib, binding.getStride(),
Expand Down
1 change: 1 addition & 0 deletions util/autogen/angle_features_autogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{
{Feature::EnableAsyncPipelineCacheCompression, "enableAsyncPipelineCacheCompression"},
{Feature::EnableCaptureLimits, "enableCaptureLimits"},
{Feature::EnableInMemoryMtlLibraryCache, "enableInMemoryMtlLibraryCache"},
{Feature::EnableMergeClientAttribBuffer, "enableMergeClientAttribBuffer"},
{Feature::EnableMultisampledRenderToTexture, "enableMultisampledRenderToTexture"},
{Feature::EnableParallelCompileAndLink, "enableParallelCompileAndLink"},
{Feature::EnableParallelMtlLibraryCompilation, "enableParallelMtlLibraryCompilation"},
Expand Down
1 change: 1 addition & 0 deletions util/autogen/angle_features_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ enum class Feature
EnableAsyncPipelineCacheCompression,
EnableCaptureLimits,
EnableInMemoryMtlLibraryCache,
EnableMergeClientAttribBuffer,
EnableMultisampledRenderToTexture,
EnableParallelCompileAndLink,
EnableParallelMtlLibraryCompilation,
Expand Down

0 comments on commit dc643d9

Please sign in to comment.