Skip to content

Commit

Permalink
update size and format and fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qbojj committed Jun 25, 2024
1 parent 5165cd0 commit 11ca89f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 36 deletions.
32 changes: 16 additions & 16 deletions renderdoc/driver/vulkan/vk_dispatchtables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ void InitInstanceExtensionTables(VkInstance instance, InstanceDeviceInfo *info)

#undef HookInitPromotedExtension
#define HookInitPromotedExtension(cond, func, suffix) \
if(cond) \
{ \
InstanceGPA(func); \
InstanceGPA(CONCAT(func, suffix)); \
if(table->func == NULL) \
table->func = table->CONCAT(func, suffix); \
if(table->CONCAT(func, suffix) == NULL) \
table->CONCAT(func, suffix) = table->func; \
if(cond) \
{ \
InstanceGPA(func); \
InstanceGPA(CONCAT(func, suffix)); \
if(table->func == NULL) \
table->func = table->CONCAT(func, suffix); \
if(table->CONCAT(func, suffix) == NULL) \
table->CONCAT(func, suffix) = table->func; \
}

#undef HookInitExtensionEXTtoKHR
Expand Down Expand Up @@ -141,14 +141,14 @@ void InitDeviceExtensionTables(VkDevice device, InstanceDeviceInfo *info)

#undef HookInitPromotedExtension
#define HookInitPromotedExtension(cond, func, suffix) \
if(cond) \
{ \
DeviceGPA(func); \
DeviceGPA(CONCAT(func, suffix)); \
if(table->func == NULL) \
table->func = table->CONCAT(func, suffix); \
if(table->CONCAT(func, suffix) == NULL) \
table->CONCAT(func, suffix) = table->func; \
if(cond) \
{ \
DeviceGPA(func); \
DeviceGPA(CONCAT(func, suffix)); \
if(table->func == NULL) \
table->func = table->CONCAT(func, suffix); \
if(table->CONCAT(func, suffix) == NULL) \
table->CONCAT(func, suffix) = table->func; \
}

#undef HookInitExtensionEXTtoKHR
Expand Down
3 changes: 2 additions & 1 deletion renderdoc/driver/vulkan/vk_dispatchtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
void InitReplayTables(void *vulkanModule);

// bitmask of extension enabled status
enum ExtensionStatusFlagBits {
enum ExtensionStatusFlagBits
{
NotEnabled = 0,
ExplicitEnabled = 1 << 0,
PromotionEnabled = 1 << 1,
Expand Down
16 changes: 9 additions & 7 deletions renderdoc/driver/vulkan/vk_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,14 @@ VK_LAYER_RENDERDOC_CaptureEnumerateInstanceExtensionProperties(
}

#undef DeclExt
#define DeclExt(name) \
ExtensionStatusFlags name = ExtensionStatusFlagBits::NotEnabled; \
#define DeclExt(name) \
ExtensionStatusFlags name = ExtensionStatusFlagBits::NotEnabled; \
(void)name;

#undef CheckExt
#define CheckExt(name, ver) name = instDevInfo == NULL ? ExtensionStatusFlagBits::NotEnabled : instDevInfo->ext_##name;
#define CheckExt(name, ver) \
name = instDevInfo == NULL ? (ExtensionStatusFlags)ExtensionStatusFlagBits::NotEnabled \
: instDevInfo->ext_##name;

#undef HookInit
#define HookInit(function) \
Expand All @@ -396,7 +398,7 @@ VK_LAYER_RENDERDOC_CaptureEnumerateInstanceExtensionProperties(

// for promoted extensions, we return the function pointer for either name as an alias.
#undef HookInitPromotedExtension
#define HookInitPromotedExtension(cond, function, suffix) \
#define HookInitPromotedExtension(cond, function, suffix) \
if(!strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \
{ \
if(ExtensionStatusFlagBits::ExplicitEnabled & cond) \
Expand Down Expand Up @@ -515,9 +517,9 @@ VK_LAYER_RENDERDOC_CaptureGetInstanceProcAddr(VkInstance instance, const char *p
return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function);

#undef HookInitPromotedExtension
#define HookInitPromotedExtension(cond, function, suffix) \
#define HookInitPromotedExtension(cond, function, suffix) \
if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \
!strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \
!strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \
return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function);

#undef HookInitExtensionEXTtoKHR
Expand Down Expand Up @@ -596,7 +598,7 @@ VK_LAYER_RENDERDOC_Capture_layerGetPhysicalDeviceProcAddr(VkInstance instance, c
return NULL;

#undef HookInitPromotedExtension
#define HookInitPromotedExtension(cond, function, suffix) \
#define HookInitPromotedExtension(cond, function, suffix) \
if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \
!strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \
return NULL;
Expand Down
22 changes: 11 additions & 11 deletions renderdoc/driver/vulkan/vk_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,18 +663,18 @@ void VulkanRenderState::BindDynamicState(WrappedVulkan *vk, VkCommandBuffer cmd)
else if(ibuffer.bytewidth == 1)
type = VK_INDEX_TYPE_UINT8_KHR;

VkBuffer idxBufferUnwrapped =
Unwrap(vk->GetResourceManager()->GetCurrentHandle<VkBuffer>(ibuffer.buf));
if(ibuffer.size == VK_WHOLE_SIZE)
{
ObjDisp(cmd)->CmdBindIndexBuffer(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, type);
}
else
{
ObjDisp(cmd)->CmdBindIndexBuffer2KHR(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs,
ibuffer.size, type);
}
VkBuffer idxBufferUnwrapped =
Unwrap(vk->GetResourceManager()->GetCurrentHandle<VkBuffer>(ibuffer.buf));
if(ibuffer.size == VK_WHOLE_SIZE)
{
ObjDisp(cmd)->CmdBindIndexBuffer(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, type);
}
else
{
ObjDisp(cmd)->CmdBindIndexBuffer2KHR(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs,
ibuffer.size, type);
}
}

if((vk->DynamicVertexInput() || vk->ShaderObject()) && dynamicStates[VkDynamicVertexInputEXT])
{
Expand Down
2 changes: 1 addition & 1 deletion renderdoc/replay/renderdoc_serialise.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::State &el)

SERIALISE_MEMBER(conditionalRendering);

SIZE_CHECK(1820);
SIZE_CHECK(1816);
}

#pragma endregion Vulkan pipeline state
Expand Down

0 comments on commit 11ca89f

Please sign in to comment.