Skip to content

Commit 4681b9b

Browse files
committed
add VK_KHR_maintenance5 support
1 parent 0f6c619 commit 4681b9b

19 files changed

+323
-133
lines changed

qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2411,7 +2411,7 @@ void VulkanPipelineStateViewer::setState()
24112411
BufferDescription *buf = m_Ctx.GetBuffer(state.inputAssembly.indexBuffer.resourceId);
24122412

24132413
if(buf)
2414-
length = buf->length;
2414+
length = qMin(buf->length, state.inputAssembly.indexBuffer.byteSize);
24152415

24162416
RDTreeWidgetItem *node = new RDTreeWidgetItem(
24172417
{tr("Index"), state.inputAssembly.indexBuffer.resourceId, tr("Index"), lit("-"),
@@ -3802,7 +3802,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
38023802
if(ib)
38033803
{
38043804
name = m_Ctx.GetResourceName(ia.indexBuffer.resourceId);
3805-
length = ib->length;
3805+
length = qMin(ib->length, ia.indexBuffer.byteSize);
38063806
}
38073807

38083808
QString ifmt = lit("UNKNOWN");

renderdoc/api/replay/pipestate.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ BoundVBuffer PipeState::GetIBuffer() const
582582
ret.resourceId = m_Vulkan->inputAssembly.indexBuffer.resourceId;
583583
ret.byteOffset = m_Vulkan->inputAssembly.indexBuffer.byteOffset;
584584
ret.byteStride = m_Vulkan->inputAssembly.indexBuffer.byteStride;
585-
ret.byteSize = ~0ULL;
585+
ret.byteSize = m_Vulkan->inputAssembly.indexBuffer.byteSize;
586586
}
587587
}
588588

renderdoc/api/replay/vk_pipestate.h

+3
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ struct IndexBuffer
411411
DOCUMENT("The byte offset from the start of the buffer to the beginning of the index data.");
412412
uint64_t byteOffset = 0;
413413

414+
DOCUMENT("The number of bytes in the index buffer.");
415+
uint64_t byteSize = 0;
416+
414417
DOCUMENT(R"(The number of bytes for each index in the index buffer. Typically 2 or 4 bytes but
415418
it can be 0 if no index buffer is bound.
416419
)");

