Vulkan: Fix sanitizers error with empty shader name
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
parent
f7bc653cbe
commit
77b02359c9
1 changed files with 7 additions and 4 deletions
|
@ -4812,12 +4812,15 @@ Vector<uint8_t> RenderingDeviceVulkan::shader_compile_binary_from_spirv(const Ve
|
|||
offset += sizeof(uint32_t);
|
||||
memcpy(binptr + offset, &binary_data, sizeof(RenderingDeviceVulkanShaderBinaryData));
|
||||
offset += sizeof(RenderingDeviceVulkanShaderBinaryData);
|
||||
|
||||
if (binary_data.shader_name_len > 0) {
|
||||
memcpy(binptr + offset, shader_name_utf.ptr(), binary_data.shader_name_len);
|
||||
offset += binary_data.shader_name_len;
|
||||
|
||||
if ((binary_data.shader_name_len % 4) != 0) { // Alignment rules are really strange.
|
||||
offset += 4 - (binary_data.shader_name_len % 4);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < uniform_info.size(); i++) {
|
||||
int count = uniform_info[i].size();
|
||||
|
|
Loading…
Reference in a new issue