Merge pull request #213 from arreina/pr/cache-empty-memcpy

fix(shader): skip the push constant copy when there is nothing to copy
This commit is contained in:
boykopovar
2026-10-01 21:22:29 +03:00
committed by GitHub
+2 -2
View File
@@ -305,7 +305,7 @@ void decodeResult(Reader& reader, RecompileResult& result) {
std::vector<std::uint8_t> pushConstants;
reader.Values(pushConstants);
result.pushConstants.resize(pushConstants.size());
std::memcpy(result.pushConstants.data(), pushConstants.data(), pushConstants.size());
if (!pushConstants.empty()) std::memcpy(result.pushConstants.data(), pushConstants.data(), pushConstants.size());
reader.Value(result.bdaAbiVersion);
reader.Value(result.memoryOffsetDword);
reader.List(result.vertexAttributes, 28, [](Reader& in, VertexAttribute& attribute) {
@@ -546,7 +546,7 @@ void decodeAllocation(Reader& reader, BindingAllocationResult& allocation) {
std::vector<std::uint8_t> pushConstants;
reader.Values(pushConstants);
allocation.pushConstants.resize(pushConstants.size());
std::memcpy(allocation.pushConstants.data(), pushConstants.data(), pushConstants.size());
if (!pushConstants.empty()) std::memcpy(allocation.pushConstants.data(), pushConstants.data(), pushConstants.size());
}
constexpr std::string_view NeutralSwitches[] = {