renderdoc/driver/vulkan/extension_support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ Maintainers can update this file by updating vk.xml in this folder and running `
171171
* `VK_KHR_maintenance2`
172172
* `VK_KHR_maintenance3`
173173
* `VK_KHR_maintenance4`
174+
* `VK_KHR_maintenance5`
174175
* `VK_KHR_multiview`
175176
* `VK_KHR_performance_query`
176177
* `VK_KHR_pipeline_executable_properties`
@@ -235,7 +236,6 @@ KHR extensions will definitely be implemented at some point, though KHR extensio
235236

236237
* `VK_KHR_cooperative_matrix`
237238
* `VK_KHR_dynamic_rendering_local_read`
238-
* `VK_KHR_maintenance5`
239239
* `VK_KHR_maintenance6`
240240
* `VK_KHR_map_memory2`
241241
* `VK_KHR_shader_expect_assume`

renderdoc/driver/vulkan/vk_common.h

+1
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ enum class VulkanChunk : uint32_t
978978
vkCmdDrawMeshTasksEXT,
979979
vkCmdDrawMeshTasksIndirectEXT,
980980
vkCmdDrawMeshTasksIndirectCountEXT,
981+
vkCmdBindIndexBuffer2KHR,
981982
Max,
982983
};
983984

renderdoc/driver/vulkan/vk_core.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -3989,6 +3989,10 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk)
39893989
return Serialise_vkCmdSetTessellationDomainOriginEXT(ser, VK_NULL_HANDLE,
39903990
VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM);
39913991

3992+
case VulkanChunk::vkCmdBindIndexBuffer2KHR:
3993+
return Serialise_vkCmdBindIndexBuffer2KHR(ser, VK_NULL_HANDLE, VK_NULL_HANDLE, 0, 0,
3994+
VK_INDEX_TYPE_MAX_ENUM);
3995+
39923996
// chunks that are reserved but not yet serialised
39933997
case VulkanChunk::vkResetCommandPool:
39943998
case VulkanChunk::vkCreateDepthTargetView:

renderdoc/driver/vulkan/vk_core.h

+14
Original file line numberDiff line numberDiff line change
@@ -2812,4 +2812,18 @@ class WrappedVulkan : public IFrameCapturer
28122812
VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
28132813
VkBuffer countBuffer, VkDeviceSize countBufferOffset,
28142814
uint32_t maxDrawCount, uint32_t stride);
2815+
2816+
// VK_KHR_maintenance5
2817+
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdBindIndexBuffer2KHR, VkCommandBuffer commandBuffer,
2818+
VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size,
2819+
VkIndexType indexType);
2820+
IMPLEMENT_FUNCTION_SERIALISED(void, vkGetDeviceImageSubresourceLayoutKHR, VkDevice device,
2821+
const VkDeviceImageSubresourceInfoKHR *pInfo,
2822+
VkSubresourceLayout2KHR *pLayout);
2823+
IMPLEMENT_FUNCTION_SERIALISED(void, vkGetImageSubresourceLayout2KHR, VkDevice device,
2824+
VkImage image, const VkImageSubresource2KHR *pSubresource,
2825+
VkSubresourceLayout2KHR *pLayout);
2826+
IMPLEMENT_FUNCTION_SERIALISED(void, vkGetRenderingAreaGranularityKHR, VkDevice device,
2827+
const VkRenderingAreaInfoKHR *pRenderingAreaInfo,
2828+
VkExtent2D *pGranularity);
28152829
};

renderdoc/driver/vulkan/vk_dispatchtables.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ void InitInstanceExtensionTables(VkInstance instance, InstanceDeviceInfo *info)
9090
}
9191

9292
#undef HookInitPromotedExtension
93-
#define HookInitPromotedExtension(cond, func, suffix) \
94-
if(cond) \
95-
{ \
96-
InstanceGPA(func); \
97-
InstanceGPA(CONCAT(func, suffix)); \
98-
if(table->func == NULL) \
99-
table->func = table->CONCAT(func, suffix); \
100-
if(table->CONCAT(func, suffix) == NULL) \
101-
table->CONCAT(func, suffix) = table->func; \
93+
#define HookInitPromotedExtension(cond, version, func, suffix) \
94+
if(cond) \
95+
{ \
96+
InstanceGPA(func); \
97+
InstanceGPA(CONCAT(func, suffix)); \
98+
if(table->func == NULL) \
99+
table->func = table->CONCAT(func, suffix); \
100+
if(table->CONCAT(func, suffix) == NULL) \
101+
table->CONCAT(func, suffix) = table->func; \
102102
}
103103

104104
#undef HookInitExtensionEXTtoKHR
@@ -140,15 +140,15 @@ void InitDeviceExtensionTables(VkDevice device, InstanceDeviceInfo *info)
140140
}
141141

142142
#undef HookInitPromotedExtension
143-
#define HookInitPromotedExtension(cond, func, suffix) \
144-
if(cond) \
145-
{ \
146-
DeviceGPA(func); \
147-
DeviceGPA(CONCAT(func, suffix)); \
148-
if(table->func == NULL) \
149-
table->func = table->CONCAT(func, suffix); \
150-
if(table->CONCAT(func, suffix) == NULL) \
151-
table->CONCAT(func, suffix) = table->func; \
143+
#define HookInitPromotedExtension(cond, version, func, suffix) \
144+
if(cond) \
145+
{ \
146+
DeviceGPA(func); \
147+
DeviceGPA(CONCAT(func, suffix)); \
148+
if(table->func == NULL) \
149+
table->func = table->CONCAT(func, suffix); \
150+
if(table->CONCAT(func, suffix) == NULL) \
151+
table->CONCAT(func, suffix) = table->func; \
152152
}
153153

154154
#undef HookInitExtensionEXTtoKHR

0 commit comments

Comments
 (0)