mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Don't modify descriptor update template while writing. Closes #1765
This commit is contained in:
@@ -4045,12 +4045,20 @@ void DoSerialise(SerialiserType &ser, VkDescriptorUpdateTemplateEntry &el)
|
||||
if(ser.VersionAtLeast(0xE))
|
||||
#endif
|
||||
{
|
||||
uint64_t offset = el.offset;
|
||||
uint64_t stride = el.stride;
|
||||
uint64_t offset = 0;
|
||||
uint64_t stride = 0;
|
||||
if(ser.IsWriting())
|
||||
{
|
||||
offset = el.offset;
|
||||
stride = el.stride;
|
||||
}
|
||||
ser.Serialise("offset"_lit, offset);
|
||||
ser.Serialise("stride"_lit, stride);
|
||||
el.offset = (size_t)offset;
|
||||
el.stride = (size_t)stride;
|
||||
if(ser.IsReading())
|
||||
{
|
||||
el.offset = (size_t)offset;
|
||||
el.stride = (size_t)stride;
|
||||
}
|
||||
}
|
||||
#if DISABLED(RDOC_APPLE)
|
||||
else
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
#include "vk_test.h"
|
||||
|
||||
static const VkDescriptorUpdateTemplateEntryKHR constEntry = {
|
||||
4, 0, 1, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 0, 16,
|
||||
};
|
||||
|
||||
RD_TEST(VK_Parameter_Zoo, VulkanGraphicsTest)
|
||||
{
|
||||
static constexpr const char *Description =
|
||||
@@ -678,6 +682,13 @@ void main()
|
||||
|
||||
vkDestroyDescriptorUpdateTemplateKHR(device, templ, NULL);
|
||||
|
||||
// try with constant entry
|
||||
createInfo.descriptorUpdateEntryCount = 1;
|
||||
createInfo.pDescriptorUpdateEntries = &constEntry;
|
||||
vkCreateDescriptorUpdateTemplateKHR(device, &createInfo, NULL, &templ);
|
||||
vkUpdateDescriptorSetWithTemplateKHR(device, descset, templ, &data);
|
||||
vkDestroyDescriptorUpdateTemplateKHR(device, templ, NULL);
|
||||
|
||||
entries = {
|
||||
{0, 0, 1, VK_DESCRIPTOR_TYPE_SAMPLER, offsetof(refdatastruct, sampler), sizeof(data)},
|
||||
{1, 0, 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, offsetof(refdatastruct, combined),
|
||||
|
||||
Reference in New Issue
Block a user