mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-22 06:26:30 +00:00
Update WSI to new extension. Also misc structs, functions and enums
This commit is contained in:
@@ -200,7 +200,7 @@ ResourceFormat MakeResourceFormat(VkFormat fmt)
|
||||
case VK_FORMAT_R32_SFLOAT:
|
||||
case VK_FORMAT_R64_SFLOAT:
|
||||
case VK_FORMAT_D16_UNORM:
|
||||
case VK_FORMAT_D24_UNORM:
|
||||
case VK_FORMAT_D24_UNORM_X8:
|
||||
case VK_FORMAT_D32_SFLOAT:
|
||||
case VK_FORMAT_S8_UINT:
|
||||
case VK_FORMAT_BC4_UNORM:
|
||||
@@ -561,7 +561,7 @@ ResourceFormat MakeResourceFormat(VkFormat fmt)
|
||||
ret.compType = eCompType_Double;
|
||||
break;
|
||||
case VK_FORMAT_D16_UNORM:
|
||||
case VK_FORMAT_D24_UNORM:
|
||||
case VK_FORMAT_D24_UNORM_X8:
|
||||
case VK_FORMAT_D32_SFLOAT:
|
||||
ret.compType = eCompType_Depth;
|
||||
break;
|
||||
@@ -647,7 +647,7 @@ ResourceFormat MakeResourceFormat(VkFormat fmt)
|
||||
case VK_FORMAT_D16_UNORM:
|
||||
ret.compByteWidth = 2;
|
||||
break;
|
||||
case VK_FORMAT_D24_UNORM:
|
||||
case VK_FORMAT_D24_UNORM_X8:
|
||||
ret.compByteWidth = 3;
|
||||
break;
|
||||
case VK_FORMAT_R32_UINT:
|
||||
@@ -760,26 +760,13 @@ string ToStrHelper<false, VkResourceType>::Get(const VkResourceType &el)
|
||||
TOSTR_CASE_STRINGIZE(eResEvent)
|
||||
TOSTR_CASE_STRINGIZE(eResQueryPool)
|
||||
TOSTR_CASE_STRINGIZE(eResSemaphore)
|
||||
TOSTR_CASE_STRINGIZE(eResWSISwapChain)
|
||||
TOSTR_CASE_STRINGIZE(eResSwapchain)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkResourceType<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkDeviceCreateFlagBits>::Get(const VkDeviceCreateFlagBits &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_DEVICE_CREATE_VALIDATION_BIT) ret += " | VK_DEVICE_CREATE_VALIDATION_BIT";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkQueueFlagBits>::Get(const VkQueueFlagBits &el)
|
||||
{
|
||||
@@ -835,14 +822,14 @@ string ToStrHelper<false, VkImageUsageFlagBits>::Get(const VkImageUsageFlagBits
|
||||
{
|
||||
string ret = "VK_IMAGE_USAGE_GENERAL";
|
||||
|
||||
if(el & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) ret += " | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT";
|
||||
if(el & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) ret += " | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT";
|
||||
if(el & VK_IMAGE_USAGE_SAMPLED_BIT) ret += " | VK_IMAGE_USAGE_SAMPLED_BIT";
|
||||
if(el & VK_IMAGE_USAGE_STORAGE_BIT) ret += " | VK_IMAGE_USAGE_STORAGE_BIT";
|
||||
if(el & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_DEPTH_STENCIL_BIT) ret += " | VK_IMAGE_USAGE_DEPTH_STENCIL_BIT";
|
||||
if(el & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) ret += " | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT";
|
||||
if(el & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) ret += " | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT";
|
||||
if(el & VK_IMAGE_USAGE_SAMPLED_BIT) ret += " | VK_IMAGE_USAGE_SAMPLED_BIT";
|
||||
if(el & VK_IMAGE_USAGE_STORAGE_BIT) ret += " | VK_IMAGE_USAGE_STORAGE_BIT";
|
||||
if(el & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT";
|
||||
if(el & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) ret += " | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT";
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -852,7 +839,7 @@ string ToStrHelper<false, VkBufferCreateFlagBits>::Get(const VkBufferCreateFlagB
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_BUFFER_CREATE_SPARSE_BIT) ret += " | VK_BUFFER_CREATE_SPARSE_BIT";
|
||||
if(el & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) ret += " | VK_BUFFER_CREATE_SPARSE_BINDING_BIT";
|
||||
if(el & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) ret += " | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT";
|
||||
if(el & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) ret += " | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT";
|
||||
|
||||
@@ -867,10 +854,9 @@ string ToStrHelper<false, VkImageCreateFlagBits>::Get(const VkImageCreateFlagBit
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_IMAGE_CREATE_SPARSE_BIT) ret += " | VK_IMAGE_CREATE_SPARSE_BIT";
|
||||
if(el & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) ret += " | VK_IMAGE_CREATE_SPARSE_BINDING_BIT";
|
||||
if(el & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) ret += " | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT";
|
||||
if(el & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) ret += " | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT";
|
||||
if(el & VK_IMAGE_CREATE_INVARIANT_DATA_BIT) ret += " | VK_IMAGE_CREATE_INVARIANT_DATA_BIT";
|
||||
if(el & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) ret += " | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT";
|
||||
if(el & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ret += " | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT";
|
||||
|
||||
@@ -899,7 +885,7 @@ string ToStrHelper<false, VkCmdPoolResetFlagBits>::Get(const VkCmdPoolResetFlagB
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_CMD_POOL_RESET_RELEASE_RESOURCES) ret += " | VK_CMD_POOL_RESET_RELEASE_RESOURCES";
|
||||
if(el & VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT) ret += " | VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
@@ -1007,6 +993,38 @@ string ToStrHelper<false, VkSubpassDescriptionFlagBits>::Get(const VkSubpassDesc
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkImageAspectFlagBits>::Get(const VkImageAspectFlagBits &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_IMAGE_ASPECT_COLOR_BIT) ret += " | VK_IMAGE_ASPECT_COLOR_BIT";
|
||||
if(el & VK_IMAGE_ASPECT_DEPTH_BIT) ret += " | VK_IMAGE_ASPECT_DEPTH_BIT";
|
||||
if(el & VK_IMAGE_ASPECT_STENCIL_BIT) ret += " | VK_IMAGE_ASPECT_STENCIL_BIT";
|
||||
if(el & VK_IMAGE_ASPECT_METADATA_BIT) ret += " | VK_IMAGE_ASPECT_METADATA_BIT";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkStencilFaceFlagBits>::Get(const VkStencilFaceFlagBits &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_STENCIL_FACE_FRONT_BIT) ret += " | VK_STENCIL_FACE_FRONT_BIT";
|
||||
if(el & VK_STENCIL_FACE_BACK_BIT) ret += " | VK_STENCIL_FACE_BACK_BIT";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
if(ret.empty())
|
||||
ret = "VK_STENCIL_FACE_NONE";
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkPipelineBindPoint>::Get(const VkPipelineBindPoint &el)
|
||||
{
|
||||
@@ -1309,19 +1327,19 @@ string ToStrHelper<false, VkTexMipmapMode>::Get(const VkTexMipmapMode &el)
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkTexAddress>::Get(const VkTexAddress &el)
|
||||
string ToStrHelper<false, VkTexAddressMode>::Get(const VkTexAddressMode &el)
|
||||
{
|
||||
switch(el)
|
||||
{
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_WRAP)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MIRROR)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_CLAMP)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MIRROR_ONCE)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_CLAMP_BORDER)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MODE_WRAP)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MODE_MIRROR)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MODE_CLAMP)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MODE_MIRROR_ONCE)
|
||||
TOSTR_CASE_STRINGIZE(VK_TEX_ADDRESS_MODE_CLAMP_BORDER)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkTexAddress<%d>", el);
|
||||
return StringFormat::Fmt("VkTexAddressMode<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -1443,7 +1461,7 @@ string ToStrHelper<false, VkMemoryHeapFlagBits>::Get(const VkMemoryHeapFlagBits
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_MEMORY_HEAP_HOST_LOCAL) ret += " | VK_MEMORY_HEAP_HOST_LOCAL";
|
||||
if(el & VK_MEMORY_HEAP_HOST_LOCAL_BIT) ret += " | VK_MEMORY_HEAP_HOST_LOCAL_BIT";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
@@ -1522,19 +1540,6 @@ string ToStrHelper<false, VkSharingMode>::Get(const VkSharingMode &el)
|
||||
return StringFormat::Fmt("VkSharingMode<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkBufferViewType>::Get(const VkBufferViewType &el)
|
||||
{
|
||||
switch(el)
|
||||
{
|
||||
TOSTR_CASE_STRINGIZE(VK_BUFFER_VIEW_TYPE_RAW)
|
||||
TOSTR_CASE_STRINGIZE(VK_BUFFER_VIEW_TYPE_FORMATTED)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkBufferViewType<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkCmdBufferLevel>::Get(const VkCmdBufferLevel &el)
|
||||
{
|
||||
@@ -1575,7 +1580,7 @@ string ToStrHelper<false, VkImageLayout>::Get(const VkImageLayout &el)
|
||||
TOSTR_CASE_STRINGIZE(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
|
||||
TOSTR_CASE_STRINGIZE(VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL)
|
||||
TOSTR_CASE_STRINGIZE(VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL)
|
||||
TOSTR_CASE_STRINGIZE(VK_IMAGE_LAYOUT_PRESENT_SOURCE_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR)
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -1592,16 +1597,11 @@ string ToStrHelper<false, VkStructureType>::Get(const VkStructureType &el)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SHADER_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
|
||||
@@ -1638,7 +1638,7 @@ string ToStrHelper<false, VkStructureType>::Get(const VkStructureType &el)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SWAP_CHAIN_CREATE_INFO_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -1774,7 +1774,7 @@ string ToStrHelper<false, VkFormat>::Get(const VkFormat &el)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_R11G11B10_UFLOAT)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_R9G9B9E5_UFLOAT)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_D16_UNORM)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_D24_UNORM)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_D24_UNORM_X8)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_D32_SFLOAT)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_S8_UINT)
|
||||
TOSTR_CASE_STRINGIZE(VK_FORMAT_D16_UNORM_S8_UINT)
|
||||
@@ -1904,14 +1904,20 @@ template<>
|
||||
string ToStrHelper<false, VkClearColorValue>::Get(const VkClearColorValue &el)
|
||||
{
|
||||
return StringFormat::Fmt("VkClearColorValue<%f,%f,%f,%f>"
|
||||
, el.f32[0], el.f32[1], el.f32[2], el.f32[3]);
|
||||
, el.float32[0], el.float32[1], el.float32[2], el.float32[3]);
|
||||
}
|
||||
template<>
|
||||
string ToStrHelper<false, VkClearDepthStencilValue>::Get(const VkClearDepthStencilValue &el)
|
||||
{
|
||||
return StringFormat::Fmt("VkClearDepthStencilValue<%f %u>"
|
||||
, el.depth, el.stencil);
|
||||
}
|
||||
template<>
|
||||
string ToStrHelper<false, VkClearValue>::Get(const VkClearValue &el)
|
||||
{
|
||||
return StringFormat::Fmt("VkClearValue[ col:<%f,%f,%f,%f> / d:%f s:%u ]"
|
||||
, el.color.f32[0], el.color.f32[1], el.color.f32[2], el.color.f32[3]
|
||||
, el.ds.depth, el.ds.stencil);
|
||||
, el.color.float32[0], el.color.float32[1], el.color.float32[2], el.color.float32[3]
|
||||
, el.depthStencil.depth, el.depthStencil.stencil);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -1921,37 +1927,69 @@ string ToStrHelper<false, VkAttachmentReference>::Get(const VkAttachmentReferenc
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkSurfaceTransformWSI>::Get(const VkSurfaceTransformWSI &el)
|
||||
string ToStrHelper<false, VkSurfaceTransformKHR>::Get(const VkSurfaceTransformKHR &el)
|
||||
{
|
||||
switch(el)
|
||||
{
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_NONE_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT90_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT180_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT270_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT90_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT180_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT270_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_INHERIT_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_NONE_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT90_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT180_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_ROT270_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT90_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT180_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_HMIRROR_ROT270_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_SURFACE_TRANSFORM_INHERIT_KHR)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkSurfaceTransformWSI<%d>", el);
|
||||
return StringFormat::Fmt("VkSurfaceTransformKHR<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkPresentModeWSI>::Get(const VkPresentModeWSI &el)
|
||||
string ToStrHelper<false, VkSurfaceTransformFlagBitsKHR>::Get(const VkSurfaceTransformFlagBitsKHR &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el & VK_SURFACE_TRANSFORM_ROT90_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_ROT90_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_ROT180_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_ROT180_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_ROT270_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_ROT270_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR";
|
||||
if(el & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) ret += " | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkColorSpaceKHR>::Get(const VkColorSpaceKHR &el)
|
||||
{
|
||||
switch(el)
|
||||
{
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_IMMEDIATE_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_MAILBOX_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_FIFO_WSI)
|
||||
TOSTR_CASE_STRINGIZE(VK_COLORSPACE_SRGB_NONLINEAR_KHR)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkPresentModeWSI<%d>", el);
|
||||
return StringFormat::Fmt("VkColorSpaceKHR<%d>", el);
|
||||
}
|
||||
|
||||
template<>
|
||||
string ToStrHelper<false, VkPresentModeKHR>::Get(const VkPresentModeKHR &el)
|
||||
{
|
||||
switch(el)
|
||||
{
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_IMMEDIATE_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_MAILBOX_KHR)
|
||||
TOSTR_CASE_STRINGIZE(VK_PRESENT_MODE_FIFO_KHR)
|
||||
default: break;
|
||||
}
|
||||
|
||||
return StringFormat::Fmt("VkPresentModeKHR<%d>", el);
|
||||
}
|
||||
|
||||
// we know the object will be a non-dispatchable object type
|
||||
@@ -2022,7 +2060,7 @@ void Serialiser::Serialise(const char *name, VkPhysicalDeviceFeatures &el)
|
||||
Serialise("sampleRateShading", el.sampleRateShading);
|
||||
Serialise("dualSourceBlend", el.dualSourceBlend);
|
||||
Serialise("logicOp", el.logicOp);
|
||||
Serialise("instancedDrawIndirect", el.instancedDrawIndirect);
|
||||
Serialise("multiDrawIndirect", el.multiDrawIndirect);
|
||||
Serialise("depthClip", el.depthClip);
|
||||
Serialise("depthBiasClamp", el.depthBiasClamp);
|
||||
Serialise("fillModeNonSolid", el.fillModeNonSolid);
|
||||
@@ -2039,11 +2077,9 @@ void Serialiser::Serialise(const char *name, VkPhysicalDeviceFeatures &el)
|
||||
Serialise("fragmentSideEffects", el.fragmentSideEffects);
|
||||
Serialise("shaderTessellationPointSize", el.shaderTessellationPointSize);
|
||||
Serialise("shaderGeometryPointSize", el.shaderGeometryPointSize);
|
||||
Serialise("shaderTextureGatherExtended", el.shaderTextureGatherExtended);
|
||||
Serialise("shaderTextureGatherExtended", el.shaderImageGatherExtended);
|
||||
Serialise("shaderStorageImageExtendedFormats", el.shaderStorageImageExtendedFormats);
|
||||
Serialise("shaderStorageImageMultisample", el.shaderStorageImageMultisample);
|
||||
Serialise("shaderStorageBufferArrayConstantIndexing", el.shaderStorageBufferArrayConstantIndexing);
|
||||
Serialise("shaderStorageImageArrayConstantIndexing", el.shaderStorageImageArrayConstantIndexing);
|
||||
Serialise("shaderUniformBufferArrayDynamicIndexing", el.shaderUniformBufferArrayDynamicIndexing);
|
||||
Serialise("shaderSampledImageArrayDynamicIndexing", el.shaderSampledImageArrayDynamicIndexing);
|
||||
Serialise("shaderStorageBufferArrayDynamicIndexing", el.shaderStorageBufferArrayDynamicIndexing);
|
||||
@@ -2052,11 +2088,10 @@ void Serialiser::Serialise(const char *name, VkPhysicalDeviceFeatures &el)
|
||||
Serialise("shaderCullDistance", el.shaderCullDistance);
|
||||
Serialise("shaderFloat64", el.shaderFloat64);
|
||||
Serialise("shaderInt64", el.shaderInt64);
|
||||
Serialise("shaderFloat16", el.shaderFloat16);
|
||||
Serialise("shaderInt16", el.shaderInt16);
|
||||
Serialise("shaderResourceResidency", el.shaderResourceResidency);
|
||||
Serialise("shaderResourceMinLOD", el.shaderResourceMinLOD);
|
||||
Serialise("sparse", el.sparse);
|
||||
Serialise("sparseBinding", el.sparseBinding);
|
||||
Serialise("sparseResidencyBuffer", el.sparseResidencyBuffer);
|
||||
Serialise("sparseResidencyImage2D", el.sparseResidencyImage2D);
|
||||
Serialise("sparseResidencyImage3D", el.sparseResidencyImage3D);
|
||||
@@ -2064,12 +2099,6 @@ void Serialiser::Serialise(const char *name, VkPhysicalDeviceFeatures &el)
|
||||
Serialise("sparseResidency4Samples", el.sparseResidency4Samples);
|
||||
Serialise("sparseResidency8Samples", el.sparseResidency8Samples);
|
||||
Serialise("sparseResidency16Samples", el.sparseResidency16Samples);
|
||||
Serialise("sparseResidencyStandard2DBlockShape", el.sparseResidencyStandard2DBlockShape);
|
||||
Serialise("sparseResidencyStandard2DMSBlockShape", el.sparseResidencyStandard2DMSBlockShape);
|
||||
Serialise("sparseResidencyStandard3DBlockShape", el.sparseResidencyStandard3DBlockShape);
|
||||
Serialise("sparseResidencyAlignedMipSize", el.sparseResidencyAlignedMipSize);
|
||||
Serialise("sparseResidencyNonResident", el.sparseResidencyNonResident);
|
||||
Serialise("sparseResidencyNonResidentStrict", el.sparseResidencyNonResidentStrict);
|
||||
Serialise("sparseResidencyAliased", el.sparseResidencyAliased);
|
||||
}
|
||||
|
||||
@@ -2082,8 +2111,6 @@ void Serialiser::Serialise(const char *name, VkDeviceCreateInfo &el)
|
||||
Serialise("sType", el.sType);
|
||||
SerialiseNext(this, el.pNext);
|
||||
|
||||
Serialise("flags", (VkDeviceCreateFlagBits &)el.flags);
|
||||
|
||||
SerialiseComplexArray("pRequestedQueues", (VkDeviceQueueCreateInfo *&)el.pRequestedQueues, el.queueRecordCount);
|
||||
|
||||
// need to do this by hand to use string DB
|
||||
@@ -2162,7 +2189,6 @@ void Serialiser::Serialise(const char *name, VkBufferViewCreateInfo &el)
|
||||
SerialiseNext(this, el.pNext);
|
||||
|
||||
SerialiseObject(VkBuffer, "buffer", el.buffer);
|
||||
Serialise("viewType", el.viewType);
|
||||
Serialise("format", el.format);
|
||||
Serialise("offset", el.offset);
|
||||
Serialise("range", el.range);
|
||||
@@ -2267,22 +2293,22 @@ void Serialiser::Serialise(const char *name, VkSubpassDescription &el)
|
||||
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
el.inputAttachments = NULL;
|
||||
el.colorAttachments = NULL;
|
||||
el.resolveAttachments = NULL;
|
||||
el.preserveAttachments = NULL;
|
||||
el.pInputAttachments = NULL;
|
||||
el.pColorAttachments = NULL;
|
||||
el.pResolveAttachments = NULL;
|
||||
el.pPreserveAttachments = NULL;
|
||||
}
|
||||
|
||||
SerialisePODArray("inputAttachments", (VkAttachmentReference *&)el.inputAttachments, el.inputCount);
|
||||
SerialisePODArray("colorAttachments", (VkAttachmentReference *&)el.colorAttachments, el.colorCount);
|
||||
SerialisePODArray("inputAttachments", (VkAttachmentReference *&)el.pInputAttachments, el.inputCount);
|
||||
SerialisePODArray("colorAttachments", (VkAttachmentReference *&)el.pColorAttachments, el.colorCount);
|
||||
|
||||
bool hasResolves = (el.resolveAttachments != NULL);
|
||||
bool hasResolves = (el.pResolveAttachments != NULL);
|
||||
Serialise("hasResolves", hasResolves);
|
||||
|
||||
if(hasResolves)
|
||||
SerialisePODArray("resolveAttachments", (VkAttachmentReference *&)el.resolveAttachments, el.colorCount);
|
||||
SerialisePODArray("resolveAttachments", (VkAttachmentReference *&)el.pResolveAttachments, el.colorCount);
|
||||
|
||||
SerialisePODArray("preserveAttachments", (VkAttachmentReference *&)el.preserveAttachments, el.preserveCount);
|
||||
SerialisePODArray("preserveAttachments", (VkAttachmentReference *&)el.pPreserveAttachments, el.preserveCount);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2331,8 +2357,8 @@ void Serialiser::Serialise(const char *name, VkRenderPassBeginInfo &el)
|
||||
Serialise("renderArea", el.renderArea);
|
||||
|
||||
if(m_Mode == READING)
|
||||
el.pAttachmentClearValues = NULL;
|
||||
SerialisePODArray("pAttachmentClearValues", (VkClearValue *&)el.pAttachmentClearValues, el.attachmentCount);
|
||||
el.pClearValues = NULL;
|
||||
SerialisePODArray("pClearValues", (VkClearValue *&)el.pClearValues, el.clearValueCount);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2434,7 +2460,7 @@ void Serialiser::Serialise(const char *name, VkPipelineMultisampleStateCreateInf
|
||||
Serialise("rasterSamples", el.rasterSamples);
|
||||
Serialise("sampleShadingEnable", el.sampleShadingEnable);
|
||||
Serialise("minSampleShading", el.minSampleShading);
|
||||
Serialise("sampleMask", el.sampleMask);
|
||||
SerialiseOptionalObject(this, "sampleMask", (VkSampleMask *&)el.pSampleMask);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2482,10 +2508,12 @@ void Serialiser::Serialise(const char *name, VkPipelineDepthStencilStateCreateIn
|
||||
Serialise("depthTestEnable", el.depthTestEnable);
|
||||
Serialise("depthWriteEnable", el.depthWriteEnable);
|
||||
Serialise("depthCompareOp", el.depthCompareOp);
|
||||
Serialise("depthBoundsEnable", el.depthBoundsEnable);
|
||||
Serialise("depthBoundsTestEnable", el.depthBoundsTestEnable);
|
||||
Serialise("stencilEnable", el.stencilTestEnable);
|
||||
Serialise("front", el.front);
|
||||
Serialise("back", el.back);
|
||||
Serialise("minDepthBounds", el.minDepthBounds);
|
||||
Serialise("maxDepthBounds", el.maxDepthBounds);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2594,9 +2622,9 @@ void Serialiser::Serialise(const char *name, VkSamplerCreateInfo &el)
|
||||
Serialise("minFilter", el.minFilter);
|
||||
Serialise("magFilter", el.magFilter);
|
||||
Serialise("mipMode", el.mipMode);
|
||||
Serialise("addressU", el.addressU);
|
||||
Serialise("addressV", el.addressV);
|
||||
Serialise("addressW", el.addressW);
|
||||
Serialise("addressModeU", el.addressModeU);
|
||||
Serialise("addressModeV", el.addressModeV);
|
||||
Serialise("addressModeW", el.addressModeW);
|
||||
Serialise("mipLodBias", el.mipLodBias);
|
||||
Serialise("maxAnisotropy", el.maxAnisotropy);
|
||||
Serialise("compareOp", el.compareOp);
|
||||
@@ -2753,10 +2781,21 @@ void Serialiser::Serialise(const char *name, VkImageSubresourceRange &el)
|
||||
{
|
||||
ScopedContext scope(this, name, "VkImageSubresourceRange", 0, true);
|
||||
|
||||
Serialise("aspect", el.aspect);
|
||||
Serialise("aspectMask", (VkImageAspectFlagBits &)el.aspectMask);
|
||||
Serialise("baseMipLevel", el.baseMipLevel);
|
||||
Serialise("mipLevels", el.mipLevels);
|
||||
Serialise("baseArraySlice", el.baseArraySlice);
|
||||
Serialise("baseArrayLayer", el.baseArrayLayer);
|
||||
Serialise("arraySize", el.arraySize);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkImageSubresourceCopy &el)
|
||||
{
|
||||
ScopedContext scope(this, name, "VkImageSubresourceCopy", 0, true);
|
||||
|
||||
Serialise("aspect", el.aspect);
|
||||
Serialise("mipLevel", el.mipLevel);
|
||||
Serialise("arrayLayer", el.arrayLayer);
|
||||
Serialise("arraySize", el.arraySize);
|
||||
}
|
||||
|
||||
@@ -2767,7 +2806,7 @@ void Serialiser::Serialise(const char *name, VkImageSubresource &el)
|
||||
|
||||
Serialise("aspect", el.aspect);
|
||||
Serialise("mipLevel", el.mipLevel);
|
||||
Serialise("arraySlice", el.arraySlice);
|
||||
Serialise("arrayLayer", el.arrayLayer);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2870,7 +2909,7 @@ void Serialiser::Serialise(const char *name, VkComputePipelineCreateInfo &el)
|
||||
Serialise("sType", el.sType);
|
||||
SerialiseNext(this, el.pNext);
|
||||
|
||||
Serialise("cs", el.cs);
|
||||
Serialise("stage", el.stage);
|
||||
Serialise("flags", (VkPipelineCreateFlagBits &)el.flags);
|
||||
SerialiseObject(VkPipelineLayout, "layout", el.layout);
|
||||
SerialiseObject(VkPipeline, "basePipelineHandle", el.basePipelineHandle);
|
||||
@@ -2908,8 +2947,8 @@ void Serialiser::Serialise(const char *name, VkDescriptorInfo &el)
|
||||
SerialiseObject(VkImageView, "imageView", el.imageView);
|
||||
Serialise("imageLayout", el.imageLayout);
|
||||
SerialiseObject(VkBuffer, "bufferInfo.buffer", el.bufferInfo.buffer);
|
||||
SerialiseObject(VkDeviceSize, "bufferInfo.offset", el.bufferInfo.offset);
|
||||
SerialiseObject(VkDeviceSize, "bufferInfo.range", el.bufferInfo.range);
|
||||
Serialise("bufferInfo.offset", el.bufferInfo.offset);
|
||||
Serialise("bufferInfo.range", el.bufferInfo.range);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -3090,11 +3129,11 @@ void Serialiser::Serialise(const char *name, VkRect3D &el)
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkSwapChainCreateInfoWSI &el)
|
||||
void Serialiser::Serialise(const char *name, VkSwapchainCreateInfoKHR &el)
|
||||
{
|
||||
ScopedContext scope(this, name, "VkSwapChainCreateInfoWSI", 0, true);
|
||||
ScopedContext scope(this, name, "VkSwapchainCreateInfoKHR", 0, true);
|
||||
|
||||
RDCASSERT(m_Mode < WRITING || el.sType == VK_STRUCTURE_TYPE_SWAP_CHAIN_CREATE_INFO_WSI);
|
||||
RDCASSERT(m_Mode < WRITING || el.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR);
|
||||
Serialise("sType", el.sType);
|
||||
SerialiseNext(this, el.pNext);
|
||||
|
||||
@@ -3103,10 +3142,13 @@ void Serialiser::Serialise(const char *name, VkSwapChainCreateInfoWSI &el)
|
||||
|
||||
Serialise("minImageCount", el.minImageCount);
|
||||
Serialise("imageFormat", el.imageFormat);
|
||||
Serialise("imageColorSpace", el.imageColorSpace);
|
||||
Serialise("imageExtent", el.imageExtent);
|
||||
Serialise("imageUsageFlags", el.imageUsageFlags);
|
||||
Serialise("preTransform", el.preTransform);
|
||||
Serialise("imageArraySize", el.imageArraySize);
|
||||
|
||||
// VKTODOLOW: do we need sharingMode, queueFamilyCount, pQueueFamilyIndices?
|
||||
|
||||
Serialise("presentMode", el.presentMode);
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ template<> void Serialiser::Serialise(const char *name, VkShaderCreateInfo &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkShaderModuleCreateInfo &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkImageSubresourceRange &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkImageSubresource &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkImageSubresourceCopy &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkMemoryAllocInfo &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkMemoryBarrier &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkBufferMemoryBarrier &el);
|
||||
@@ -129,7 +130,7 @@ template<> void Serialiser::Serialise(const char *name, VkImageCopy &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkImageBlit &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkImageResolve &el);
|
||||
|
||||
template<> void Serialiser::Serialise(const char *name, VkSwapChainCreateInfoWSI &el);
|
||||
template<> void Serialiser::Serialise(const char *name, VkSwapchainCreateInfoKHR &el);
|
||||
|
||||
#pragma region Chunks
|
||||
|
||||
@@ -158,12 +159,7 @@ enum VulkanChunkType
|
||||
CREATE_BUFFER_VIEW,
|
||||
CREATE_IMAGE,
|
||||
CREATE_IMAGE_VIEW,
|
||||
CREATE_ATTACHMENT_VIEW,
|
||||
CREATE_DEPTH_TARGET_VIEW,
|
||||
CREATE_VIEWPORT_STATE,
|
||||
CREATE_RASTER_STATE,
|
||||
CREATE_BLEND_STATE,
|
||||
CREATE_DEPTH_STATE,
|
||||
CREATE_SAMPLER,
|
||||
CREATE_SHADER,
|
||||
CREATE_SHADER_MODULE,
|
||||
@@ -171,7 +167,7 @@ enum VulkanChunkType
|
||||
CREATE_PIPE_CACHE,
|
||||
CREATE_GRAPHICS_PIPE,
|
||||
CREATE_COMPUTE_PIPE,
|
||||
PRESENT_IMAGE,
|
||||
GET_SWAPCHAIN_IMAGE,
|
||||
|
||||
CREATE_SEMAPHORE,
|
||||
CREATE_FENCE,
|
||||
@@ -200,6 +196,7 @@ enum VulkanChunkType
|
||||
END_RENDERPASS,
|
||||
|
||||
BIND_PIPELINE,
|
||||
|
||||
SET_VP,
|
||||
SET_SCISSOR,
|
||||
SET_LINE_WIDTH,
|
||||
@@ -209,6 +206,7 @@ enum VulkanChunkType
|
||||
SET_STENCIL_COMP_MASK,
|
||||
SET_STENCIL_WRITE_MASK,
|
||||
SET_STENCIL_REF,
|
||||
|
||||
BIND_DESCRIPTOR_SET,
|
||||
BIND_VERTEX_BUFFERS,
|
||||
BIND_INDEX_BUFFER,
|
||||
@@ -219,11 +217,13 @@ enum VulkanChunkType
|
||||
BLIT_IMG,
|
||||
RESOLVE_IMG,
|
||||
UPDATE_BUF,
|
||||
|
||||
CLEAR_COLOR,
|
||||
CLEAR_DEPTHSTENCIL,
|
||||
CLEAR_COLOR_ATTACH,
|
||||
CLEAR_DEPTHSTENCIL_ATTACH,
|
||||
PIPELINE_BARRIER,
|
||||
|
||||
WRITE_TIMESTAMP,
|
||||
BEGIN_QUERY,
|
||||
END_QUERY,
|
||||
|
||||
@@ -73,7 +73,7 @@ const char *VkChunkNames[] =
|
||||
"vkCreatePipelineCache",
|
||||
"vkCreateGraphicsPipelines",
|
||||
"vkCreateComputePipelines",
|
||||
"vkGetSwapChainInfoWSI",
|
||||
"vkGetSwapchainImagesKHR",
|
||||
|
||||
"vkCreateSemaphore",
|
||||
"vkCreateFence",
|
||||
@@ -123,11 +123,13 @@ const char *VkChunkNames[] =
|
||||
"vkCmdBlitImage",
|
||||
"vkCmdResolveImage",
|
||||
"vkCmdUpdateBuffer",
|
||||
|
||||
"vkCmdClearColorImage",
|
||||
"vkCmdClearDepthStencilImage",
|
||||
"vkCmdClearColorAttachment",
|
||||
"vkCmdClearDepthStencilAttachment",
|
||||
"vkCmdPipelineBarrier",
|
||||
|
||||
"vkCmdWriteTimestamp",
|
||||
"vkCmdBeginQuery",
|
||||
"vkCmdEndQuery",
|
||||
@@ -143,7 +145,7 @@ const char *VkChunkNames[] =
|
||||
"vkCmdDbgMarker", // no equivalent function at the moment
|
||||
"vkCmdDbgMarkerEnd",
|
||||
|
||||
"vkCreateSwapChainWSI",
|
||||
"vkCreateSwapchainKHR",
|
||||
|
||||
"Capture",
|
||||
"BeginCapture",
|
||||
@@ -946,7 +948,7 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
Serialise_vkCreateRenderPass(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
break;
|
||||
case CREATE_DESCRIPTOR_POOL:
|
||||
Serialise_vkCreateDescriptorPool(GetMainSerialiser(), VK_NULL_HANDLE, VK_DESCRIPTOR_POOL_USAGE_MAX_ENUM, 0, NULL, NULL);
|
||||
Serialise_vkCreateDescriptorPool(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
break;
|
||||
case CREATE_DESCRIPTOR_SET_LAYOUT:
|
||||
Serialise_vkCreateDescriptorSetLayout(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
@@ -985,8 +987,8 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
//VKTODOMED:
|
||||
//Serialise_vkCreateComputePipelines(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
break;
|
||||
case PRESENT_IMAGE:
|
||||
Serialise_vkGetSwapChainInfoWSI(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_SWAP_CHAIN_INFO_TYPE_MAX_ENUM_WSI, NULL, NULL);
|
||||
case GET_SWAPCHAIN_IMAGE:
|
||||
Serialise_vkGetSwapchainImagesKHR(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, NULL);
|
||||
break;
|
||||
|
||||
case CREATE_SEMAPHORE:
|
||||
@@ -1008,7 +1010,7 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
break;
|
||||
|
||||
case ALLOC_DESC_SET:
|
||||
Serialise_vkAllocDescriptorSets(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_DESCRIPTOR_SET_USAGE_MAX_ENUM, 0, NULL, NULL, NULL);
|
||||
Serialise_vkAllocDescriptorSets(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_DESCRIPTOR_SET_USAGE_MAX_ENUM, 0, NULL, NULL);
|
||||
break;
|
||||
case UPDATE_DESC_SET:
|
||||
Serialise_vkUpdateDescriptorSets(GetMainSerialiser(), VK_NULL_HANDLE, 0, NULL, 0, NULL);
|
||||
@@ -1064,25 +1066,25 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
Serialise_vkCmdSetScissor(GetMainSerialiser(), VK_NULL_HANDLE, 0, NULL);
|
||||
break;
|
||||
case SET_LINE_WIDTH:
|
||||
Serialise_vkCmdSetLineWidth(GetMainSerialiser(), 0);
|
||||
Serialise_vkCmdSetLineWidth(GetMainSerialiser(), VK_NULL_HANDLE, 0);
|
||||
break;
|
||||
case SET_DEPTH_BIAS:
|
||||
Serialise_vkCmdSetDepthBias(GetMainSerialiser(), 0.0f, 0.0f, 0.0f);
|
||||
Serialise_vkCmdSetDepthBias(GetMainSerialiser(), VK_NULL_HANDLE, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case SET_BLEND_CONST:
|
||||
Serialise_vkCmdSetLineWidth(GetMainSerialiser(), NULL);
|
||||
Serialise_vkCmdSetLineWidth(GetMainSerialiser(), VK_NULL_HANDLE, NULL);
|
||||
break;
|
||||
case SET_DEPTH_BOUNDS:
|
||||
Serialise_vkCmdSetDepthBounds(GetMainSerialiser(), 0.0f, 0.0f);
|
||||
Serialise_vkCmdSetDepthBounds(GetMainSerialiser(), VK_NULL_HANDLE, 0.0f, 0.0f);
|
||||
break;
|
||||
case SET_STENCIL_COMP_MASK:
|
||||
Serialise_vkCmdSetStencilCompareMask(GetMainSerialiser(), VK_STENCIL_FACE_NONE, 0);
|
||||
Serialise_vkCmdSetStencilCompareMask(GetMainSerialiser(), VK_NULL_HANDLE, VK_STENCIL_FACE_NONE, 0);
|
||||
break;
|
||||
case SET_STENCIL_WRITE_MASK:
|
||||
Serialise_vkCmdSetStencilWriteMask(GetMainSerialiser(), VK_STENCIL_FACE_NONE, 0);
|
||||
Serialise_vkCmdSetStencilWriteMask(GetMainSerialiser(), VK_NULL_HANDLE, VK_STENCIL_FACE_NONE, 0);
|
||||
break;
|
||||
case SET_STENCIL_REF:
|
||||
Serialise_vkCmdSetStencilReference(GetMainSerialiser(), VK_STENCIL_FACE_NONE, 0);
|
||||
Serialise_vkCmdSetStencilReference(GetMainSerialiser(), VK_NULL_HANDLE, VK_STENCIL_FACE_NONE, 0);
|
||||
break;
|
||||
case BIND_DESCRIPTOR_SET:
|
||||
Serialise_vkCmdBindDescriptorSets(GetMainSerialiser(), VK_NULL_HANDLE, VK_PIPELINE_BIND_POINT_MAX_ENUM, VK_NULL_HANDLE, 0, 0, NULL, 0, NULL);
|
||||
@@ -1118,13 +1120,13 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
Serialise_vkCmdClearColorImage(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, NULL, 0, NULL);
|
||||
break;
|
||||
case CLEAR_DEPTHSTENCIL:
|
||||
Serialise_vkCmdClearDepthStencilImage(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, 0.0f, 0, 0, NULL);
|
||||
Serialise_vkCmdClearDepthStencilImage(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, NULL, 0, NULL);
|
||||
break;
|
||||
case CLEAR_COLOR_ATTACH:
|
||||
Serialise_vkCmdClearColorAttachment(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, NULL, 0, NULL);
|
||||
break;
|
||||
case CLEAR_DEPTHSTENCIL_ATTACH:
|
||||
Serialise_vkCmdClearDepthStencilAttachment(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, 0.0f, 0, 0, NULL);
|
||||
Serialise_vkCmdClearDepthStencilAttachment(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_MAX_ENUM, NULL, 0, NULL);
|
||||
break;
|
||||
case PIPELINE_BARRIER:
|
||||
Serialise_vkCmdPipelineBarrier(GetMainSerialiser(), VK_NULL_HANDLE, 0, 0, VK_FALSE, 0, NULL);
|
||||
@@ -1172,7 +1174,7 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
break;
|
||||
|
||||
case CREATE_SWAP_BUFFER:
|
||||
Serialise_vkCreateSwapChainWSI(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
Serialise_vkCreateSwapchainKHR(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
break;
|
||||
|
||||
case CAPTURE_SCOPE:
|
||||
@@ -1208,10 +1210,10 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
AddEvent(CONTEXT_CAPTURE_FOOTER, "vkQueuePresentWSI()");
|
||||
AddEvent(CONTEXT_CAPTURE_FOOTER, "vkQueuePresentKHR()");
|
||||
|
||||
FetchDrawcall draw;
|
||||
draw.name = "vkQueuePresentWSI()";
|
||||
draw.name = "vkQueuePresentKHR()";
|
||||
draw.flags |= eDraw_Present;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
const VkInstanceCreateInfo* pCreateInfo,
|
||||
VkInstance* pInstance);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyInstance,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyInstance,
|
||||
VkInstance instance);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkEnumeratePhysicalDevices,
|
||||
@@ -515,24 +515,17 @@ public:
|
||||
VkImageType type,
|
||||
VkImageTiling tiling,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageCreateFlags flags,
|
||||
VkImageFormatProperties* pImageFormatProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceLimits,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceLimits* pLimits);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceProperties* pProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceQueueCount,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceQueueFamilyProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t* pCount);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceQueueProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t count,
|
||||
VkPhysicalDeviceQueueProperties* pQueueProperties);
|
||||
uint32_t* pCount,
|
||||
VkQueueFamilyProperties* pQueueFamilyProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceMemoryProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
@@ -545,7 +538,7 @@ public:
|
||||
const VkDeviceCreateInfo* pCreateInfo,
|
||||
VkDevice* pDevice);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyDevice,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyDevice,
|
||||
VkDevice device);
|
||||
|
||||
// Queue functions
|
||||
@@ -585,7 +578,7 @@ public:
|
||||
const VkQueryPoolCreateInfo* pCreateInfo,
|
||||
VkQueryPool* pQueryPool);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyQueryPool,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyQueryPool,
|
||||
VkDevice device,
|
||||
VkQueryPool queryPool);
|
||||
|
||||
@@ -605,7 +598,7 @@ public:
|
||||
const VkSemaphoreCreateInfo* pCreateInfo,
|
||||
VkSemaphore* pSemaphore);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroySemaphore,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroySemaphore,
|
||||
VkDevice device,
|
||||
VkSemaphore semaphore);
|
||||
|
||||
@@ -624,7 +617,7 @@ public:
|
||||
const VkFenceCreateInfo* pCreateInfo,
|
||||
VkFence* pFence);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyFence,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyFence,
|
||||
VkDevice device,
|
||||
VkFence fence);
|
||||
|
||||
@@ -639,7 +632,7 @@ public:
|
||||
const VkMemoryAllocInfo* pAllocInfo,
|
||||
VkDeviceMemory* pMem);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkFreeMemory,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkFreeMemory,
|
||||
VkDevice device,
|
||||
VkDeviceMemory mem);
|
||||
|
||||
@@ -651,7 +644,7 @@ public:
|
||||
VkMemoryMapFlags flags,
|
||||
void** ppData);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkUnmapMemory,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkUnmapMemory,
|
||||
VkDevice device,
|
||||
VkDeviceMemory mem);
|
||||
|
||||
@@ -691,7 +684,7 @@ public:
|
||||
const VkBufferCreateInfo* pCreateInfo,
|
||||
VkBuffer* pBuffer);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyBuffer,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyBuffer,
|
||||
VkDevice device,
|
||||
VkBuffer buffer);
|
||||
|
||||
@@ -702,7 +695,7 @@ public:
|
||||
const VkBufferViewCreateInfo* pCreateInfo,
|
||||
VkBufferView* pView);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyBufferView,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyBufferView,
|
||||
VkDevice device,
|
||||
VkBufferView view);
|
||||
|
||||
@@ -713,7 +706,7 @@ public:
|
||||
const VkImageCreateInfo* pCreateInfo,
|
||||
VkImage* pImage);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyImage,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyImage,
|
||||
VkDevice device,
|
||||
VkImage image);
|
||||
|
||||
@@ -730,7 +723,7 @@ public:
|
||||
const VkImageViewCreateInfo* pCreateInfo,
|
||||
VkImageView* pView);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyImageView,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyImageView,
|
||||
VkDevice device,
|
||||
VkImageView view);
|
||||
|
||||
@@ -741,7 +734,7 @@ public:
|
||||
const VkShaderModuleCreateInfo* pCreateInfo,
|
||||
VkShaderModule* pShaderModule);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyShaderModule,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyShaderModule,
|
||||
VkDevice device,
|
||||
VkShaderModule shaderModule);
|
||||
|
||||
@@ -750,7 +743,7 @@ public:
|
||||
const VkShaderCreateInfo* pCreateInfo,
|
||||
VkShader* pShader);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyShader,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyShader,
|
||||
VkDevice device,
|
||||
VkShader shader);
|
||||
|
||||
@@ -763,7 +756,7 @@ public:
|
||||
const VkGraphicsPipelineCreateInfo* pCreateInfos,
|
||||
VkPipeline* pPipelines);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyPipeline,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyPipeline,
|
||||
VkDevice device,
|
||||
VkPipeline pipeline);
|
||||
|
||||
@@ -772,7 +765,7 @@ public:
|
||||
const VkPipelineCacheCreateInfo* pCreateInfo,
|
||||
VkPipelineCache* pPipelineCache);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyPipelineCache,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyPipelineCache,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache);
|
||||
|
||||
@@ -783,7 +776,7 @@ public:
|
||||
const VkPipelineLayoutCreateInfo* pCreateInfo,
|
||||
VkPipelineLayout* pPipelineLayout);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyPipelineLayout,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyPipelineLayout,
|
||||
VkDevice device,
|
||||
VkPipelineLayout pipelineLayout);
|
||||
|
||||
@@ -794,7 +787,7 @@ public:
|
||||
const VkSamplerCreateInfo* pCreateInfo,
|
||||
VkSampler* pSampler);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroySampler,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroySampler,
|
||||
VkDevice device,
|
||||
VkSampler sampler);
|
||||
|
||||
@@ -805,31 +798,28 @@ public:
|
||||
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
|
||||
VkDescriptorSetLayout* pSetLayout);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyDescriptorSetLayout,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyDescriptorSetLayout,
|
||||
VkDevice device,
|
||||
VkDescriptorSetLayout setLayout);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateDescriptorPool,
|
||||
VkDevice device,
|
||||
VkDescriptorPoolUsage poolUsage,
|
||||
uint32_t maxSets,
|
||||
const VkDescriptorPoolCreateInfo* pCreateInfo,
|
||||
VkDescriptorPool* pDescriptorPool);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyDescriptorPool,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyDescriptorPool,
|
||||
VkDevice device,
|
||||
VkDescriptorPool descriptorPool);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkAllocDescriptorSets,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkAllocDescriptorSets,
|
||||
VkDevice device,
|
||||
VkDescriptorPool descriptorPool,
|
||||
VkDescriptorSetUsage setUsage,
|
||||
uint32_t count,
|
||||
const VkDescriptorSetLayout* pSetLayouts,
|
||||
VkDescriptorSet* pDescriptorSets,
|
||||
uint32_t* pCount);
|
||||
VkDescriptorSet* pDescriptorSets);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkUpdateDescriptorSets,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkUpdateDescriptorSets,
|
||||
VkDevice device,
|
||||
uint32_t writeCount,
|
||||
const VkWriteDescriptorSet* pDescriptorWrites,
|
||||
@@ -849,7 +839,7 @@ public:
|
||||
const VkCmdPoolCreateInfo* pCreateInfo,
|
||||
VkCmdPool* pCmdPool);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyCommandPool,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyCommandPool,
|
||||
VkDevice device,
|
||||
VkCmdPool VkCmdPool);
|
||||
|
||||
@@ -865,7 +855,7 @@ public:
|
||||
const VkCmdBufferCreateInfo* pCreateInfo,
|
||||
VkCmdBuffer* pCmdBuffer);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyCommandBuffer,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyCommandBuffer,
|
||||
VkDevice device,
|
||||
VkCmdBuffer cmdBuffer);
|
||||
|
||||
@@ -1064,8 +1054,7 @@ public:
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImage image,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rangeCount,
|
||||
const VkImageSubresourceRange* pRanges);
|
||||
|
||||
@@ -1081,8 +1070,7 @@ public:
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImageAspectFlags imageAspectMask,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rectCount,
|
||||
const VkRect3D* pRects);
|
||||
|
||||
@@ -1116,7 +1104,7 @@ public:
|
||||
const VkFramebufferCreateInfo* pCreateInfo,
|
||||
VkFramebuffer* pFramebuffer);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyFramebuffer,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyFramebuffer,
|
||||
VkDevice device,
|
||||
VkFramebuffer framebuffer);
|
||||
|
||||
@@ -1125,7 +1113,7 @@ public:
|
||||
const VkRenderPassCreateInfo* pCreateInfo,
|
||||
VkRenderPass* pRenderPass);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroyRenderPass,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyRenderPass,
|
||||
VkDevice device,
|
||||
VkRenderPass renderPass);
|
||||
|
||||
@@ -1157,45 +1145,54 @@ public:
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdDbgMarkerEnd,
|
||||
VkCmdBuffer cmdBuffer);
|
||||
|
||||
// WSI functions
|
||||
// KHR functions
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceSurfaceSupportWSI,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceSurfaceSupportKHR,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
const VkSurfaceDescriptionWSI* pSurfaceDescription,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
VkBool32* pSupported);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateSwapChainWSI,
|
||||
VkDevice device,
|
||||
const VkSwapChainCreateInfoWSI* pCreateInfo,
|
||||
VkSwapChainWSI* pSwapChain);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroySwapChainWSI,
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSurfacePropertiesKHR,
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSurfaceInfoWSI,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
VkSurfacePropertiesKHR* pSurfaceProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSurfaceFormatsKHR,
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionWSI* pSurfaceDescription,
|
||||
VkSurfaceInfoTypeWSI infoType,
|
||||
size_t* pDataSize,
|
||||
void* pData);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSwapChainInfoWSI,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkSurfaceFormatKHR* pSurfaceFormats);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSurfacePresentModesKHR,
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain,
|
||||
VkSwapChainInfoTypeWSI infoType,
|
||||
size_t* pDataSize,
|
||||
void* pData);
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkPresentModeKHR* pPresentModes);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkAcquireNextImageWSI,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateSwapchainKHR,
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain,
|
||||
const VkSwapchainCreateInfoKHR* pCreateInfo,
|
||||
VkSwapchainKHR* pSwapchain);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkDestroySwapchainKHR,
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetSwapchainImagesKHR,
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain,
|
||||
uint32_t* pCount,
|
||||
VkImage* pSwapchainImages);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkAcquireNextImageKHR,
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapChain,
|
||||
uint64_t timeout,
|
||||
VkSemaphore semaphore,
|
||||
uint32_t* pImageIndex);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkQueuePresentWSI,
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkQueuePresentKHR,
|
||||
VkQueue queue,
|
||||
VkPresentInfoWSI* pPresentInfo);
|
||||
VkPresentInfoKHR* pPresentInfo);
|
||||
};
|
||||
|
||||
@@ -90,9 +90,11 @@ void VulkanDebugManager::GPUBuffer::Create(WrappedVulkan *driver, VkDevice dev,
|
||||
{
|
||||
const VkLayerDispatchTable *vt = ObjDisp(dev);
|
||||
|
||||
sz = size;
|
||||
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
size, VK_BUFFER_USAGE_GENERAL, 0,
|
||||
size, VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
@@ -118,33 +120,22 @@ void VulkanDebugManager::GPUBuffer::Create(WrappedVulkan *driver, VkDevice dev,
|
||||
|
||||
vkr = vt->BindBufferMemory(Unwrap(dev), Unwrap(buf), Unwrap(mem), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
}
|
||||
|
||||
VkBufferViewCreateInfo bufviewInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, NULL,
|
||||
Unwrap(buf), VK_BUFFER_VIEW_TYPE_RAW,
|
||||
VK_FORMAT_UNDEFINED, 0, size,
|
||||
};
|
||||
|
||||
vkr = vt->CreateBufferView(Unwrap(dev), &bufviewInfo, &view);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), view);
|
||||
void VulkanDebugManager::GPUBuffer::FillDescriptor(VkDescriptorInfo &desc)
|
||||
{
|
||||
desc.bufferInfo.buffer = Unwrap(buf);
|
||||
desc.bufferInfo.offset = 0;
|
||||
desc.bufferInfo.range = sz;
|
||||
}
|
||||
|
||||
void VulkanDebugManager::GPUBuffer::Destroy(const VkLayerDispatchTable *vt, VkDevice dev)
|
||||
{
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
if(view != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyBufferView(Unwrap(dev), Unwrap(view));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
VKMGR()->ReleaseWrappedResource(view);
|
||||
view = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
|
||||
if(buf != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyBuffer(Unwrap(dev), Unwrap(buf));
|
||||
vt->DestroyBuffer(Unwrap(dev), Unwrap(buf));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
VKMGR()->ReleaseWrappedResource(buf);
|
||||
buf = VK_NULL_HANDLE;
|
||||
@@ -152,7 +143,7 @@ void VulkanDebugManager::GPUBuffer::Destroy(const VkLayerDispatchTable *vt, VkDe
|
||||
|
||||
if(mem != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->FreeMemory(Unwrap(dev), Unwrap(mem));
|
||||
vt->FreeMemory(Unwrap(dev), Unwrap(mem));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
VKMGR()->ReleaseWrappedResource(mem);
|
||||
mem = VK_NULL_HANDLE;
|
||||
@@ -219,7 +210,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, NULL,
|
||||
VK_TEX_FILTER_LINEAR, VK_TEX_FILTER_LINEAR,
|
||||
VK_TEX_MIPMAP_MODE_LINEAR,
|
||||
VK_TEX_ADDRESS_CLAMP, VK_TEX_ADDRESS_CLAMP, VK_TEX_ADDRESS_CLAMP,
|
||||
VK_TEX_ADDRESS_MODE_CLAMP, VK_TEX_ADDRESS_MODE_CLAMP, VK_TEX_ADDRESS_MODE_CLAMP,
|
||||
0.0f, // lod bias
|
||||
1.0f, // max aniso
|
||||
false, VK_COMPARE_OP_NEVER,
|
||||
@@ -339,35 +330,35 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
|
||||
VkDescriptorPoolCreateInfo descpoolInfo = {
|
||||
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, NULL,
|
||||
VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 4,
|
||||
ARRAY_COUNT(descPoolTypes), &descPoolTypes[0],
|
||||
};
|
||||
|
||||
vkr = vt->CreateDescriptorPool(Unwrap(dev), VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 4, &descpoolInfo, &m_DescriptorPool);
|
||||
vkr = vt->CreateDescriptorPool(Unwrap(dev), &descpoolInfo, &m_DescriptorPool);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_DescriptorPool);
|
||||
|
||||
uint32_t count;
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_CheckerboardDescSetLayout), &m_CheckerboardDescSet, &count);
|
||||
UnwrapPtr(m_CheckerboardDescSetLayout), &m_CheckerboardDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_CheckerboardDescSet);
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_TexDisplayDescSetLayout), &m_TexDisplayDescSet, &count);
|
||||
UnwrapPtr(m_TexDisplayDescSetLayout), &m_TexDisplayDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayDescSet);
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_TextDescSetLayout), &m_TextDescSet, &count);
|
||||
UnwrapPtr(m_TextDescSetLayout), &m_TextDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextDescSet);
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_GenericDescSetLayout), &m_GenericDescSet, &count);
|
||||
UnwrapPtr(m_GenericDescSetLayout), &m_GenericDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_GenericDescSet);
|
||||
@@ -484,7 +475,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
|
||||
VkPipelineMultisampleStateCreateInfo msaa = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, NULL,
|
||||
1, false, 0.0f, 1,
|
||||
1, false, 0.0f, NULL,
|
||||
};
|
||||
|
||||
VkPipelineDepthStencilStateCreateInfo ds = {
|
||||
@@ -504,7 +495,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
|
||||
VkPipelineColorBlendStateCreateInfo cb = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, NULL,
|
||||
false, false, VK_LOGIC_OP_NOOP,
|
||||
false, false, false, VK_LOGIC_OP_NOOP,
|
||||
1, &attState,
|
||||
{ 1.0f, 1.0f, 1.0f, 1.0f }
|
||||
};
|
||||
@@ -606,12 +597,10 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
|
||||
for(size_t i=0; i < ARRAY_COUNT(module); i++)
|
||||
{
|
||||
vkr = vt->DestroyShader(Unwrap(dev), Unwrap(shader[i]));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyShader(Unwrap(dev), Unwrap(shader[i]));
|
||||
VKMGR()->ReleaseWrappedResource(shader[i]);
|
||||
|
||||
vkr = vt->DestroyShaderModule(Unwrap(dev), Unwrap(module[i]));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyShaderModule(Unwrap(dev), Unwrap(module[i]));
|
||||
VKMGR()->ReleaseWrappedResource(module[i]);
|
||||
}
|
||||
|
||||
@@ -744,8 +733,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
buf += width;
|
||||
}
|
||||
|
||||
vkr = vt->UnmapMemory(Unwrap(dev), Unwrap(m_TextAtlasMem));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->UnmapMemory(Unwrap(dev), Unwrap(m_TextAtlasMem));
|
||||
}
|
||||
|
||||
m_TextGlyphUBO.Create(driver, dev, 4096);
|
||||
@@ -771,22 +759,22 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
RDCEraseEl(desc);
|
||||
|
||||
// checkerboard
|
||||
desc[0].bufferView = Unwrap(m_CheckerboardUBO.view);
|
||||
m_CheckerboardUBO.FillDescriptor(desc[0]);
|
||||
|
||||
// tex display
|
||||
desc[1].bufferView = Unwrap(m_TexDisplayUBO.view);
|
||||
m_TexDisplayUBO.FillDescriptor(desc[1]);
|
||||
// image descriptor is updated right before rendering
|
||||
|
||||
// text
|
||||
desc[2].bufferView = Unwrap(m_TextGeneralUBO.view);
|
||||
desc[3].bufferView = Unwrap(m_TextGlyphUBO.view);
|
||||
desc[4].bufferView = Unwrap(m_TextStringUBO.view);
|
||||
m_TextGeneralUBO.FillDescriptor(desc[2]);
|
||||
m_TextGlyphUBO.FillDescriptor(desc[3]);
|
||||
m_TextStringUBO.FillDescriptor(desc[4]);
|
||||
desc[5].imageLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
desc[5].imageView = Unwrap(m_TextAtlasView);
|
||||
desc[5].sampler = Unwrap(m_LinearSampler);
|
||||
|
||||
// generic
|
||||
desc[6].bufferView = Unwrap(m_GenericUBO.view);
|
||||
m_GenericUBO.FillDescriptor(desc[6]);
|
||||
|
||||
VkWriteDescriptorSet writeSet[] = {
|
||||
{
|
||||
@@ -819,8 +807,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
},
|
||||
};
|
||||
|
||||
vkr = vt->UpdateDescriptorSets(Unwrap(dev), ARRAY_COUNT(writeSet), writeSet, 0, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->UpdateDescriptorSets(Unwrap(dev), ARRAY_COUNT(writeSet), writeSet, 0, NULL);
|
||||
}
|
||||
|
||||
VulkanDebugManager::~VulkanDebugManager()
|
||||
@@ -832,71 +819,61 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
|
||||
if(m_DescriptorPool != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyDescriptorPool(Unwrap(dev), Unwrap(m_DescriptorPool));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyDescriptorPool(Unwrap(dev), Unwrap(m_DescriptorPool));
|
||||
VKMGR()->ReleaseWrappedResource(m_DescriptorPool);
|
||||
}
|
||||
|
||||
if(m_LinearSampler != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroySampler(Unwrap(dev), Unwrap(m_LinearSampler));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroySampler(Unwrap(dev), Unwrap(m_LinearSampler));
|
||||
VKMGR()->ReleaseWrappedResource(m_LinearSampler);
|
||||
}
|
||||
|
||||
if(m_PointSampler != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroySampler(Unwrap(dev), Unwrap(m_PointSampler));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroySampler(Unwrap(dev), Unwrap(m_PointSampler));
|
||||
VKMGR()->ReleaseWrappedResource(m_PointSampler);
|
||||
}
|
||||
|
||||
if(m_CheckerboardDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_CheckerboardDescSetLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_CheckerboardDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_CheckerboardPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_CheckerboardPipeLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_CheckerboardPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardPipeLayout);
|
||||
}
|
||||
|
||||
if(m_CheckerboardPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipeline(Unwrap(dev), Unwrap(m_CheckerboardPipeline));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_CheckerboardPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardPipeline);
|
||||
}
|
||||
|
||||
if(m_TexDisplayDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TexDisplayDescSetLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TexDisplayDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_TexDisplayPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TexDisplayPipeLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TexDisplayPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayPipeLayout);
|
||||
}
|
||||
|
||||
if(m_TexDisplayPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayPipeline));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayPipeline);
|
||||
}
|
||||
|
||||
if(m_TexDisplayBlendPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayBlendPipeline));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayBlendPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayBlendPipeline);
|
||||
}
|
||||
|
||||
@@ -905,22 +882,19 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
|
||||
if(m_TextDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TextDescSetLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TextDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_TextPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TextPipeLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TextPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextPipeLayout);
|
||||
}
|
||||
|
||||
if(m_TextPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TextPipeline));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TextPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextPipeline);
|
||||
}
|
||||
|
||||
@@ -930,43 +904,37 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
|
||||
if(m_TextAtlasView != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyImageView(Unwrap(dev), Unwrap(m_TextAtlasView));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyImageView(Unwrap(dev), Unwrap(m_TextAtlasView));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlasView);
|
||||
}
|
||||
|
||||
if(m_TextAtlas != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyImage(Unwrap(dev), Unwrap(m_TextAtlas));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyImage(Unwrap(dev), Unwrap(m_TextAtlas));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlas);
|
||||
}
|
||||
|
||||
if(m_TextAtlasMem != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->FreeMemory(Unwrap(dev), Unwrap(m_TextAtlasMem));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->FreeMemory(Unwrap(dev), Unwrap(m_TextAtlasMem));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlasMem);
|
||||
}
|
||||
|
||||
if(m_GenericDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_GenericDescSetLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_GenericDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_GenericPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_GenericPipeLayout));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_GenericPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericPipeLayout);
|
||||
}
|
||||
|
||||
if(m_GenericPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vkr = vt->DestroyPipeline(Unwrap(dev), Unwrap(m_GenericPipeline));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_GenericPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericPipeline);
|
||||
}
|
||||
|
||||
@@ -1041,7 +1009,7 @@ void VulkanDebugManager::RenderTextInternal(const TextPrintState &textstate, flo
|
||||
vt->CmdBindDescriptorSets(Unwrap(textstate.cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(m_TextPipeLayout), 0, 1, UnwrapPtr(m_TextDescSet), 0, NULL);
|
||||
|
||||
VkViewport viewport = { 0.0f, 0.0f, (float)textstate.w, (float)textstate.h, 0.0f, 1.0f };
|
||||
vt->CmdSetViewport(Unwrap(cmd), 1, &viewport);
|
||||
vt->CmdSetViewport(Unwrap(textstate.cmd), 1, &viewport);
|
||||
|
||||
// VKTODOMED strip + instance ID doesn't seem to work atm? instance ID comes through 0
|
||||
// for now, do lists, but want to change back
|
||||
|
||||
@@ -49,16 +49,18 @@ class VulkanDebugManager
|
||||
|
||||
struct GPUBuffer
|
||||
{
|
||||
GPUBuffer() : buf(VK_NULL_HANDLE), mem(VK_NULL_HANDLE), view(VK_NULL_HANDLE) {}
|
||||
GPUBuffer() : buf(VK_NULL_HANDLE), mem(VK_NULL_HANDLE) {}
|
||||
void Create(WrappedVulkan *driver, VkDevice dev, VkDeviceSize size);
|
||||
void Destroy(const VkLayerDispatchTable *vt, VkDevice dev);
|
||||
|
||||
void FillDescriptor(VkDescriptorInfo &desc);
|
||||
|
||||
void *Map(const VkLayerDispatchTable *vt, VkDevice dev, VkDeviceSize offset = 0, VkDeviceSize size = 0);
|
||||
void Unmap(const VkLayerDispatchTable *vt, VkDevice dev);
|
||||
|
||||
VkDeviceSize sz;
|
||||
VkBuffer buf;
|
||||
VkDeviceMemory mem;
|
||||
VkBufferView view;
|
||||
};
|
||||
|
||||
// VKTODOLOW make this all private/wrapped up
|
||||
|
||||
@@ -75,13 +75,15 @@ void InitDeviceReplayTables(VkDevice device)
|
||||
RDCASSERT(table);
|
||||
|
||||
#define DeviceGPA(func) table->func = (CONCAT(PFN_vk, func))table->GetDeviceProcAddr(device, STRINGIZE(CONCAT(vk, func)));
|
||||
|
||||
DeviceGPA(CreateSwapChainWSI)
|
||||
DeviceGPA(DestroySwapChainWSI)
|
||||
DeviceGPA(GetSurfaceInfoWSI)
|
||||
DeviceGPA(GetSwapChainInfoWSI)
|
||||
DeviceGPA(AcquireNextImageWSI)
|
||||
DeviceGPA(QueuePresentWSI)
|
||||
|
||||
DeviceGPA(GetSurfacePropertiesKHR)
|
||||
DeviceGPA(GetSurfaceFormatsKHR)
|
||||
DeviceGPA(GetSurfacePresentModesKHR)
|
||||
DeviceGPA(CreateSwapchainKHR)
|
||||
DeviceGPA(DestroySwapchainKHR)
|
||||
DeviceGPA(GetSwapchainImagesKHR)
|
||||
DeviceGPA(AcquireNextImageKHR)
|
||||
DeviceGPA(QueuePresentKHR)
|
||||
|
||||
#undef DeviceGPA
|
||||
}
|
||||
|
||||
@@ -29,16 +29,14 @@
|
||||
HookInit(DestroyInstance); \
|
||||
HookInit(EnumeratePhysicalDevices); \
|
||||
HookInit(GetPhysicalDeviceFeatures); \
|
||||
HookInit(GetPhysicalDeviceFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceImageFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceLimits); \
|
||||
HookInit(GetPhysicalDeviceFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceProperties); \
|
||||
HookInit(GetPhysicalDeviceQueueCount); \
|
||||
HookInit(GetPhysicalDeviceQueueProperties); \
|
||||
HookInit(GetPhysicalDeviceQueueFamilyProperties); \
|
||||
HookInit(GetPhysicalDeviceMemoryProperties); \
|
||||
HookInit(DbgCreateMsgCallback); \
|
||||
HookInit(DbgDestroyMsgCallback); \
|
||||
HookInit(GetPhysicalDeviceSurfaceSupportWSI)
|
||||
HookInit(GetPhysicalDeviceSurfaceSupportKHR)
|
||||
|
||||
#define HookInitVulkanDevice() \
|
||||
HookInit(CreateDevice); \
|
||||
@@ -142,90 +140,88 @@
|
||||
HookInit(DestroyRenderPass); \
|
||||
HookInit(CmdBeginRenderPass); \
|
||||
HookInit(CmdEndRenderPass); \
|
||||
HookInit(DbgCreateMsgCallback); \
|
||||
HookInit(DbgDestroyMsgCallback); \
|
||||
HookInit(CreateSwapChainWSI); \
|
||||
HookInit(DestroySwapChainWSI); \
|
||||
HookInit(GetSurfaceInfoWSI); \
|
||||
HookInit(GetSwapChainInfoWSI); \
|
||||
HookInit(AcquireNextImageWSI); \
|
||||
HookInit(QueuePresentWSI)
|
||||
HookInit(GetSurfacePropertiesKHR); \
|
||||
HookInit(GetSurfaceFormatsKHR); \
|
||||
HookInit(GetSurfacePresentModesKHR); \
|
||||
HookInit(CreateSwapchainKHR); \
|
||||
HookInit(DestroySwapchainKHR); \
|
||||
HookInit(GetSwapchainImagesKHR); \
|
||||
HookInit(AcquireNextImageKHR); \
|
||||
HookInit(QueuePresentKHR);
|
||||
|
||||
#define DefineHooks() \
|
||||
HookDefine2(VkResult, vkCreateInstance, const VkInstanceCreateInfo*, pCreateInfo, VkInstance*, pInstance); \
|
||||
HookDefine1(VkResult, vkDestroyInstance, VkInstance, instance); \
|
||||
HookDefine1(void, vkDestroyInstance, VkInstance, instance); \
|
||||
HookDefine3(VkResult, vkEnumeratePhysicalDevices, VkInstance, instance, uint32_t*, pPhysicalDeviceCount, VkPhysicalDevice*, pPhysicalDevices); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceFeatures, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceFeatures*, pFeatures); \
|
||||
HookDefine3(VkResult, vkGetPhysicalDeviceFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkFormatProperties*, pFormatProperties); \
|
||||
HookDefine6(VkResult, vkGetPhysicalDeviceImageFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkImageType, type, VkImageTiling, tiling, VkImageUsageFlags, usage, VkImageFormatProperties*, pImageFormatProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceLimits, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceLimits*, pLimits); \
|
||||
HookDefine7(VkResult, vkGetPhysicalDeviceImageFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkImageType, type, VkImageTiling, tiling, VkImageUsageFlags, usage, VkImageCreateFlags, flags, VkImageFormatProperties*, pImageFormatProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceProperties, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceProperties*, pProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceQueueCount, VkPhysicalDevice, physicalDevice, uint32_t*, pCount); \
|
||||
HookDefine3(VkResult, vkGetPhysicalDeviceQueueProperties, VkPhysicalDevice, physicalDevice, uint32_t, count, VkPhysicalDeviceQueueProperties*, pQueueProperties); \
|
||||
HookDefine3(VkResult, vkGetPhysicalDeviceQueueFamilyProperties, VkPhysicalDevice, physicalDevice, uint32_t*, pCount, VkQueueFamilyProperties*, pQueueFamilyProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceMemoryProperties, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceMemoryProperties*, pMemoryProperties); \
|
||||
HookDefine3(VkResult, vkCreateDevice, VkPhysicalDevice, physicalDevice, const VkDeviceCreateInfo*, pCreateInfo, VkDevice*, pDevice); \
|
||||
HookDefine1(VkResult, vkDestroyDevice, VkDevice, device); \
|
||||
HookDefine1(void, vkDestroyDevice, VkDevice, device); \
|
||||
HookDefine4(VkResult, vkGetDeviceQueue, VkDevice, device, uint32_t, queueFamilyIndex, uint32_t, queueIndex, VkQueue*, pQueue); \
|
||||
HookDefine4(VkResult, vkQueueSubmit, VkQueue, queue, uint32_t, cmdBufferCount, const VkCmdBuffer*, pCmdBuffers, VkFence, fence); \
|
||||
HookDefine1(VkResult, vkQueueWaitIdle, VkQueue, queue); \
|
||||
HookDefine1(VkResult, vkDeviceWaitIdle, VkDevice, device); \
|
||||
HookDefine3(VkResult, vkAllocMemory, VkDevice, device, const VkMemoryAllocInfo*, pAllocInfo, VkDeviceMemory*, pMem); \
|
||||
HookDefine2(VkResult, vkFreeMemory, VkDevice, device, VkDeviceMemory, mem); \
|
||||
HookDefine2(void, vkFreeMemory, VkDevice, device, VkDeviceMemory, mem); \
|
||||
HookDefine6(VkResult, vkMapMemory, VkDevice, device, VkDeviceMemory, mem, VkDeviceSize, offset, VkDeviceSize, size, VkMemoryMapFlags, flags, void**, ppData); \
|
||||
HookDefine2(VkResult, vkUnmapMemory, VkDevice, device, VkDeviceMemory, mem); \
|
||||
HookDefine2(void, vkUnmapMemory, VkDevice, device, VkDeviceMemory, mem); \
|
||||
HookDefine3(VkResult, vkFlushMappedMemoryRanges, VkDevice, device, uint32_t, memRangeCount, const VkMappedMemoryRange*, pMemRanges); \
|
||||
HookDefine4(VkResult, vkBindBufferMemory, VkDevice, device, VkBuffer, buffer, VkDeviceMemory, mem, VkDeviceSize, memOffset); \
|
||||
HookDefine4(VkResult, vkBindImageMemory, VkDevice, device, VkImage, image, VkDeviceMemory, mem, VkDeviceSize, memOffset); \
|
||||
HookDefine3(VkResult, vkCreateBuffer, VkDevice, device, const VkBufferCreateInfo*, pCreateInfo, VkBuffer*, pBuffer); \
|
||||
HookDefine2(VkResult, vkDestroyBuffer, VkDevice, device, VkBuffer, buffer); \
|
||||
HookDefine2(void, vkDestroyBuffer, VkDevice, device, VkBuffer, buffer); \
|
||||
HookDefine3(VkResult, vkCreateBufferView, VkDevice, device, const VkBufferViewCreateInfo*, pCreateInfo, VkBufferView*, pView); \
|
||||
HookDefine2(VkResult, vkDestroyBufferView, VkDevice, device, VkBufferView, bufferView); \
|
||||
HookDefine2(void, vkDestroyBufferView, VkDevice, device, VkBufferView, bufferView); \
|
||||
HookDefine3(VkResult, vkCreateImage, VkDevice, device, const VkImageCreateInfo*, pCreateInfo, VkImage*, pImage); \
|
||||
HookDefine2(VkResult, vkDestroyImage, VkDevice, device, VkImage, image); \
|
||||
HookDefine2(void, vkDestroyImage, VkDevice, device, VkImage, image); \
|
||||
HookDefine4(VkResult, vkGetImageSubresourceLayout, VkDevice, device, VkImage, image, const VkImageSubresource*, pSubresource, VkSubresourceLayout*, pLayout); \
|
||||
HookDefine3(VkResult, vkGetBufferMemoryRequirements, VkDevice, device, VkBuffer, buffer, VkMemoryRequirements*, VkMemoryRequirements); \
|
||||
HookDefine3(VkResult, vkGetImageMemoryRequirements, VkDevice, device, VkImage, image, VkMemoryRequirements*, VkMemoryRequirements); \
|
||||
HookDefine3(VkResult, vkCreateImageView, VkDevice, device, const VkImageViewCreateInfo*, pCreateInfo, VkImageView*, pView); \
|
||||
HookDefine2(VkResult, vkDestroyImageView, VkDevice, device, VkImageView, imageView); \
|
||||
HookDefine2(void, vkDestroyImageView, VkDevice, device, VkImageView, imageView); \
|
||||
HookDefine3(VkResult, vkCreateShader, VkDevice, device, const VkShaderCreateInfo*, pCreateInfo, VkShader*, pShader); \
|
||||
HookDefine2(VkResult, vkDestroyShader, VkDevice, device, VkShader, shader); \
|
||||
HookDefine2(void, vkDestroyShader, VkDevice, device, VkShader, shader); \
|
||||
HookDefine3(VkResult, vkCreateShaderModule, VkDevice, device, const VkShaderModuleCreateInfo*, pCreateInfo, VkShaderModule*, pShaderModule); \
|
||||
HookDefine2(VkResult, vkDestroyShaderModule, VkDevice, device, VkShaderModule, shaderModule); \
|
||||
HookDefine2(void, vkDestroyShaderModule, VkDevice, device, VkShaderModule, shaderModule); \
|
||||
HookDefine5(VkResult, vkCreateGraphicsPipelines, VkDevice, device, VkPipelineCache, pipelineCache, uint32_t, count, const VkGraphicsPipelineCreateInfo*, pCreateInfos, VkPipeline*, pPipelines); \
|
||||
HookDefine2(VkResult, vkDestroyPipeline, VkDevice, device, VkPipeline, pipeline); \
|
||||
HookDefine2(void, vkDestroyPipeline, VkDevice, device, VkPipeline, pipeline); \
|
||||
HookDefine3(VkResult, vkCreatePipelineCache, VkDevice, device, const VkPipelineCacheCreateInfo*, pCreateInfo, VkPipelineCache*, pPipelineCache); \
|
||||
HookDefine2(VkResult, vkDestroyPipelineCache, VkDevice, device, VkPipelineCache, pipelineCache); \
|
||||
HookDefine2(void, vkDestroyPipelineCache, VkDevice, device, VkPipelineCache, pipelineCache); \
|
||||
HookDefine3(VkResult, vkCreatePipelineLayout, VkDevice, device, const VkPipelineLayoutCreateInfo*, pCreateInfo, VkPipelineLayout*, pPipelineLayout); \
|
||||
HookDefine2(VkResult, vkDestroyPipelineLayout, VkDevice, device, VkPipelineLayout, pipelineLayout); \
|
||||
HookDefine2(void, vkDestroyPipelineLayout, VkDevice, device, VkPipelineLayout, pipelineLayout); \
|
||||
HookDefine3(VkResult, vkCreateSemaphore, VkDevice, device, const VkSemaphoreCreateInfo*, pCreateInfo, VkSemaphore*, pSemaphore); \
|
||||
HookDefine2(VkResult, vkDestroySemaphore, VkDevice, device, VkSemaphore, semaphore); \
|
||||
HookDefine2(void, vkDestroySemaphore, VkDevice, device, VkSemaphore, semaphore); \
|
||||
HookDefine2(VkResult, vkQueueSignalSemaphore, VkQueue, queue, VkSemaphore, semaphore); \
|
||||
HookDefine2(VkResult, vkQueueWaitSemaphore, VkQueue, queue, VkSemaphore, semaphore); \
|
||||
HookDefine3(VkResult, vkCreateFence, VkDevice, device, const VkFenceCreateInfo*, pCreateInfo, VkFence*, pFence); \
|
||||
HookDefine2(VkResult, vkDestroyFence, VkDevice, device, VkFence, fence); \
|
||||
HookDefine2(void, vkDestroyFence, VkDevice, device, VkFence, fence); \
|
||||
HookDefine3(VkResult, vkCreateQueryPool, VkDevice, device, const VkQueryPoolCreateInfo*, pCreateInfo, VkQueryPool*, pQueryPool); \
|
||||
HookDefine2(VkResult, vkDestroyQueryPool, VkDevice, device, VkQueryPool, queryPool); \
|
||||
HookDefine2(void, vkDestroyQueryPool, VkDevice, device, VkQueryPool, queryPool); \
|
||||
HookDefine7(VkResult, vkGetQueryPoolResults, VkDevice, device, VkQueryPool, queryPool, uint32_t, startQuery, uint32_t, queryCount, size_t*, pDataSize, void*, pData, VkQueryResultFlags, flags); \
|
||||
HookDefine2(VkResult, vkGetFenceStatus, VkDevice, device, VkFence, fence); \
|
||||
HookDefine3(VkResult, vkCreateSampler, VkDevice, device, const VkSamplerCreateInfo*, pCreateInfo, VkSampler*, pSampler); \
|
||||
HookDefine2(VkResult, vkDestroySampler, VkDevice, device, VkSampler, sampler); \
|
||||
HookDefine2(void, vkDestroySampler, VkDevice, device, VkSampler, sampler); \
|
||||
HookDefine3(VkResult, vkCreateDescriptorSetLayout, VkDevice, device, const VkDescriptorSetLayoutCreateInfo*, pCreateInfo, VkDescriptorSetLayout*, pSetLayout); \
|
||||
HookDefine2(VkResult, vkDestroyDescriptorSetLayout, VkDevice, device, VkDescriptorSetLayout, descriptorSetLayout); \
|
||||
HookDefine5(VkResult, vkCreateDescriptorPool, VkDevice, device, VkDescriptorPoolUsage, poolUsage, uint32_t, maxSets, const VkDescriptorPoolCreateInfo*, pCreateInfo, VkDescriptorPool*, pDescriptorPool); \
|
||||
HookDefine2(VkResult, vkDestroyDescriptorPool, VkDevice, device, VkDescriptorPool, descriptorPool); \
|
||||
HookDefine7(VkResult, vkAllocDescriptorSets, VkDevice, device, VkDescriptorPool, descriptorPool, VkDescriptorSetUsage, setUsage, uint32_t, count, const VkDescriptorSetLayout*, pSetLayouts, VkDescriptorSet*, pDescriptorSets, uint32_t*, pCount); \
|
||||
HookDefine5(VkResult, vkUpdateDescriptorSets, VkDevice, device, uint32_t, writeCount, const VkWriteDescriptorSet*, pDescriptorWrites, uint32_t, copyCount, const VkCopyDescriptorSet*, pDescriptorCopies); \
|
||||
HookDefine2(void, vkDestroyDescriptorSetLayout, VkDevice, device, VkDescriptorSetLayout, descriptorSetLayout); \
|
||||
HookDefine3(VkResult, vkCreateDescriptorPool, VkDevice, device, const VkDescriptorPoolCreateInfo*, pCreateInfo, VkDescriptorPool*, pDescriptorPool); \
|
||||
HookDefine2(void, vkDestroyDescriptorPool, VkDevice, device, VkDescriptorPool, descriptorPool); \
|
||||
HookDefine6(void, vkAllocDescriptorSets, VkDevice, device, VkDescriptorPool, descriptorPool, VkDescriptorSetUsage, setUsage, uint32_t, count, const VkDescriptorSetLayout*, pSetLayouts, VkDescriptorSet*, pDescriptorSets); \
|
||||
HookDefine5(void, vkUpdateDescriptorSets, VkDevice, device, uint32_t, writeCount, const VkWriteDescriptorSet*, pDescriptorWrites, uint32_t, copyCount, const VkCopyDescriptorSet*, pDescriptorCopies); \
|
||||
HookDefine4(VkResult, vkFreeDescriptorSets, VkDevice, device, VkDescriptorPool, descriptorPool, uint32_t, count, const VkDescriptorSet*, pDescriptorSets); \
|
||||
HookDefine3(VkResult, vkCreateCommandPool, VkDevice, device, const VkCmdPoolCreateInfo*, pCreateInfo, VkCmdPool*, pCmdPool); \
|
||||
HookDefine2(VkResult, vkDestroyCommandPool, VkDevice, device, VkCmdPool, cmdPool); \
|
||||
HookDefine2(void, vkDestroyCommandPool, VkDevice, device, VkCmdPool, cmdPool); \
|
||||
HookDefine3(VkResult, vkResetCommandPool, VkDevice, device, VkCmdPool, cmdPool, VkCmdPoolResetFlags, flags); \
|
||||
HookDefine3(VkResult, vkCreateCommandBuffer, VkDevice, device, const VkCmdBufferCreateInfo*, pCreateInfo, VkCmdBuffer*, pCmdBuffer); \
|
||||
HookDefine2(VkResult, vkDestroyCommandBuffer, VkDevice, device, VkCmdBuffer, cmdBuffer); \
|
||||
HookDefine2(void, vkDestroyCommandBuffer, VkDevice, device, VkCmdBuffer, cmdBuffer); \
|
||||
HookDefine2(VkResult, vkBeginCommandBuffer, VkCmdBuffer, cmdBuffer, const VkCmdBufferBeginInfo*, pBeginInfo); \
|
||||
HookDefine1(VkResult, vkEndCommandBuffer, VkCmdBuffer, cmdBuffer); \
|
||||
HookDefine2(VkResult, vkResetCommandBuffer, VkCmdBuffer, cmdBuffer, VkCmdBufferResetFlags, flags); \
|
||||
HookDefine3(void, vkCmdBindPipeline, VkCmdBuffer, cmdBuffer, VkPipelineBindPoint, pipelineBindPoint, VkPipeline, pipeline); \
|
||||
HookDefine3(void, vkCmdSetViewport, VkCmdBuffer, cmdBuffer, uint32_t, viewportCount, const VkViewport* pViewports); \
|
||||
HookDefine3(void, vkCmdSetViewport, VkCmdBuffer, cmdBuffer, uint32_t, viewportCount, const VkViewport*, pViewports); \
|
||||
HookDefine3(void, vkCmdSetScissor, VkCmdBuffer, cmdBuffer, uint32_t, scissorCount, const VkRect2D*, pScissors); \
|
||||
HookDefine2(void, vkCmdSetLineWidth, VkCmdBuffer, cmdBuffer, float, lineWidth); \
|
||||
HookDefine4(void, vkCmdSetDepthBias, VkCmdBuffer, cmdBuffer, float, depthBias, float, depthBiasClamp, float, slopeScaledDepthBias); \
|
||||
@@ -251,25 +247,27 @@
|
||||
HookDefine7(void, vkCmdResolveImage, VkCmdBuffer, cmdBuffer, VkImage, srcImage, VkImageLayout, srcImageLayout, VkImage, destImage, VkImageLayout, destImageLayout, uint32_t, regionCount, const VkImageResolve*, pRegions); \
|
||||
HookDefine5(void, vkCmdUpdateBuffer, VkCmdBuffer, cmdBuffer, VkBuffer, destBuffer, VkDeviceSize, destOffset, VkDeviceSize, dataSize, const uint32_t*, pData); \
|
||||
HookDefine6(void, vkCmdClearColorImage, VkCmdBuffer, cmdBuffer, VkImage, image, VkImageLayout, imageLayout, const VkClearColorValue*, pColor, uint32_t, rangeCount, const VkImageSubresourceRange*, pRanges); \
|
||||
HookDefine7(void, vkCmdClearDepthStencilImage, VkCmdBuffer, cmdBuffer, VkImage, image, VkImageLayout, imageLayout, float, depth, uint32_t, stencil, uint32_t, rangeCount, const VkImageSubresourceRange*, pRanges); \
|
||||
HookDefine6(void, vkCmdClearDepthStencilImage, VkCmdBuffer, cmdBuffer, VkImage, image, VkImageLayout, imageLayout, const VkClearDepthStencilValue*, pDepthStencil, uint32_t, rangeCount, const VkImageSubresourceRange*, pRanges); \
|
||||
HookDefine6(void, vkCmdClearColorAttachment, VkCmdBuffer, cmdBuffer, uint32_t, colorAttachment, VkImageLayout, imageLayout, const VkClearColorValue*, pColor, uint32_t, rectCount, const VkRect3D*, pRects); \
|
||||
HookDefine7(void, vkCmdClearDepthStencilAttachment, VkCmdBuffer, cmdBuffer, VkImageAspectFlags, imageAspectMask, VkImageLayout, imageLayout, float, depth, uint32_t, stencil, uint32_t, rectCount, const VkRect3D*, pRects); \
|
||||
HookDefine6(void, vkCmdClearDepthStencilAttachment, VkCmdBuffer, cmdBuffer, VkImageAspectFlags, imageAspectMask, VkImageLayout, imageLayout, const VkClearDepthStencilValue*, pDepthStencil, uint32_t, rectCount, const VkRect3D*, pRects); \
|
||||
HookDefine6(void, vkCmdPipelineBarrier, VkCmdBuffer, cmdBuffer, VkPipelineStageFlags, srcStageMask, VkPipelineStageFlags, destStageMask, VkBool32, byRegion, uint32_t, memBarrierCount, const void* const*, ppMemBarriers); \
|
||||
HookDefine4(void, vkCmdBeginQuery, VkCmdBuffer, cmdBuffer, VkQueryPool, queryPool, uint32_t, slot, VkQueryControlFlags, flags); \
|
||||
HookDefine3(void, vkCmdEndQuery, VkCmdBuffer, cmdBuffer, VkQueryPool, queryPool, uint32_t, slot); \
|
||||
HookDefine4(void, vkCmdResetQueryPool, VkCmdBuffer, cmdBuffer, VkQueryPool, queryPool, uint32_t, startQuery, uint32_t, queryCount); \
|
||||
HookDefine3(VkResult, vkCreateFramebuffer, VkDevice, device, const VkFramebufferCreateInfo*, pCreateInfo, VkFramebuffer*, pFramebuffer); \
|
||||
HookDefine2(VkResult, vkDestroyFramebuffer, VkDevice, device, VkFramebuffer, framebuffer); \
|
||||
HookDefine2(void, vkDestroyFramebuffer, VkDevice, device, VkFramebuffer, framebuffer); \
|
||||
HookDefine3(VkResult, vkCreateRenderPass, VkDevice, device, const VkRenderPassCreateInfo*, pCreateInfo, VkRenderPass*, pRenderPass); \
|
||||
HookDefine2(VkResult, vkDestroyRenderPass, VkDevice, device, VkRenderPass, renderPass); \
|
||||
HookDefine2(void, vkDestroyRenderPass, VkDevice, device, VkRenderPass, renderPass); \
|
||||
HookDefine3(void, vkCmdBeginRenderPass, VkCmdBuffer, cmdBuffer, const VkRenderPassBeginInfo*, pRenderPassBegin, VkRenderPassContents, contents); \
|
||||
HookDefine1(void, vkCmdEndRenderPass, VkCmdBuffer, cmdBuffer); \
|
||||
HookDefine5(VkResult, vkDbgCreateMsgCallback, VkInstance, instance, VkFlags, msgFlags, const PFN_vkDbgMsgCallback, pfnMsgCallback, void*, pUserData, VkDbgMsgCallback*, pMsgCallback); \
|
||||
HookDefine2(VkResult, vkDbgDestroyMsgCallback, VkInstance, instance, VkDbgMsgCallback, msgCallback); \
|
||||
HookDefine4(VkResult, vkGetPhysicalDeviceSurfaceSupportWSI, VkPhysicalDevice, physicalDevice, uint32_t, queueFamilyIndex, const VkSurfaceDescriptionWSI*, pSurfaceDescription, VkBool32*, pSupported); \
|
||||
HookDefine3(VkResult, vkCreateSwapChainWSI, VkDevice, device, const VkSwapChainCreateInfoWSI*, pCreateInfo, VkSwapChainWSI*, pSwapChain); \
|
||||
HookDefine2(VkResult, vkDestroySwapChainWSI, VkDevice, device, VkSwapChainWSI, swapChain); \
|
||||
HookDefine5(VkResult, vkGetSurfaceInfoWSI, VkDevice, device, const VkSurfaceDescriptionWSI*, pSurfaceDescription, VkSurfaceInfoTypeWSI, infoType, size_t*, pDataSize, void*, pData); \
|
||||
HookDefine5(VkResult, vkGetSwapChainInfoWSI, VkDevice, device, VkSwapChainWSI, swapChain, VkSwapChainInfoTypeWSI, infoType, size_t*, pDataSize, void*, pData); \
|
||||
HookDefine5(VkResult, vkAcquireNextImageWSI, VkDevice, device, VkSwapChainWSI, swapChain, uint64_t, timeout, VkSemaphore, semaphore, uint32_t*, pImageIndex); \
|
||||
HookDefine2(VkResult, vkQueuePresentWSI, VkQueue, queue, VkPresentInfoWSI*, pPresentInfo)
|
||||
HookDefine4(VkResult, vkGetPhysicalDeviceSurfaceSupportKHR, VkPhysicalDevice, physicalDevice, uint32_t, queueFamilyIndex, const VkSurfaceDescriptionKHR*, pSurfaceDescription, VkBool32*, pSupported); \
|
||||
HookDefine3(VkResult, vkGetSurfacePropertiesKHR, VkDevice, device, const VkSurfaceDescriptionKHR*, pSurfaceDescription, VkSurfacePropertiesKHR*, pSurfaceProperties); \
|
||||
HookDefine4(VkResult, vkGetSurfaceFormatsKHR, VkDevice, device, const VkSurfaceDescriptionKHR*, pSurfaceDescription, uint32_t*, pCount, VkSurfaceFormatKHR*, pSurfaceFormats); \
|
||||
HookDefine4(VkResult, vkGetSurfacePresentModesKHR, VkDevice, device, const VkSurfaceDescriptionKHR*, pSurfaceDescription, uint32_t*, pCount, VkPresentModeKHR*, pPresentModes); \
|
||||
HookDefine3(VkResult, vkCreateSwapchainKHR, VkDevice, device, const VkSwapchainCreateInfoKHR*, pCreateInfo, VkSwapchainKHR*, pSwapchain); \
|
||||
HookDefine2(VkResult, vkDestroySwapchainKHR, VkDevice, device, VkSwapchainKHR, swapchain); \
|
||||
HookDefine4(VkResult, vkGetSwapchainImagesKHR, VkDevice, device, VkSwapchainKHR, swapchain, uint32_t*, pCount, VkImage*, pSwapchainImages); \
|
||||
HookDefine5(VkResult, vkAcquireNextImageKHR, VkDevice, device, VkSwapchainKHR, swapchain, uint64_t, timeout, VkSemaphore, semaphore, uint32_t*, pImageIndex); \
|
||||
HookDefine2(VkResult, vkQueuePresentKHR, VkQueue, queue, VkPresentInfoKHR*, pPresentInfo);
|
||||
|
||||
@@ -76,13 +76,13 @@ void VulkanCreationInfo::Pipeline::Init(const VkGraphicsPipelineCreateInfo* pCre
|
||||
rasterSamples = pCreateInfo->pMultisampleState->rasterSamples;
|
||||
sampleShadingEnable = pCreateInfo->pMultisampleState->sampleShadingEnable ? true : false;
|
||||
minSampleShading = pCreateInfo->pMultisampleState->minSampleShading;
|
||||
sampleMask = pCreateInfo->pMultisampleState->sampleMask;
|
||||
sampleMask = pCreateInfo->pMultisampleState->pSampleMask ? *pCreateInfo->pMultisampleState->pSampleMask : ~0U;
|
||||
|
||||
// VkPipelineDepthStencilStateCreateInfo
|
||||
depthTestEnable = pCreateInfo->pDepthStencilState->depthTestEnable ? true : false;
|
||||
depthWriteEnable = pCreateInfo->pDepthStencilState->depthWriteEnable ? true : false;
|
||||
depthCompareOp = pCreateInfo->pDepthStencilState->depthCompareOp;
|
||||
depthBoundsEnable = pCreateInfo->pDepthStencilState->depthBoundsEnable ? true : false;
|
||||
depthBoundsEnable = pCreateInfo->pDepthStencilState->depthBoundsTestEnable ? true : false;
|
||||
stencilTestEnable = pCreateInfo->pDepthStencilState->stencilTestEnable ? true : false;
|
||||
front = pCreateInfo->pDepthStencilState->front;
|
||||
back = pCreateInfo->pDepthStencilState->back;
|
||||
@@ -118,11 +118,11 @@ void VulkanCreationInfo::RenderPass::Init(const VkRenderPassCreateInfo* pCreateI
|
||||
|
||||
inputAttachments.resize(subp.inputCount);
|
||||
for(uint32_t i=0; i < subp.inputCount; i++)
|
||||
inputAttachments[i] = subp.inputAttachments[i].attachment;
|
||||
inputAttachments[i] = subp.pInputAttachments[i].attachment;
|
||||
|
||||
colorAttachments.resize(subp.colorCount);
|
||||
for(uint32_t i=0; i < subp.colorCount; i++)
|
||||
colorAttachments[i] = subp.colorAttachments[i].attachment;
|
||||
colorAttachments[i] = subp.pColorAttachments[i].attachment;
|
||||
|
||||
depthstencilAttachment = (subp.depthStencilAttachment.attachment != VK_ATTACHMENT_UNUSED
|
||||
? (int32_t)subp.depthStencilAttachment.attachment : -1);
|
||||
|
||||
@@ -91,7 +91,7 @@ bool WrappedVulkan::Prepare_InitialState(WrappedVkRes *res)
|
||||
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
meminfo.size, VK_BUFFER_USAGE_GENERAL, 0,
|
||||
meminfo.size, VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
@@ -336,7 +336,7 @@ bool WrappedVulkan::Serialise_InitialState(WrappedVkRes *res)
|
||||
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
dataSize, VK_BUFFER_USAGE_GENERAL, 0,
|
||||
dataSize, VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
@@ -399,7 +399,7 @@ void WrappedVulkan::Create_InitialState(ResourceId id, WrappedVkRes *live, bool
|
||||
|
||||
ImgState &img = m_ImageInfo[liveid];
|
||||
|
||||
if(img.subresourceStates[0].range.aspect == VK_IMAGE_ASPECT_COLOR)
|
||||
if(img.subresourceStates[0].range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
|
||||
GetResourceManager()->SetInitialContents(id, VulkanResourceManager::InitialContentData(NULL, eInitialContents_ClearColorImage, NULL));
|
||||
else
|
||||
GetResourceManager()->SetInitialContents(id, VulkanResourceManager::InitialContentData(NULL, eInitialContents_ClearDepthStencilImage, NULL));
|
||||
@@ -436,8 +436,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, VulkanResourceManager
|
||||
if(initial.num == 0)
|
||||
return;
|
||||
|
||||
VkResult vkr = ObjDisp(GetDev())->UpdateDescriptorSets(Unwrap(GetDev()), initial.num, writes, 0, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
ObjDisp(GetDev())->UpdateDescriptorSets(Unwrap(GetDev()), initial.num, writes, 0, NULL);
|
||||
|
||||
// need to blat over the current descriptor set contents, so these are available
|
||||
// when we want to fetch pipeline state
|
||||
@@ -482,7 +481,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, VulkanResourceManager
|
||||
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
meminfo.size, VK_BUFFER_USAGE_GENERAL, 0,
|
||||
meminfo.size, VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
|
||||
uint32_t nummips = t.subresourceRange.mipLevels;
|
||||
uint32_t numslices = t.subresourceRange.arraySize;
|
||||
if(nummips == VK_LAST_MIP_LEVEL) nummips = states[id].mipLevels;
|
||||
if(numslices == VK_LAST_ARRAY_SLICE) numslices = states[id].arraySize;
|
||||
if(nummips == VK_REMAINING_MIP_LEVELS) nummips = states[id].mipLevels - t.subresourceRange.baseMipLevel;
|
||||
if(numslices == VK_REMAINING_ARRAY_LAYERS) numslices = states[id].arraySize - t.subresourceRange.baseArrayLayer;
|
||||
|
||||
bool done = false;
|
||||
|
||||
@@ -81,7 +81,7 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
if(it->first < id) continue;
|
||||
if(it->first != id) break;
|
||||
|
||||
if(it->second.range.aspect == t.subresourceRange.aspect)
|
||||
if(it->second.range.aspectMask == t.subresourceRange.aspectMask)
|
||||
{
|
||||
// we've found a range that completely matches our region, doesn't matter if that's
|
||||
// a whole image and the transition is the whole image, or it's one subresource.
|
||||
@@ -89,7 +89,7 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
// really have to worry about the else{} branch
|
||||
if(it->second.range.baseMipLevel == t.subresourceRange.baseMipLevel &&
|
||||
it->second.range.mipLevels == nummips &&
|
||||
it->second.range.baseArraySlice == t.subresourceRange.baseArraySlice &&
|
||||
it->second.range.baseArrayLayer == t.subresourceRange.baseArrayLayer &&
|
||||
it->second.range.arraySize == numslices)
|
||||
{
|
||||
// verify
|
||||
@@ -119,8 +119,8 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
it->second.range.arraySize == 1 &&
|
||||
it->second.range.baseMipLevel >= t.subresourceRange.baseMipLevel &&
|
||||
it->second.range.baseMipLevel < t.subresourceRange.baseMipLevel+nummips &&
|
||||
it->second.range.baseArraySlice >= t.subresourceRange.baseArraySlice &&
|
||||
it->second.range.baseArraySlice < t.subresourceRange.baseArraySlice+numslices)
|
||||
it->second.range.baseArrayLayer >= t.subresourceRange.baseArrayLayer &&
|
||||
it->second.range.baseArrayLayer < t.subresourceRange.baseArrayLayer+numslices)
|
||||
{
|
||||
// apply it (prevstate is from the start of all transitions, so only set once)
|
||||
if(it->second.prevstate == UNTRANSITIONED_IMG_STATE)
|
||||
@@ -158,7 +158,7 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
it->second.range.arraySize = 1;
|
||||
|
||||
// slice-major
|
||||
it->second.range.baseArraySlice = uint32_t(i / existing.second.range.mipLevels);
|
||||
it->second.range.baseArrayLayer = uint32_t(i / existing.second.range.mipLevels);
|
||||
it->second.range.baseMipLevel = uint32_t(i % existing.second.range.mipLevels);
|
||||
it++;
|
||||
}
|
||||
@@ -170,8 +170,8 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
// so we need to check to see if the first subresource lies in the range here
|
||||
if(it->second.range.baseMipLevel >= t.subresourceRange.baseMipLevel &&
|
||||
it->second.range.baseMipLevel < t.subresourceRange.baseMipLevel+nummips &&
|
||||
it->second.range.baseArraySlice >= t.subresourceRange.baseArraySlice &&
|
||||
it->second.range.baseArraySlice < t.subresourceRange.baseArraySlice+numslices)
|
||||
it->second.range.baseArrayLayer >= t.subresourceRange.baseArrayLayer &&
|
||||
it->second.range.baseArrayLayer < t.subresourceRange.baseArrayLayer+numslices)
|
||||
{
|
||||
// apply it (prevstate is from the start of all transitions, so only set once)
|
||||
if(it->second.prevstate == UNTRANSITIONED_IMG_STATE)
|
||||
@@ -189,7 +189,7 @@ void VulkanResourceManager::RecordTransitions(vector< pair<ResourceId, ImageRegi
|
||||
}
|
||||
|
||||
// if we've gone past where the new subresource range would sit
|
||||
if(it->second.range.aspect > t.subresourceRange.aspect)
|
||||
if(it->second.range.aspectMask > t.subresourceRange.aspectMask)
|
||||
break;
|
||||
|
||||
// otherwise continue to try and find the subresource range
|
||||
@@ -291,8 +291,8 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
|
||||
uint32_t nummips = t.range.mipLevels;
|
||||
uint32_t numslices = t.range.arraySize;
|
||||
if(nummips == VK_LAST_MIP_LEVEL) nummips = states[id].mipLevels;
|
||||
if(numslices == VK_LAST_ARRAY_SLICE) numslices = states[id].arraySize;
|
||||
if(nummips == VK_REMAINING_MIP_LEVELS) nummips = states[id].mipLevels;
|
||||
if(numslices == VK_REMAINING_ARRAY_LAYERS) numslices = states[id].arraySize;
|
||||
|
||||
// VKTODOHIGH check, does this mean the sensible thing?
|
||||
if(nummips == 0) nummips = 1;
|
||||
@@ -303,7 +303,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
TRDBG("Transition of %s (%u->%u, %u->%u) from %s to %s",
|
||||
ToStr::Get(t.range.aspect).c_str(),
|
||||
t.range.baseMipLevel, t.range.mipLevels,
|
||||
t.range.baseArraySlice, t.range.arraySize,
|
||||
t.range.baseArrayLayer, t.range.arraySize,
|
||||
ToStr::Get(t.prevstate).c_str(), ToStr::Get(t.state).c_str());
|
||||
|
||||
bool done = false;
|
||||
@@ -316,7 +316,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
TRDBG(".. state %s (%u->%u, %u->%u) from %s to %s",
|
||||
ToStr::Get(it->range.aspect).c_str(),
|
||||
it->range.baseMipLevel, it->range.mipLevels,
|
||||
it->range.baseArraySlice, it->range.arraySize,
|
||||
it->range.baseArrayLayer, it->range.arraySize,
|
||||
ToStr::Get(it->prevstate).c_str(), ToStr::Get(it->state).c_str());
|
||||
|
||||
// image transitions are handled by initially inserting one subresource range for each aspect,
|
||||
@@ -324,7 +324,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
// each subresource in that aspect. Thereafter if a transition comes in that covers multiple
|
||||
// subresources, we transition all matching ranges.
|
||||
|
||||
if(it->range.aspect == t.range.aspect)
|
||||
if(it->range.aspectMask == t.range.aspectMask)
|
||||
{
|
||||
// we've found a range that completely matches our region, doesn't matter if that's
|
||||
// a whole image and the transition is the whole image, or it's one subresource.
|
||||
@@ -332,7 +332,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
// really have to worry about the else{} branch
|
||||
if(it->range.baseMipLevel == t.range.baseMipLevel &&
|
||||
it->range.mipLevels == nummips &&
|
||||
it->range.baseArraySlice == t.range.baseArraySlice &&
|
||||
it->range.baseArrayLayer == t.range.baseArrayLayer &&
|
||||
it->range.arraySize == numslices)
|
||||
{
|
||||
/*
|
||||
@@ -362,8 +362,8 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
it->range.arraySize == 1 &&
|
||||
it->range.baseMipLevel >= t.range.baseMipLevel &&
|
||||
it->range.baseMipLevel < t.range.baseMipLevel+nummips &&
|
||||
it->range.baseArraySlice >= t.range.baseArraySlice &&
|
||||
it->range.baseArraySlice < t.range.baseArraySlice+numslices)
|
||||
it->range.baseArrayLayer >= t.range.baseArrayLayer &&
|
||||
it->range.baseArrayLayer < t.range.baseArrayLayer+numslices)
|
||||
{
|
||||
// apply it (prevstate is from the start of all transitions, so only set once)
|
||||
if(it->prevstate == UNTRANSITIONED_IMG_STATE)
|
||||
@@ -401,7 +401,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
it->range.arraySize = 1;
|
||||
|
||||
// slice-major
|
||||
it->range.baseArraySlice = uint32_t(i / existing.range.mipLevels);
|
||||
it->range.baseArrayLayer = uint32_t(i / existing.range.mipLevels);
|
||||
it->range.baseMipLevel = uint32_t(i % existing.range.mipLevels);
|
||||
it++;
|
||||
}
|
||||
@@ -413,8 +413,8 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
// so we need to check to see if the first subresource lies in the range here
|
||||
if(it->range.baseMipLevel >= t.range.baseMipLevel &&
|
||||
it->range.baseMipLevel < t.range.baseMipLevel+nummips &&
|
||||
it->range.baseArraySlice >= t.range.baseArraySlice &&
|
||||
it->range.baseArraySlice < t.range.baseArraySlice+numslices)
|
||||
it->range.baseArrayLayer >= t.range.baseArrayLayer &&
|
||||
it->range.baseArrayLayer < t.range.baseArrayLayer+numslices)
|
||||
{
|
||||
// apply it (prevstate is from the start of all transitions, so only set once)
|
||||
if(it->prevstate == UNTRANSITIONED_IMG_STATE)
|
||||
@@ -432,7 +432,7 @@ void VulkanResourceManager::ApplyTransitions(vector< pair<ResourceId, ImageRegio
|
||||
}
|
||||
|
||||
// if we've gone past where the new subresource range would sit
|
||||
if(it->range.aspect > t.range.aspect)
|
||||
if(it->range.aspectMask > t.range.aspectMask)
|
||||
break;
|
||||
|
||||
// otherwise continue to try and find the subresource range
|
||||
|
||||
@@ -74,7 +74,6 @@ VulkanReplay::OutputWindow::OutputWindow() : wnd(NULL_WND_HANDLE), width(0), hei
|
||||
fb = VK_NULL_HANDLE;
|
||||
fbdepth = VK_NULL_HANDLE;
|
||||
renderpass = VK_NULL_HANDLE;
|
||||
fullVP = VK_NULL_HANDLE;
|
||||
|
||||
VkImageMemoryBarrier t = {
|
||||
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
|
||||
@@ -87,10 +86,10 @@ VulkanReplay::OutputWindow::OutputWindow() : wnd(NULL_WND_HANDLE), width(0), hei
|
||||
|
||||
bbtrans = t;
|
||||
|
||||
t.subresourceRange.aspect = VK_IMAGE_ASPECT_DEPTH;
|
||||
t.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
|
||||
depthtrans = t;
|
||||
|
||||
t.subresourceRange.aspect = VK_IMAGE_ASPECT_STENCIL;
|
||||
t.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
stenciltrans = t;
|
||||
}
|
||||
|
||||
@@ -142,7 +141,7 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
|
||||
}
|
||||
|
||||
if(swap != VK_NULL_HANDLE)
|
||||
vt->DestroySwapChainWSI(Unwrap(device), Unwrap(swap));
|
||||
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(swap));
|
||||
}
|
||||
|
||||
void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device, bool depth)
|
||||
@@ -150,66 +149,67 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
const VkLayerDispatchTable *vt = ObjDisp(device);
|
||||
|
||||
// save the old swapchain so it isn't destroyed
|
||||
VkSwapChainWSI old = swap;
|
||||
VkSwapchainKHR old = swap;
|
||||
swap = VK_NULL_HANDLE;
|
||||
|
||||
Destroy(driver, device);
|
||||
|
||||
void *handleptr = NULL;
|
||||
void *wndptr = NULL;
|
||||
VkPlatformWSI platform = VK_PLATFORM_MAX_ENUM_WSI;
|
||||
VkPlatformKHR platform = VK_PLATFORM_MAX_ENUM_KHR;
|
||||
|
||||
VkSurfaceDescriptionWindowWSI surfDesc = { VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_WSI };
|
||||
VkSurfaceDescriptionWindowKHR surfDesc = { VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR };
|
||||
|
||||
InitSurfaceDescription(surfDesc);
|
||||
|
||||
// sensible defaults
|
||||
VkFormat imformat = VK_FORMAT_B8G8R8A8_UNORM;
|
||||
VkPresentModeWSI presentmode = VK_PRESENT_MODE_FIFO_WSI;
|
||||
VkPresentModeKHR presentmode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
VkColorSpaceKHR imcolspace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
|
||||
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
|
||||
// check format and present mode from driver
|
||||
{
|
||||
size_t sz = 0;
|
||||
uint32_t numFormats = 0;
|
||||
|
||||
vkr = vt->GetSurfaceInfoWSI(Unwrap(device), (const VkSurfaceDescriptionWSI *)&surfDesc, VK_SURFACE_INFO_TYPE_FORMATS_WSI, &sz, NULL);
|
||||
vkr = vt->GetSurfaceFormatsKHR(Unwrap(device), (const VkSurfaceDescriptionKHR *)&surfDesc, &numFormats, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
// VKTODOLOW make sure whole pipeline is SRGB correct
|
||||
if(sz > 0)
|
||||
if(numFormats > 0)
|
||||
{
|
||||
size_t numFormats = sz / sizeof(VkSurfaceFormatPropertiesWSI);
|
||||
VkSurfaceFormatPropertiesWSI *formats = new VkSurfaceFormatPropertiesWSI[numFormats];
|
||||
VkSurfaceFormatKHR *formats = new VkSurfaceFormatKHR[numFormats];
|
||||
|
||||
vkr = vt->GetSurfaceInfoWSI(Unwrap(device), (const VkSurfaceDescriptionWSI *)&surfDesc, VK_SURFACE_INFO_TYPE_FORMATS_WSI, &sz, formats);
|
||||
vkr = vt->GetSurfaceFormatsKHR(Unwrap(device), (const VkSurfaceDescriptionKHR *)&surfDesc, &numFormats, formats);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
if(numFormats == 1 && formats[0].format == VK_FORMAT_UNDEFINED)
|
||||
{
|
||||
// 1 entry with undefined means no preference, just use our default
|
||||
imformat = VK_FORMAT_B8G8R8A8_UNORM;
|
||||
imcolspace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
|
||||
}
|
||||
else
|
||||
{
|
||||
// since we don't care, if the driver has a preference just pick the first
|
||||
imformat = formats[0].format;
|
||||
imcolspace = formats[0].colorSpace;
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY(formats);
|
||||
}
|
||||
|
||||
sz = 0;
|
||||
uint32_t numModes = 0;
|
||||
|
||||
vkr = vt->GetSurfaceInfoWSI(Unwrap(device), (const VkSurfaceDescriptionWSI *)&surfDesc, VK_SURFACE_INFO_TYPE_PRESENT_MODES_WSI, &sz, NULL);
|
||||
vkr = vt->GetSurfacePresentModesKHR(Unwrap(device), (const VkSurfaceDescriptionKHR *)&surfDesc, &numModes, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
if(sz > 0)
|
||||
if(numModes > 0)
|
||||
{
|
||||
size_t numModes = sz / sizeof(VkSurfacePresentModePropertiesWSI);
|
||||
VkSurfacePresentModePropertiesWSI *modes = new VkSurfacePresentModePropertiesWSI[numModes];
|
||||
VkPresentModeKHR *modes = new VkPresentModeKHR[numModes];
|
||||
|
||||
vkr = vt->GetSurfaceInfoWSI(Unwrap(device), (const VkSurfaceDescriptionWSI *)&surfDesc, VK_SURFACE_INFO_TYPE_PRESENT_MODES_WSI, &sz, modes);
|
||||
vkr = vt->GetSurfacePresentModesKHR(Unwrap(device), (const VkSurfaceDescriptionKHR *)&surfDesc, &numModes, modes);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
// If mailbox mode is available, use it, as is the lowest-latency non-
|
||||
@@ -218,49 +218,50 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
// always available.
|
||||
for (size_t i = 0; i < numModes; i++)
|
||||
{
|
||||
if (modes[i].presentMode == VK_PRESENT_MODE_MAILBOX_WSI)
|
||||
if (modes[i] == VK_PRESENT_MODE_MAILBOX_KHR)
|
||||
{
|
||||
presentmode = VK_PRESENT_MODE_MAILBOX_WSI;
|
||||
presentmode = VK_PRESENT_MODE_MAILBOX_KHR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (modes[i].presentMode == VK_PRESENT_MODE_IMMEDIATE_WSI)
|
||||
presentmode = VK_PRESENT_MODE_IMMEDIATE_WSI;
|
||||
if (modes[i] == VK_PRESENT_MODE_IMMEDIATE_KHR)
|
||||
presentmode = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY(modes);
|
||||
}
|
||||
}
|
||||
|
||||
VkSwapChainCreateInfoWSI swapInfo = {
|
||||
VK_STRUCTURE_TYPE_SWAP_CHAIN_CREATE_INFO_WSI, NULL, (VkSurfaceDescriptionWSI *)&surfDesc,
|
||||
2, imformat, { width, height },
|
||||
uint32_t idx = 0;
|
||||
|
||||
VkSwapchainCreateInfoKHR swapInfo = {
|
||||
VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, NULL, (VkSurfaceDescriptionKHR *)&surfDesc,
|
||||
2, imformat, imcolspace, { width, height },
|
||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT,
|
||||
VK_SURFACE_TRANSFORM_NONE_WSI, 1, presentmode,
|
||||
VK_SURFACE_TRANSFORM_NONE_KHR, 1,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, &idx,
|
||||
presentmode,
|
||||
Unwrap(old), true,
|
||||
};
|
||||
|
||||
vkr = vt->CreateSwapChainWSI(Unwrap(device), &swapInfo, &swap);
|
||||
vkr = vt->CreateSwapchainKHR(Unwrap(device), &swapInfo, &swap);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), swap);
|
||||
|
||||
if(old != VK_NULL_HANDLE)
|
||||
vt->DestroySwapChainWSI(Unwrap(device), Unwrap(old));
|
||||
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(old));
|
||||
|
||||
size_t sz;
|
||||
vkr = vt->GetSwapChainInfoWSI(Unwrap(device), Unwrap(swap), VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI, &sz, NULL);
|
||||
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
numImgs = uint32_t(sz/sizeof(VkSwapChainImagePropertiesWSI));
|
||||
|
||||
VkSwapChainImagePropertiesWSI* imgs = new VkSwapChainImagePropertiesWSI[numImgs];
|
||||
vkr = vt->GetSwapChainInfoWSI(Unwrap(device), Unwrap(swap), VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI, &sz, imgs);
|
||||
VkImage* imgs = new VkImage[numImgs];
|
||||
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, imgs);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
for(size_t i=0; i < numImgs; i++)
|
||||
{
|
||||
colimg[i] = imgs[i].image;
|
||||
colimg[i] = imgs[i];
|
||||
VKMGR()->WrapResource(Unwrap(device), colimg[i]);
|
||||
coltrans[i].image = Unwrap(colimg[i]);
|
||||
coltrans[i].oldLayout = coltrans[i].newLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
@@ -355,7 +356,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
|
||||
{
|
||||
VkImageViewCreateInfo info = {
|
||||
VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO, NULL,
|
||||
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, NULL,
|
||||
Unwrap(bb), VK_IMAGE_VIEW_TYPE_2D,
|
||||
imformat,
|
||||
{ VK_CHANNEL_SWIZZLE_R, VK_CHANNEL_SWIZZLE_G, VK_CHANNEL_SWIZZLE_B, VK_CHANNEL_SWIZZLE_A },
|
||||
@@ -384,7 +385,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
if(dsimg != VK_NULL_HANDLE)
|
||||
{
|
||||
VkImageViewCreateInfo info = {
|
||||
VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO, NULL,
|
||||
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, NULL,
|
||||
Unwrap(dsimg), VK_IMAGE_VIEW_TYPE_2D,
|
||||
VK_FORMAT_D32_SFLOAT_S8_UINT,
|
||||
{ VK_CHANNEL_SWIZZLE_R, VK_CHANNEL_SWIZZLE_G, VK_CHANNEL_SWIZZLE_B, VK_CHANNEL_SWIZZLE_A },
|
||||
@@ -531,7 +532,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_
|
||||
{
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
128, VK_BUFFER_USAGE_GENERAL, 0,
|
||||
128, VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
@@ -556,7 +557,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_
|
||||
// VKTODOHIGH find out the actual current image state
|
||||
VkImageMemoryBarrier fakeTrans = {
|
||||
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
|
||||
0, 0, VK_IMAGE_LAYOUT_PRESENT_SOURCE_WSI, VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL,
|
||||
0, 0, VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR, VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL,
|
||||
0, 0, Unwrap(fakeBBIm),
|
||||
{ VK_IMAGE_ASPECT_COLOR, 0, 1, 0, 1 } };
|
||||
|
||||
@@ -578,7 +579,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_
|
||||
};
|
||||
vt->CmdCopyImageToBuffer(Unwrap(cmd), Unwrap(fakeBBIm), VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL, destbuf, 1, ®ion);
|
||||
|
||||
fakeTrans.newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_WSI;
|
||||
fakeTrans.newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR;
|
||||
vt->CmdPipelineBarrier(Unwrap(cmd), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, false, 1, &barrier);
|
||||
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
@@ -759,8 +760,7 @@ bool VulkanReplay::RenderTexture(TextureDisplay cfg)
|
||||
Unwrap(GetDebugManager()->m_TexDisplayDescSet), 1, 0, 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, &desc
|
||||
};
|
||||
|
||||
VkResult vkr = vt->UpdateDescriptorSets(Unwrap(dev), 1, &writeSet, 0, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->UpdateDescriptorSets(Unwrap(dev), 1, &writeSet, 0, NULL);
|
||||
|
||||
VkImageMemoryBarrier srcimTrans = {
|
||||
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
|
||||
@@ -770,10 +770,8 @@ bool VulkanReplay::RenderTexture(TextureDisplay cfg)
|
||||
|
||||
VkCmdBufferBeginInfo beginInfo = { VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO, NULL, VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT };
|
||||
|
||||
vkr = vt->ResetCommandBuffer(Unwrap(cmd), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vkr = vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->ResetCommandBuffer(Unwrap(cmd), 0);
|
||||
vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
|
||||
|
||||
void *barrier = (void *)&srcimTrans;
|
||||
|
||||
@@ -813,8 +811,7 @@ bool VulkanReplay::RenderTexture(TextureDisplay cfg)
|
||||
// ring-buffer style
|
||||
vt->QueueWaitIdle(Unwrap(q));
|
||||
|
||||
vkr = vt->DestroyImageView(Unwrap(dev), Unwrap(liveImView));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyImageView(Unwrap(dev), Unwrap(liveImView));
|
||||
VKMGR()->ReleaseWrappedResource(liveImView);
|
||||
|
||||
return false;
|
||||
@@ -1029,14 +1026,13 @@ void VulkanReplay::BindOutputWindow(uint64_t id, bool depth)
|
||||
VkResult vkr = vt->CreateSemaphore(Unwrap(dev), &semInfo, &sem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
vkr = vt->AcquireNextImageWSI(Unwrap(dev), Unwrap(outw.swap), UINT64_MAX, sem, &outw.curidx);
|
||||
vkr = vt->AcquireNextImageKHR(Unwrap(dev), Unwrap(outw.swap), UINT64_MAX, sem, &outw.curidx);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
vkr = vt->QueueWaitSemaphore(Unwrap(q), sem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
vkr = vt->DestroySemaphore(Unwrap(dev), sem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroySemaphore(Unwrap(dev), sem);
|
||||
|
||||
VkCmdBufferBeginInfo beginInfo = { VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO, NULL, VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT };
|
||||
|
||||
@@ -1147,7 +1143,7 @@ void VulkanReplay::FlipOutputWindow(uint64_t id)
|
||||
vt->CmdCopyImage(Unwrap(cmd), Unwrap(outw.bb), VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL, Unwrap(outw.colimg[outw.curidx]), VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL, 1, &cpy);
|
||||
|
||||
outw.bbtrans.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
outw.coltrans[outw.curidx].newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_WSI;
|
||||
outw.coltrans[outw.curidx].newLayout = VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR;
|
||||
|
||||
vt->CmdPipelineBarrier(Unwrap(cmd), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, false, 2, barrier);
|
||||
|
||||
@@ -1158,9 +1154,9 @@ void VulkanReplay::FlipOutputWindow(uint64_t id)
|
||||
|
||||
vt->QueueSubmit(Unwrap(q), 1, UnwrapPtr(cmd), VK_NULL_HANDLE);
|
||||
|
||||
VkPresentInfoWSI presentInfo = { VK_STRUCTURE_TYPE_QUEUE_PRESENT_INFO_WSI, NULL, 1, UnwrapPtr(outw.swap), &outw.curidx };
|
||||
VkPresentInfoKHR presentInfo = { VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, NULL, 1, UnwrapPtr(outw.swap), &outw.curidx };
|
||||
|
||||
vt->QueuePresentWSI(Unwrap(q), &presentInfo);
|
||||
vt->QueuePresentKHR(Unwrap(q), &presentInfo);
|
||||
|
||||
vt->QueueWaitIdle(Unwrap(q));
|
||||
|
||||
@@ -1255,7 +1251,7 @@ vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint32_t offset, uint3
|
||||
|
||||
VkBufferCreateInfo bufInfo = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL,
|
||||
(VkDeviceSize)ret.size(), VK_BUFFER_USAGE_GENERAL, 0,
|
||||
(VkDeviceSize)ret.size(), VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT|VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT, 0,
|
||||
VK_SHARING_MODE_EXCLUSIVE, 0, NULL,
|
||||
};
|
||||
|
||||
@@ -1296,8 +1292,7 @@ vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint32_t offset, uint3
|
||||
RDCASSERT(pData != NULL);
|
||||
memcpy(&ret[0], pData, ret.size());
|
||||
|
||||
vkr = vt->UnmapMemory(Unwrap(dev), readbackmem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->UnmapMemory(Unwrap(dev), readbackmem);
|
||||
|
||||
vt->DeviceWaitIdle(Unwrap(dev));
|
||||
|
||||
@@ -1542,7 +1537,7 @@ void VulkanReplay::SavePipelineState()
|
||||
}
|
||||
if(info->bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
dst.bindings[b].binds[a].view = VK_NULL_HANDLE;
|
||||
dst.bindings[b].binds[a].view = ResourceId();
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(VKMGR()->GetNonDispWrapper(info->bufferInfo.buffer)->id);
|
||||
}
|
||||
}
|
||||
@@ -1654,12 +1649,12 @@ void VulkanReplay::SavePipelineState()
|
||||
m_VulkanPipelineState.DS.maxDepthBounds = state.maxdepth;
|
||||
|
||||
m_VulkanPipelineState.DS.front.ref = state.front.ref;
|
||||
m_VulkanPipelineState.DS.front.compareMask = state.compareMask;
|
||||
m_VulkanPipelineState.DS.front.writeMask = state.writeMask;
|
||||
m_VulkanPipelineState.DS.front.compareMask = state.front.compare;
|
||||
m_VulkanPipelineState.DS.front.writeMask = state.front.write;
|
||||
|
||||
m_VulkanPipelineState.DS.back.ref = state.back.ref;
|
||||
m_VulkanPipelineState.DS.back.compareMask = state.compareMask;
|
||||
m_VulkanPipelineState.DS.back.writeMask = state.writeMask;
|
||||
m_VulkanPipelineState.DS.back.compareMask = state.back.compare;
|
||||
m_VulkanPipelineState.DS.back.writeMask = state.back.write;
|
||||
|
||||
// Renderpass
|
||||
m_VulkanPipelineState.Pass.renderpass.obj = state.renderPass;
|
||||
|
||||
@@ -175,14 +175,14 @@ class VulkanReplay : public IReplayDriver
|
||||
void Destroy(WrappedVulkan *driver, VkDevice device);
|
||||
|
||||
// implemented in vk_replay_platform.cpp
|
||||
void InitSurfaceDescription(VkSurfaceDescriptionWindowWSI &surfDesc);
|
||||
void InitSurfaceDescription(VkSurfaceDescriptionWindowKHR &surfDesc);
|
||||
void SetWindowHandle(void *wn);
|
||||
|
||||
WINDOW_HANDLE_DECL
|
||||
|
||||
int32_t width, height;
|
||||
|
||||
VkSwapChainWSI swap;
|
||||
VkSwapchainKHR swap;
|
||||
uint32_t numImgs;
|
||||
VkImage colimg[8];
|
||||
VkImageMemoryBarrier coltrans[8];
|
||||
|
||||
@@ -31,13 +31,13 @@ void VulkanReplay::OutputWindow::SetWindowHandle(void *wn)
|
||||
wnd = (HWND)wn;
|
||||
}
|
||||
|
||||
void VulkanReplay::OutputWindow::InitSurfaceDescription(VkSurfaceDescriptionWindowWSI &surfDesc)
|
||||
void VulkanReplay::OutputWindow::InitSurfaceDescription(VkSurfaceDescriptionWindowKHR &surfDesc)
|
||||
{
|
||||
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
(const char *)&dllLocator, (HMODULE *)&surfDesc.pPlatformHandle);
|
||||
|
||||
|
||||
surfDesc.pPlatformWindow = wnd;
|
||||
surfDesc.platform = VK_PLATFORM_WIN32_WSI;
|
||||
surfDesc.platform = VK_PLATFORM_WIN32_KHR;
|
||||
}
|
||||
|
||||
void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
|
||||
|
||||
@@ -51,7 +51,7 @@ WRAPPED_POOL_INST(WrappedVkDescriptorSet)
|
||||
WRAPPED_POOL_INST(WrappedVkFramebuffer)
|
||||
WRAPPED_POOL_INST(WrappedVkCmdPool)
|
||||
|
||||
WRAPPED_POOL_INST(WrappedVkSwapChainWSI)
|
||||
WRAPPED_POOL_INST(WrappedVkSwapchainKHR)
|
||||
|
||||
bool IsDispatchableRes(WrappedVkRes *ptr)
|
||||
{
|
||||
@@ -87,7 +87,7 @@ VkResourceType IdentifyTypeByPtr(WrappedVkRes *ptr)
|
||||
if(WrappedVkEvent::IsAlloc(ptr)) return eResEvent;
|
||||
if(WrappedVkQueryPool::IsAlloc(ptr)) return eResQueryPool;
|
||||
if(WrappedVkSemaphore::IsAlloc(ptr)) return eResSemaphore;
|
||||
if(WrappedVkSwapChainWSI::IsAlloc(ptr)) return eResWSISwapChain;
|
||||
if(WrappedVkSwapchainKHR::IsAlloc(ptr)) return eResSwapchain;
|
||||
|
||||
RDCERR("Unknown type for ptr 0x%p", ptr);
|
||||
|
||||
@@ -165,7 +165,7 @@ bool IsDepthStencilFormat(VkFormat f)
|
||||
switch(f)
|
||||
{
|
||||
case VK_FORMAT_D16_UNORM:
|
||||
case VK_FORMAT_D24_UNORM:
|
||||
case VK_FORMAT_D24_UNORM_X8:
|
||||
case VK_FORMAT_D32_SFLOAT:
|
||||
case VK_FORMAT_S8_UINT:
|
||||
case VK_FORMAT_D16_UNORM_S8_UINT:
|
||||
|
||||
@@ -73,7 +73,7 @@ enum VkResourceType
|
||||
eResQueryPool,
|
||||
eResSemaphore,
|
||||
|
||||
eResWSISwapChain,
|
||||
eResSwapchain,
|
||||
};
|
||||
|
||||
// dummy standin for a typeless real resource
|
||||
@@ -374,11 +374,11 @@ struct WrappedVkCmdPool : WrappedVkNonDispRes
|
||||
typedef VkCmdPool InnerType; ALLOCATE_WITH_WRAPPED_POOL(WrappedVkCmdPool);
|
||||
enum { TypeEnum = eResCmdPool, };
|
||||
};
|
||||
struct WrappedVkSwapChainWSI : WrappedVkNonDispRes
|
||||
struct WrappedVkSwapchainKHR : WrappedVkNonDispRes
|
||||
{
|
||||
WrappedVkSwapChainWSI(VkSwapChainWSI obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {}
|
||||
typedef VkSwapChainWSI InnerType; ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSwapChainWSI);
|
||||
enum { TypeEnum = eResWSISwapChain, };
|
||||
WrappedVkSwapchainKHR(VkSwapchainKHR obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {}
|
||||
typedef VkSwapchainKHR InnerType; ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSwapchainKHR);
|
||||
enum { TypeEnum = eResSwapchain, };
|
||||
};
|
||||
|
||||
// VKTODOMED Need to find out which resources can validly return duplicate
|
||||
@@ -435,7 +435,7 @@ UNWRAP_NONDISP_HELPER(VkDescriptorPool)
|
||||
UNWRAP_NONDISP_HELPER(VkDescriptorSet)
|
||||
UNWRAP_NONDISP_HELPER(VkFramebuffer)
|
||||
UNWRAP_NONDISP_HELPER(VkCmdPool)
|
||||
UNWRAP_NONDISP_HELPER(VkSwapChainWSI)
|
||||
UNWRAP_NONDISP_HELPER(VkSwapchainKHR)
|
||||
|
||||
#define WRAPPING_DEBUG 0
|
||||
|
||||
@@ -536,8 +536,8 @@ struct ImageRegionState
|
||||
ImageRegionState()
|
||||
: prevstate(UNTRANSITIONED_IMG_STATE), state(UNTRANSITIONED_IMG_STATE)
|
||||
{
|
||||
range.aspect = VK_IMAGE_ASPECT_COLOR;
|
||||
range.baseArraySlice = 0; range.arraySize = 0;
|
||||
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
range.baseArrayLayer = 0; range.arraySize = 0;
|
||||
range.baseMipLevel = 0; range.mipLevels = 0;
|
||||
}
|
||||
ImageRegionState(VkImageSubresourceRange r, VkImageLayout pr, VkImageLayout st)
|
||||
|
||||
@@ -112,7 +112,7 @@ static const VkLayerProperties globalLayers[] = {
|
||||
VkResult getProps(uint32_t *dstCount, void *dstProps, uint32_t srcCount, void *srcProps, size_t elemSize)
|
||||
{
|
||||
if(dstCount == NULL)
|
||||
return VK_ERROR_INVALID_POINTER;
|
||||
return VK_RESULT_MAX_ENUM;
|
||||
|
||||
if(dstProps == NULL)
|
||||
{
|
||||
|
||||
@@ -27,14 +27,10 @@
|
||||
bool WrappedVulkan::Serialise_vkCreateDescriptorPool(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
VkDescriptorPoolUsage poolUsage,
|
||||
uint32_t maxSets,
|
||||
const VkDescriptorPoolCreateInfo* pCreateInfo,
|
||||
VkDescriptorPool* pDescriptorPool)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(VkDescriptorPoolUsage, pooluse, poolUsage);
|
||||
SERIALISE_ELEMENT(uint32_t, maxs, maxSets);
|
||||
SERIALISE_ELEMENT(VkDescriptorPoolCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pDescriptorPool));
|
||||
|
||||
@@ -44,7 +40,7 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorPool(
|
||||
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateDescriptorPool(Unwrap(device), pooluse, maxs, &info, &pool);
|
||||
VkResult ret = ObjDisp(device)->CreateDescriptorPool(Unwrap(device), &info, &pool);
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
@@ -62,12 +58,10 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorPool(
|
||||
|
||||
VkResult WrappedVulkan::vkCreateDescriptorPool(
|
||||
VkDevice device,
|
||||
VkDescriptorPoolUsage poolUsage,
|
||||
uint32_t maxSets,
|
||||
const VkDescriptorPoolCreateInfo* pCreateInfo,
|
||||
VkDescriptorPool* pDescriptorPool)
|
||||
{
|
||||
VkResult ret = ObjDisp(device)->CreateDescriptorPool(Unwrap(device), poolUsage, maxSets, pCreateInfo, pDescriptorPool);
|
||||
VkResult ret = ObjDisp(device)->CreateDescriptorPool(Unwrap(device), pCreateInfo, pDescriptorPool);
|
||||
|
||||
if(ret == VK_SUCCESS)
|
||||
{
|
||||
@@ -81,7 +75,7 @@ VkResult WrappedVulkan::vkCreateDescriptorPool(
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CREATE_DESCRIPTOR_POOL);
|
||||
Serialise_vkCreateDescriptorPool(localSerialiser, device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
|
||||
Serialise_vkCreateDescriptorPool(localSerialiser, device, pCreateInfo, pDescriptorPool);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
@@ -202,8 +196,7 @@ bool WrappedVulkan::Serialise_vkAllocDescriptorSets(
|
||||
VkDescriptorSetUsage setUsage,
|
||||
uint32_t count,
|
||||
const VkDescriptorSetLayout* pSetLayouts,
|
||||
VkDescriptorSet* pDescriptorSets,
|
||||
uint32_t* pCount)
|
||||
VkDescriptorSet* pDescriptorSets)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(ResourceId, poolId, GetResID(descriptorPool));
|
||||
@@ -219,8 +212,7 @@ bool WrappedVulkan::Serialise_vkAllocDescriptorSets(
|
||||
descriptorPool = GetResourceManager()->GetLiveHandle<VkDescriptorPool>(poolId);
|
||||
VkDescriptorSetLayout layout = GetResourceManager()->GetLiveHandle<VkDescriptorSetLayout>(layoutId);
|
||||
|
||||
uint32_t cnt = 0;
|
||||
VkResult ret = ObjDisp(device)->AllocDescriptorSets(Unwrap(device), Unwrap(descriptorPool), usage, 1, UnwrapPtr(layout), &descset, &cnt);
|
||||
VkResult ret = ObjDisp(device)->AllocDescriptorSets(Unwrap(device), Unwrap(descriptorPool), usage, 1, UnwrapPtr(layout), &descset);
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
@@ -240,66 +232,58 @@ bool WrappedVulkan::Serialise_vkAllocDescriptorSets(
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkAllocDescriptorSets(
|
||||
void WrappedVulkan::vkAllocDescriptorSets(
|
||||
VkDevice device,
|
||||
VkDescriptorPool descriptorPool,
|
||||
VkDescriptorSetUsage setUsage,
|
||||
uint32_t count,
|
||||
const VkDescriptorSetLayout* pSetLayouts,
|
||||
VkDescriptorSet* pDescriptorSets,
|
||||
uint32_t* pCount)
|
||||
VkDescriptorSet* pDescriptorSets)
|
||||
{
|
||||
VkDescriptorSetLayout *unwrapped = GetTempArray<VkDescriptorSetLayout>(count);
|
||||
for(uint32_t i=0; i < count; i++) unwrapped[i] = Unwrap(pSetLayouts[i]);
|
||||
|
||||
VkResult ret = ObjDisp(device)->AllocDescriptorSets(Unwrap(device), Unwrap(descriptorPool), setUsage, count, unwrapped, pDescriptorSets, pCount);
|
||||
|
||||
RDCASSERT(pCount == NULL || *pCount == count); // VKTODOMED: find out what *pCount < count means
|
||||
ObjDisp(device)->AllocDescriptorSets(Unwrap(device), Unwrap(descriptorPool), setUsage, count, unwrapped, pDescriptorSets);
|
||||
|
||||
if(ret == VK_SUCCESS)
|
||||
for(uint32_t i=0; i < count; i++)
|
||||
{
|
||||
for(uint32_t i=0; i < count; i++)
|
||||
ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), pDescriptorSets[i]);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), pDescriptorSets[i]);
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
SCOPED_SERIALISE_CONTEXT(ALLOC_DESC_SET);
|
||||
Serialise_vkAllocDescriptorSets(localSerialiser, device, descriptorPool, setUsage, 1, &pSetLayouts[i], &pDescriptorSets[i]);
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(ALLOC_DESC_SET);
|
||||
Serialise_vkAllocDescriptorSets(localSerialiser, device, descriptorPool, setUsage, 1, &pSetLayouts[i], &pDescriptorSets[i], NULL);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pDescriptorSets[i]);
|
||||
record->AddChunk(chunk);
|
||||
|
||||
ResourceId layoutID = GetResID(pSetLayouts[i]);
|
||||
|
||||
record->AddParent(GetRecord(descriptorPool));
|
||||
record->AddParent(GetResourceManager()->GetResourceRecord(layoutID));
|
||||
|
||||
// just always treat descriptor sets as dirty
|
||||
if(m_State != WRITING_CAPFRAME)
|
||||
GetResourceManager()->MarkDirtyResource(id);
|
||||
else
|
||||
GetResourceManager()->MarkPendingDirty(id);
|
||||
|
||||
record->layout = layoutID;
|
||||
m_CreationInfo.m_DescSetLayout[layoutID].CreateBindingsArray(record->descBindings);
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pDescriptorSets[i]);
|
||||
record->AddChunk(chunk);
|
||||
|
||||
ResourceId layoutID = GetResID(pSetLayouts[i]);
|
||||
|
||||
record->AddParent(GetRecord(descriptorPool));
|
||||
record->AddParent(GetResourceManager()->GetResourceRecord(layoutID));
|
||||
|
||||
// just always treat descriptor sets as dirty
|
||||
if(m_State != WRITING_CAPFRAME)
|
||||
GetResourceManager()->MarkDirtyResource(id);
|
||||
else
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, pDescriptorSets[i]);
|
||||
}
|
||||
GetResourceManager()->MarkPendingDirty(id);
|
||||
|
||||
record->layout = layoutID;
|
||||
m_CreationInfo.m_DescSetLayout[layoutID].CreateBindingsArray(record->descBindings);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, pDescriptorSets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkFreeDescriptorSets(
|
||||
@@ -432,15 +416,13 @@ bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkUpdateDescriptorSets(
|
||||
void WrappedVulkan::vkUpdateDescriptorSets(
|
||||
VkDevice device,
|
||||
uint32_t writeCount,
|
||||
const VkWriteDescriptorSet* pDescriptorWrites,
|
||||
uint32_t copyCount,
|
||||
const VkCopyDescriptorSet* pDescriptorCopies)
|
||||
{
|
||||
VkResult ret = VK_SUCCESS;
|
||||
|
||||
{
|
||||
// need to count up number of descriptor infos, to be able to alloc enough space
|
||||
uint32_t numInfos = 0;
|
||||
@@ -480,137 +462,132 @@ VkResult WrappedVulkan::vkUpdateDescriptorSets(
|
||||
unwrappedCopies[i].srcSet = Unwrap(unwrappedCopies[i].srcSet);
|
||||
}
|
||||
|
||||
ret = ObjDisp(device)->UpdateDescriptorSets(Unwrap(device), writeCount, unwrappedWrites, copyCount, unwrappedCopies);
|
||||
ObjDisp(device)->UpdateDescriptorSets(Unwrap(device), writeCount, unwrappedWrites, copyCount, unwrappedCopies);
|
||||
}
|
||||
|
||||
if(ret == VK_SUCCESS)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
// don't have to mark referenced any of the resources pointed to by the descriptor set - that's handled
|
||||
// on queue submission by marking ref'd all the current bindings of the sets referenced by the cmd buffer
|
||||
|
||||
for(uint32_t i=0; i < writeCount; i++)
|
||||
{
|
||||
// don't have to mark referenced any of the resources pointed to by the descriptor set - that's handled
|
||||
// on queue submission by marking ref'd all the current bindings of the sets referenced by the cmd buffer
|
||||
|
||||
for(uint32_t i=0; i < writeCount; i++)
|
||||
{
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(UPDATE_DESC_SET);
|
||||
Serialise_vkUpdateDescriptorSets(localSerialiser, device, 1, &pDescriptorWrites[i], 0, NULL);
|
||||
SCOPED_SERIALISE_CONTEXT(UPDATE_DESC_SET);
|
||||
Serialise_vkUpdateDescriptorSets(localSerialiser, device, 1, &pDescriptorWrites[i], 0, NULL);
|
||||
|
||||
m_FrameCaptureRecord->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
// as long as descriptor sets are forced to have initial states, we don't have to mark them ref'd for
|
||||
// write here. The reason being that as long as we only mark them as ref'd when they're actually bound,
|
||||
// we can safely skip the ref here and it means any descriptor set updates of descriptor sets that are
|
||||
// never used in the frame can be ignored.
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorWrites[i].destSet), eFrameRef_Write);
|
||||
m_FrameCaptureRecord->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
for(uint32_t i=0; i < copyCount; i++)
|
||||
{
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(UPDATE_DESC_SET);
|
||||
Serialise_vkUpdateDescriptorSets(localSerialiser, device, 0, NULL, 1, &pDescriptorCopies[i]);
|
||||
|
||||
m_FrameCaptureRecord->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
// as long as descriptor sets are forced to have initial states, we don't have to mark them ref'd for
|
||||
// write here. The reason being that as long as we only mark them as ref'd when they're actually bound,
|
||||
// we can safely skip the ref here and it means any descriptor set updates of descriptor sets that are
|
||||
// never used in the frame can be ignored.
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorCopies[i].destSet), eFrameRef_Write);
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorCopies[i].srcSet), eFrameRef_Read);
|
||||
}
|
||||
// as long as descriptor sets are forced to have initial states, we don't have to mark them ref'd for
|
||||
// write here. The reason being that as long as we only mark them as ref'd when they're actually bound,
|
||||
// we can safely skip the ref here and it means any descriptor set updates of descriptor sets that are
|
||||
// never used in the frame can be ignored.
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorWrites[i].destSet), eFrameRef_Write);
|
||||
}
|
||||
|
||||
// need to track descriptor set contents whether capframing or idle
|
||||
if(m_State >= WRITING)
|
||||
for(uint32_t i=0; i < copyCount; i++)
|
||||
{
|
||||
for(uint32_t i=0; i < writeCount; i++)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(pDescriptorWrites[i].destSet);
|
||||
const VulkanCreationInfo::DescSetLayout &layout = m_CreationInfo.m_DescSetLayout[record->layout];
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
RDCASSERT(pDescriptorWrites[i].destBinding < record->descBindings.size());
|
||||
|
||||
VkDescriptorInfo *binding = record->descBindings[pDescriptorWrites[i].destBinding];
|
||||
SCOPED_SERIALISE_CONTEXT(UPDATE_DESC_SET);
|
||||
Serialise_vkUpdateDescriptorSets(localSerialiser, device, 0, NULL, 1, &pDescriptorCopies[i]);
|
||||
|
||||
FrameRefType ref = eFrameRef_Write;
|
||||
|
||||
switch(layout.bindings[pDescriptorWrites[i].destBinding].descriptorType)
|
||||
{
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER:
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
||||
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
|
||||
ref = eFrameRef_Read;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
||||
ref = eFrameRef_Write;
|
||||
break;
|
||||
default:
|
||||
RDCERR("Unexpected descriptor type");
|
||||
}
|
||||
|
||||
// We need to handle the cases where these bindings are stale:
|
||||
// ie. image handle 0xf00baa is allocated
|
||||
// bound into a descriptor set
|
||||
// image is released
|
||||
// descriptor set is bound but this image is never used by shader etc.
|
||||
//
|
||||
// worst case, a new image or something has been added with this handle -
|
||||
// in this case we end up ref'ing an image that isn't actually used.
|
||||
// Worst worst case, we ref an image as write when actually it's not, but
|
||||
// this is likewise not a serious problem, and rather difficult to solve
|
||||
// (would need to version handles somehow, but don't have enough bits
|
||||
// to do that reliably).
|
||||
//
|
||||
// This is handled by RemoveBindFrameRef silently dropping id == ResourceId()
|
||||
|
||||
for(uint32_t d=0; d < pDescriptorWrites[i].count; d++)
|
||||
{
|
||||
VkDescriptorInfo &bind = binding[pDescriptorWrites[i].destArrayElement + d];
|
||||
|
||||
if(bind.bufferView != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.bufferView));
|
||||
if(bind.imageView != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.imageView));
|
||||
if(bind.sampler != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.sampler));
|
||||
if(bind.bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.bufferInfo.buffer));
|
||||
|
||||
bind = pDescriptorWrites[i].pDescriptors[d];
|
||||
|
||||
if(bind.bufferView != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.bufferView), ref);
|
||||
if(bind.imageView != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.imageView), ref);
|
||||
if(bind.sampler != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.sampler), ref);
|
||||
if(bind.bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.bufferInfo.buffer), ref);
|
||||
}
|
||||
}
|
||||
|
||||
if(copyCount > 0)
|
||||
{
|
||||
// don't want to implement this blindly
|
||||
RDCUNIMPLEMENTED("Copying descriptors not implemented");
|
||||
m_FrameCaptureRecord->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
// as long as descriptor sets are forced to have initial states, we don't have to mark them ref'd for
|
||||
// write here. The reason being that as long as we only mark them as ref'd when they're actually bound,
|
||||
// we can safely skip the ref here and it means any descriptor set updates of descriptor sets that are
|
||||
// never used in the frame can be ignored.
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorCopies[i].destSet), eFrameRef_Write);
|
||||
//GetResourceManager()->MarkResourceFrameReferenced(GetResID(pDescriptorCopies[i].srcSet), eFrameRef_Read);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
// need to track descriptor set contents whether capframing or idle
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
for(uint32_t i=0; i < writeCount; i++)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(pDescriptorWrites[i].destSet);
|
||||
const VulkanCreationInfo::DescSetLayout &layout = m_CreationInfo.m_DescSetLayout[record->layout];
|
||||
|
||||
RDCASSERT(pDescriptorWrites[i].destBinding < record->descBindings.size());
|
||||
|
||||
VkDescriptorInfo *binding = record->descBindings[pDescriptorWrites[i].destBinding];
|
||||
|
||||
FrameRefType ref = eFrameRef_Write;
|
||||
|
||||
switch(layout.bindings[pDescriptorWrites[i].destBinding].descriptorType)
|
||||
{
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER:
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
||||
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
|
||||
ref = eFrameRef_Read;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
||||
ref = eFrameRef_Write;
|
||||
break;
|
||||
default:
|
||||
RDCERR("Unexpected descriptor type");
|
||||
}
|
||||
|
||||
// We need to handle the cases where these bindings are stale:
|
||||
// ie. image handle 0xf00baa is allocated
|
||||
// bound into a descriptor set
|
||||
// image is released
|
||||
// descriptor set is bound but this image is never used by shader etc.
|
||||
//
|
||||
// worst case, a new image or something has been added with this handle -
|
||||
// in this case we end up ref'ing an image that isn't actually used.
|
||||
// Worst worst case, we ref an image as write when actually it's not, but
|
||||
// this is likewise not a serious problem, and rather difficult to solve
|
||||
// (would need to version handles somehow, but don't have enough bits
|
||||
// to do that reliably).
|
||||
//
|
||||
// This is handled by RemoveBindFrameRef silently dropping id == ResourceId()
|
||||
|
||||
for(uint32_t d=0; d < pDescriptorWrites[i].count; d++)
|
||||
{
|
||||
VkDescriptorInfo &bind = binding[pDescriptorWrites[i].destArrayElement + d];
|
||||
|
||||
if(bind.bufferView != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.bufferView));
|
||||
if(bind.imageView != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.imageView));
|
||||
if(bind.sampler != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.sampler));
|
||||
if(bind.bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
record->RemoveBindFrameRef(GetResID(bind.bufferInfo.buffer));
|
||||
|
||||
bind = pDescriptorWrites[i].pDescriptors[d];
|
||||
|
||||
if(bind.bufferView != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.bufferView), ref);
|
||||
if(bind.imageView != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.imageView), ref);
|
||||
if(bind.sampler != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.sampler), ref);
|
||||
if(bind.bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
record->AddBindFrameRef(GetResID(bind.bufferInfo.buffer), ref);
|
||||
}
|
||||
}
|
||||
|
||||
if(copyCount > 0)
|
||||
{
|
||||
// don't want to implement this blindly
|
||||
RDCUNIMPLEMENTED("Copying descriptors not implemented");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@ VkResult WrappedVulkan::vkCreateInstance(
|
||||
const VkInstanceCreateInfo* pCreateInfo,
|
||||
VkInstance* pInstance)
|
||||
{
|
||||
if(pCreateInfo == NULL)
|
||||
return VK_ERROR_INVALID_POINTER;
|
||||
RDCASSERT(pCreateInfo);
|
||||
|
||||
RDCASSERT(pCreateInfo->pAppInfo == NULL || pCreateInfo->pAppInfo->pNext == NULL);
|
||||
RDCASSERT(pCreateInfo->pNext == NULL);
|
||||
@@ -69,13 +68,9 @@ VkResult WrappedVulkan::vkCreateInstance(
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkDestroyInstance(
|
||||
VkInstance instance)
|
||||
void WrappedVulkan::vkDestroyInstance(VkInstance instance)
|
||||
{
|
||||
VkResult ret = ObjDisp(instance)->DestroyInstance(Unwrap(instance));
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
return ret;
|
||||
ObjDisp(instance)->DestroyInstance(Unwrap(instance));
|
||||
|
||||
if(m_FrameCaptureRecord)
|
||||
{
|
||||
@@ -90,8 +85,6 @@ VkResult WrappedVulkan::vkDestroyInstance(
|
||||
GetResourceManager()->ReleaseWrappedResource(instance);
|
||||
|
||||
m_ResourceManager->Shutdown();
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(
|
||||
@@ -217,11 +210,11 @@ bool WrappedVulkan::Serialise_vkCreateDevice(
|
||||
VkDevice device;
|
||||
|
||||
uint32_t qCount = 0;
|
||||
VkResult vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueCount(Unwrap(physicalDevice), &qCount);
|
||||
VkResult vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(physicalDevice), &qCount, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VkPhysicalDeviceQueueProperties *props = new VkPhysicalDeviceQueueProperties[qCount];
|
||||
vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueProperties(Unwrap(physicalDevice), qCount, props);
|
||||
VkQueueFamilyProperties *props = new VkQueueFamilyProperties[qCount];
|
||||
vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(physicalDevice), &qCount, props);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
bool found = false;
|
||||
@@ -342,11 +335,11 @@ VkResult WrappedVulkan::vkCreateDevice(
|
||||
VkDeviceCreateInfo createInfo = *pCreateInfo;
|
||||
|
||||
uint32_t qCount = 0;
|
||||
VkResult vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueCount(Unwrap(physicalDevice), &qCount);
|
||||
VkResult vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(physicalDevice), &qCount, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VkPhysicalDeviceQueueProperties *props = new VkPhysicalDeviceQueueProperties[qCount];
|
||||
vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueProperties(Unwrap(physicalDevice), qCount, props);
|
||||
VkQueueFamilyProperties *props = new VkQueueFamilyProperties[qCount];
|
||||
vkr = ObjDisp(physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(physicalDevice), &qCount, props);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
// find a queue that supports all capabilities, and if one doesn't exist, add it.
|
||||
@@ -482,7 +475,7 @@ VkResult WrappedVulkan::vkCreateDevice(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkDestroyDevice(VkDevice device)
|
||||
void WrappedVulkan::vkDestroyDevice(VkDevice device)
|
||||
{
|
||||
// VKTODOHIGH this stuff should all be in vkDestroyInstance
|
||||
if(m_State >= WRITING)
|
||||
@@ -507,14 +500,12 @@ VkResult WrappedVulkan::vkDestroyDevice(VkDevice device)
|
||||
GetResourceManager()->ReleaseWrappedResource(queues[i]);
|
||||
}
|
||||
|
||||
VkResult ret = ObjDisp(device)->DestroyDevice(Unwrap(device));
|
||||
ObjDisp(device)->DestroyDevice(Unwrap(device));
|
||||
|
||||
// VKTODOLOW on replay we're releasing this after resource manager
|
||||
// shutdown. Yes it's a hack, yes it's ugly.
|
||||
if(m_State >= WRITING)
|
||||
GetResourceManager()->ReleaseWrappedResource(device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkDeviceWaitIdle(Serialiser* localSerialiser, VkDevice device)
|
||||
|
||||
@@ -676,16 +676,14 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage(
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImage image,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rangeCount,
|
||||
const VkImageSubresourceRange* pRanges)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, cmdid, GetResID(cmdBuffer));
|
||||
SERIALISE_ELEMENT(ResourceId, imgid, GetResID(image));
|
||||
SERIALISE_ELEMENT(VkImageLayout, l, imageLayout);
|
||||
SERIALISE_ELEMENT(float, d, depth);
|
||||
SERIALISE_ELEMENT(byte, s, stencil);
|
||||
SERIALISE_ELEMENT(VkClearDepthStencilValue, ds, *pDepthStencil);
|
||||
SERIALISE_ELEMENT(uint32_t, count, rangeCount);
|
||||
SERIALISE_ELEMENT_ARR(VkImageSubresourceRange, ranges, pRanges, count);
|
||||
|
||||
@@ -699,7 +697,7 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage(
|
||||
if(IsPartialCmd(cmdid) && InPartialRange())
|
||||
{
|
||||
cmdBuffer = PartialCmdBuf();
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), l, d, s, count, ranges);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), l, &ds, count, ranges);
|
||||
}
|
||||
}
|
||||
else if(m_State == READING)
|
||||
@@ -707,7 +705,7 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage(
|
||||
cmdBuffer = GetResourceManager()->GetLiveHandle<VkCmdBuffer>(cmdid);
|
||||
image = GetResourceManager()->GetLiveHandle<VkImage>(imgid);
|
||||
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), l, d, s, count, ranges);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), l, &ds, count, ranges);
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY(ranges);
|
||||
@@ -719,12 +717,11 @@ void WrappedVulkan::vkCmdClearDepthStencilImage(
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImage image,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rangeCount,
|
||||
const VkImageSubresourceRange* pRanges)
|
||||
{
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), imageLayout, depth, stencil, rangeCount, pRanges);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilImage(Unwrap(cmdBuffer), Unwrap(image), imageLayout, pDepthStencil, rangeCount, pRanges);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
@@ -733,7 +730,7 @@ void WrappedVulkan::vkCmdClearDepthStencilImage(
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CLEAR_DEPTHSTENCIL);
|
||||
Serialise_vkCmdClearDepthStencilImage(localSerialiser, cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
|
||||
Serialise_vkCmdClearDepthStencilImage(localSerialiser, cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
|
||||
|
||||
record->AddChunk(scope.Get());
|
||||
record->MarkResourceFrameReferenced(GetResID(image), eFrameRef_Write);
|
||||
@@ -825,16 +822,14 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilAttachment(
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImageAspectFlags imageAspectMask,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rectCount,
|
||||
const VkRect3D* pRects)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, cmdid, GetResID(cmdBuffer));
|
||||
SERIALISE_ELEMENT(VkImageAspectFlags, asp, imageAspectMask);
|
||||
SERIALISE_ELEMENT(VkImageLayout, lay, imageLayout);
|
||||
SERIALISE_ELEMENT(float, d, depth);
|
||||
SERIALISE_ELEMENT(byte, s, stencil);
|
||||
SERIALISE_ELEMENT(VkClearDepthStencilValue, ds, *pDepthStencil);
|
||||
SERIALISE_ELEMENT(uint32_t, count, rectCount);
|
||||
SERIALISE_ELEMENT_ARR(VkRect3D, rects, pRects, count);
|
||||
|
||||
@@ -846,22 +841,22 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilAttachment(
|
||||
if(IsPartialCmd(cmdid) && InPartialRange())
|
||||
{
|
||||
cmdBuffer = PartialCmdBuf();
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), asp, lay, d, s, count, rects);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), asp, lay, &ds, count, rects);
|
||||
}
|
||||
}
|
||||
else if(m_State == READING)
|
||||
{
|
||||
cmdBuffer = GetResourceManager()->GetLiveHandle<VkCmdBuffer>(cmdid);
|
||||
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), asp, lay, d, s, count, rects);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), asp, lay, &ds, count, rects);
|
||||
|
||||
const string desc = localSerialiser->GetDebugStr();
|
||||
|
||||
{
|
||||
AddEvent(CLEAR_DEPTHSTENCIL_ATTACH, desc);
|
||||
string name = "vkCmdClearDepthStencilAttachment(" +
|
||||
ToStr::Get(d) + "," +
|
||||
ToStr::Get(s) + ")";
|
||||
ToStr::Get(ds.depth) + "," +
|
||||
ToStr::Get(ds.stencil) + ")";
|
||||
|
||||
FetchDrawcall draw;
|
||||
draw.name = name;
|
||||
@@ -880,12 +875,11 @@ void WrappedVulkan::vkCmdClearDepthStencilAttachment(
|
||||
VkCmdBuffer cmdBuffer,
|
||||
VkImageAspectFlags imageAspectMask,
|
||||
VkImageLayout imageLayout,
|
||||
float depth,
|
||||
uint32_t stencil,
|
||||
const VkClearDepthStencilValue* pDepthStencil,
|
||||
uint32_t rectCount,
|
||||
const VkRect3D* pRects)
|
||||
{
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
|
||||
ObjDisp(cmdBuffer)->CmdClearDepthStencilAttachment(Unwrap(cmdBuffer), imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
@@ -894,7 +888,7 @@ void WrappedVulkan::vkCmdClearDepthStencilAttachment(
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CLEAR_DEPTHSTENCIL_ATTACH);
|
||||
Serialise_vkCmdClearDepthStencilAttachment(localSerialiser, cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
|
||||
Serialise_vkCmdClearDepthStencilAttachment(localSerialiser, cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
|
||||
|
||||
record->AddChunk(scope.Get());
|
||||
// VKTODOHIGH mark referenced the image under the attachment
|
||||
|
||||
@@ -263,7 +263,7 @@ bool WrappedVulkan::Serialise_vkCmdSetBlendConstants(
|
||||
{
|
||||
cmdBuffer = PartialCmdBuf();
|
||||
ObjDisp(cmdBuffer)->CmdSetBlendConstants(Unwrap(cmdBuffer), blendFactor);
|
||||
memcpy(m_PartialReplayData.state.blendConst, blendFactor, sizeof(blendFactor);
|
||||
memcpy(m_PartialReplayData.state.blendConst, blendFactor, sizeof(blendFactor));
|
||||
}
|
||||
}
|
||||
else if(m_State == READING)
|
||||
@@ -288,7 +288,7 @@ void WrappedVulkan::vkCmdSetBlendConstants(
|
||||
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CmdSetBlendConstants);
|
||||
SCOPED_SERIALISE_CONTEXT(SET_BLEND_CONST);
|
||||
Serialise_vkCmdSetBlendConstants(localSerialiser, cmdBuffer, blendConst);
|
||||
|
||||
record->AddChunk(scope.Get());
|
||||
@@ -355,7 +355,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilCompareMask(
|
||||
uint32_t stencilCompareMask)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, cmdid, GetResID(cmdBuffer));
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagsBits, face, faceMask);
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagBits, face, (VkStencilFaceFlagBits)faceMask);
|
||||
SERIALISE_ELEMENT(uint32_t, mask, stencilCompareMask);
|
||||
|
||||
if(m_State < WRITING)
|
||||
@@ -411,7 +411,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilWriteMask(
|
||||
uint32_t stencilWriteMask)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, cmdid, GetResID(cmdBuffer));
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagsBits, face, faceMask);
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagBits, face, (VkStencilFaceFlagBits)faceMask);
|
||||
SERIALISE_ELEMENT(uint32_t, mask, stencilWriteMask);
|
||||
|
||||
if(m_State < WRITING)
|
||||
@@ -467,7 +467,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilReference(
|
||||
uint32_t stencilReference)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, cmdid, GetResID(cmdBuffer));
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagsBits, face, faceMask);
|
||||
SERIALISE_ELEMENT(VkStencilFaceFlagBits, face, (VkStencilFaceFlagBits)faceMask);
|
||||
SERIALISE_ELEMENT(uint32_t, mask, stencilReference);
|
||||
|
||||
if(m_State < WRITING)
|
||||
|
||||
@@ -45,16 +45,10 @@ VkResult WrappedVulkan::vkGetPhysicalDeviceImageFormatProperties(
|
||||
VkImageType type,
|
||||
VkImageTiling tiling,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageCreateFlags flags,
|
||||
VkImageFormatProperties* pImageFormatProperties)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceImageFormatProperties(Unwrap(physicalDevice), format, type, tiling, usage, pImageFormatProperties);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceLimits(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceLimits* pLimits)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceLimits(Unwrap(physicalDevice), pLimits);
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceImageFormatProperties(Unwrap(physicalDevice), format, type, tiling, usage, flags, pImageFormatProperties);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceProperties(
|
||||
@@ -70,19 +64,12 @@ VkResult WrappedVulkan::vkGetPhysicalDeviceProperties(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceQueueCount(
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceQueueFamilyProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t* pCount)
|
||||
uint32_t* pCount,
|
||||
VkQueueFamilyProperties* pQueueFamilyProperties)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceQueueCount(Unwrap(physicalDevice), pCount);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceQueueProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t count,
|
||||
VkPhysicalDeviceQueueProperties* pQueueProperties)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceQueueProperties(Unwrap(physicalDevice), count, pQueueProperties);
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(physicalDevice), pCount, pQueueFamilyProperties);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceMemoryProperties(
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
// that same handle could be returned by create on another thread, and we
|
||||
// could end up trying to re-wrap it.
|
||||
#define DESTROY_IMPL(type, func) \
|
||||
VkResult WrappedVulkan::vk ## func(VkDevice device, type obj) \
|
||||
void WrappedVulkan::vk ## func(VkDevice device, type obj) \
|
||||
{ \
|
||||
if(m_ImageInfo.find(GetResID(obj)) != m_ImageInfo.end()) m_ImageInfo.erase(GetResID(obj)); \
|
||||
type unwrappedObj = Unwrap(obj); \
|
||||
if(GetResourceManager()->HasWrapper(ToTypedHandle(unwrappedObj))) GetResourceManager()->ReleaseWrappedResource(obj, true); \
|
||||
return ObjDisp(device)->func(Unwrap(device), unwrappedObj); \
|
||||
ObjDisp(device)->func(Unwrap(device), unwrappedObj); \
|
||||
}
|
||||
|
||||
DESTROY_IMPL(VkBuffer, DestroyBuffer)
|
||||
@@ -55,12 +55,20 @@ DESTROY_IMPL(VkCmdPool, DestroyCommandPool)
|
||||
DESTROY_IMPL(VkQueryPool, DestroyQueryPool)
|
||||
DESTROY_IMPL(VkFramebuffer, DestroyFramebuffer)
|
||||
DESTROY_IMPL(VkRenderPass, DestroyRenderPass)
|
||||
DESTROY_IMPL(VkSwapChainWSI, DestroySwapChainWSI)
|
||||
|
||||
#undef DESTROY_IMPL
|
||||
|
||||
// needs to be separate because it returns VkResult still
|
||||
VkResult WrappedVulkan::vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR obj)
|
||||
{
|
||||
if(m_ImageInfo.find(GetResID(obj)) != m_ImageInfo.end()) m_ImageInfo.erase(GetResID(obj));
|
||||
VkSwapchainKHR unwrappedObj = Unwrap(obj);
|
||||
if(GetResourceManager()->HasWrapper(ToTypedHandle(unwrappedObj))) GetResourceManager()->ReleaseWrappedResource(obj, true);
|
||||
return ObjDisp(device)->DestroySwapchainKHR(Unwrap(device), unwrappedObj);
|
||||
}
|
||||
|
||||
// needs to be separate since it's dispatchable
|
||||
VkResult WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
|
||||
void WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
|
||||
{
|
||||
WrappedVkDispRes *wrapped = (WrappedVkDispRes *)GetWrapped(obj);
|
||||
|
||||
@@ -74,11 +82,12 @@ VkResult WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
|
||||
wrapped->record->Delete(GetResourceManager());
|
||||
wrapped->record = NULL;
|
||||
}
|
||||
VkResult ret = ObjDisp(device)->DestroyCommandBuffer(Unwrap(device), wrapped->real.As<VkCmdBuffer>());
|
||||
|
||||
VkCmdBuffer unwrapped = wrapped->real.As<VkCmdBuffer>();
|
||||
|
||||
GetResourceManager()->ReleaseWrappedResource(obj);
|
||||
|
||||
return ret;
|
||||
ObjDisp(device)->DestroyCommandBuffer(Unwrap(device), unwrapped);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::ReleaseResource(WrappedVkRes *res)
|
||||
@@ -102,7 +111,7 @@ bool WrappedVulkan::ReleaseResource(WrappedVkRes *res)
|
||||
|
||||
switch(IdentifyTypeByPtr(res))
|
||||
{
|
||||
case eResWSISwapChain:
|
||||
case eResSwapchain:
|
||||
RDCERR("Should be no swapchain objects created on replay");
|
||||
break;
|
||||
|
||||
@@ -530,7 +539,7 @@ VkResult WrappedVulkan::vkCreateFramebuffer(
|
||||
record->AddParent(GetRecord(pCreateInfo->renderPass));
|
||||
for(uint32_t i=0; i < pCreateInfo->attachmentCount; i++)
|
||||
{
|
||||
record->AddParent(GetRecord(pCreateInfo->pAttachments[i].view));
|
||||
record->AddParent(GetRecord(pCreateInfo->pAttachments[i]));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -111,7 +111,7 @@ VkResult WrappedVulkan::vkAllocMemory(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkFreeMemory(
|
||||
void WrappedVulkan::vkFreeMemory(
|
||||
VkDevice device,
|
||||
VkDeviceMemory mem)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ VkResult WrappedVulkan::vkFreeMemory(
|
||||
|
||||
GetResourceManager()->ReleaseWrappedResource(mem);
|
||||
|
||||
return ObjDisp(device)->FreeMemory(Unwrap(device), unwrappedMem);
|
||||
ObjDisp(device)->FreeMemory(Unwrap(device), unwrappedMem);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkMapMemory(
|
||||
@@ -207,10 +207,7 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(
|
||||
{
|
||||
memcpy((byte *)mapPtr+memOffset, data, (size_t)memSize);
|
||||
|
||||
ret = ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
RDCERR("Error unmapping memory on replay: 0x%08x", ret);
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY(data);
|
||||
@@ -219,11 +216,11 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkUnmapMemory(
|
||||
void WrappedVulkan::vkUnmapMemory(
|
||||
VkDevice device,
|
||||
VkDeviceMemory mem)
|
||||
{
|
||||
VkResult ret = ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
@@ -238,7 +235,7 @@ VkResult WrappedVulkan::vkUnmapMemory(
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ret == VK_SUCCESS && m_State >= WRITING_CAPFRAME)
|
||||
if(m_State >= WRITING_CAPFRAME)
|
||||
{
|
||||
if(!it->second.mapFlushed)
|
||||
{
|
||||
@@ -275,8 +272,6 @@ VkResult WrappedVulkan::vkUnmapMemory(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(
|
||||
@@ -321,10 +316,7 @@ bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(
|
||||
{
|
||||
memcpy((byte *)mapPtr+memOffset, data, (size_t)memSize);
|
||||
|
||||
ret = ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
RDCERR("Error unmapping memory on replay: 0x%08x", ret);
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), Unwrap(mem));
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY(data);
|
||||
@@ -515,8 +507,7 @@ bool WrappedVulkan::Serialise_vkCreateBuffer(
|
||||
VkBuffer buf = VK_NULL_HANDLE;
|
||||
|
||||
// ensure we can always readback from buffers
|
||||
if(info.usage != VK_BUFFER_USAGE_GENERAL)
|
||||
info.usage |= VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT;
|
||||
info.usage |= VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT;
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateBuffer(Unwrap(device), &info, &buf);
|
||||
|
||||
@@ -676,7 +667,7 @@ bool WrappedVulkan::Serialise_vkCreateImage(
|
||||
m_ImageInfo[live].arraySize = info.arraySize;
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArraySlice = 0;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
range.mipLevels = info.mipLevels;
|
||||
range.arraySize = info.arraySize;
|
||||
if(info.imageType == VK_IMAGE_TYPE_3D)
|
||||
@@ -686,12 +677,12 @@ bool WrappedVulkan::Serialise_vkCreateImage(
|
||||
|
||||
if(!IsDepthStencilFormat(info.format))
|
||||
{
|
||||
range.aspect = VK_IMAGE_ASPECT_COLOR; m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
}
|
||||
else
|
||||
{
|
||||
range.aspect = VK_IMAGE_ASPECT_DEPTH; m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspect = VK_IMAGE_ASPECT_STENCIL;m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;m_ImageInfo[live].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -738,7 +729,7 @@ VkResult WrappedVulkan::vkCreateImage(
|
||||
m_ImageInfo[id].arraySize = pCreateInfo->arraySize;
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArraySlice = 0;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
range.mipLevels = pCreateInfo->mipLevels;
|
||||
range.arraySize = pCreateInfo->arraySize;
|
||||
if(pCreateInfo->imageType == VK_IMAGE_TYPE_3D)
|
||||
@@ -748,12 +739,12 @@ VkResult WrappedVulkan::vkCreateImage(
|
||||
|
||||
if(!IsDepthStencilFormat(pCreateInfo->format))
|
||||
{
|
||||
range.aspect = VK_IMAGE_ASPECT_COLOR; m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
}
|
||||
else
|
||||
{
|
||||
range.aspect = VK_IMAGE_ASPECT_DEPTH; m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspect = VK_IMAGE_ASPECT_STENCIL;m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
range.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;m_ImageInfo[id].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,43 +40,52 @@ namespace Keyboard { void UseConnection(xcb_connection_t *conn); }
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
// WSI extension
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceSurfaceSupportWSI(
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceSurfaceSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
const VkSurfaceDescriptionWSI* pSurfaceDescription,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
VkBool32* pSupported)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceSurfaceSupportWSI(Unwrap(physicalDevice), queueFamilyIndex, pSurfaceDescription, pSupported);
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceSurfaceSupportKHR(Unwrap(physicalDevice), queueFamilyIndex, pSurfaceDescription, pSupported);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetSurfaceInfoWSI(
|
||||
VkResult WrappedVulkan::vkGetSurfacePropertiesKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionWSI* pSurfaceDescription,
|
||||
VkSurfaceInfoTypeWSI infoType,
|
||||
size_t* pDataSize,
|
||||
void* pData)
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
VkSurfacePropertiesKHR* pSurfaceProperties)
|
||||
{
|
||||
return ObjDisp(device)->GetSurfaceInfoWSI(Unwrap(device), pSurfaceDescription, infoType, pDataSize, pData);
|
||||
return ObjDisp(device)->GetSurfacePropertiesKHR(Unwrap(device), pSurfaceDescription, pSurfaceProperties);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkGetSwapChainInfoWSI(
|
||||
VkResult WrappedVulkan::vkGetSurfaceFormatsKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkSurfaceFormatKHR* pSurfaceFormats)
|
||||
{
|
||||
return ObjDisp(device)->GetSurfaceFormatsKHR(Unwrap(device), pSurfaceDescription, pCount, pSurfaceFormats);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetSurfacePresentModesKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkPresentModeKHR* pPresentModes)
|
||||
{
|
||||
return ObjDisp(device)->GetSurfacePresentModesKHR(Unwrap(device), pSurfaceDescription, pCount, pPresentModes);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkGetSwapchainImagesKHR(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain,
|
||||
VkSwapChainInfoTypeWSI infoType,
|
||||
size_t* pDataSize,
|
||||
void* pData)
|
||||
VkSwapchainKHR swapchain,
|
||||
uint32_t* pCount,
|
||||
VkImage* pSwapchainImages)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(ResourceId, swapId, GetResID(swapChain));
|
||||
VkSwapChainImagePropertiesWSI *image = (VkSwapChainImagePropertiesWSI *)pData;
|
||||
SERIALISE_ELEMENT(size_t, idx, *pDataSize);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(image->image));
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
RDCASSERT(infoType == VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI);
|
||||
}
|
||||
SERIALISE_ELEMENT(ResourceId, swapId, GetResID(swapchain));
|
||||
SERIALISE_ELEMENT(uint32_t, idx, *pCount);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pSwapchainImages));
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
@@ -88,36 +97,34 @@ bool WrappedVulkan::Serialise_vkGetSwapChainInfoWSI(
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetSwapChainInfoWSI(
|
||||
VkResult WrappedVulkan::vkGetSwapchainImagesKHR(
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain,
|
||||
VkSwapChainInfoTypeWSI infoType,
|
||||
size_t* pDataSize,
|
||||
void* pData)
|
||||
VkSwapchainKHR swapchain,
|
||||
uint32_t* pCount,
|
||||
VkImage* pSwapchainImages)
|
||||
{
|
||||
// make sure we always get the size
|
||||
size_t dummySize = 0;
|
||||
if(pDataSize == NULL)
|
||||
pDataSize = &dummySize;
|
||||
uint32_t dummySize = 0;
|
||||
if(pCount == NULL)
|
||||
pCount = &dummySize;
|
||||
|
||||
VkResult ret = ObjDisp(device)->GetSwapChainInfoWSI(Unwrap(device), Unwrap(swapChain), infoType, pDataSize, pData);
|
||||
VkResult ret = ObjDisp(device)->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swapchain), pCount, pSwapchainImages);
|
||||
|
||||
if(infoType == VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI && pData && m_State >= WRITING)
|
||||
if(pSwapchainImages && m_State >= WRITING)
|
||||
{
|
||||
VkSwapChainImagePropertiesWSI *images = (VkSwapChainImagePropertiesWSI *)pData;
|
||||
size_t numImages = (*pDataSize)/sizeof(VkSwapChainImagePropertiesWSI);
|
||||
uint32_t numImages = *pCount;
|
||||
|
||||
for(size_t i=0; i < numImages; i++)
|
||||
for(uint32_t i=0; i < numImages; i++)
|
||||
{
|
||||
// these were all wrapped and serialised on swapchain create - we just have to
|
||||
// return the wrapped image in that case
|
||||
if(GetResourceManager()->HasWrapper(ToTypedHandle(images[i].image)))
|
||||
if(GetResourceManager()->HasWrapper(ToTypedHandle(pSwapchainImages[i])))
|
||||
{
|
||||
images[i].image = (VkImage)(uint64_t)GetResourceManager()->GetWrapper(ToTypedHandle(images[i].image));
|
||||
pSwapchainImages[i] = (VkImage)(uint64_t)GetResourceManager()->GetWrapper(ToTypedHandle(pSwapchainImages[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), images[i].image);
|
||||
ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), pSwapchainImages[i]);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
@@ -126,19 +133,19 @@ VkResult WrappedVulkan::vkGetSwapChainInfoWSI(
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(PRESENT_IMAGE);
|
||||
Serialise_vkGetSwapChainInfoWSI(localSerialiser, device, swapChain, infoType, &i, (void *)&images[i]);
|
||||
SCOPED_SERIALISE_CONTEXT(GET_SWAPCHAIN_IMAGE);
|
||||
Serialise_vkGetSwapchainImagesKHR(localSerialiser, device, swapchain, &i, &pSwapchainImages[i]);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(images[i].image);
|
||||
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pSwapchainImages[i]);
|
||||
record->AddChunk(chunk);
|
||||
|
||||
// we invert the usual scheme - we make the swapchain record take parent refs
|
||||
// on these images, so that we can just ref the swapchain on present and pull
|
||||
// in all the images
|
||||
VkResourceRecord *swaprecord = GetRecord(swapChain);
|
||||
VkResourceRecord *swaprecord = GetRecord(swapchain);
|
||||
|
||||
swaprecord->AddParent(record);
|
||||
// decrement refcount on swap images, so that they are only ref'd from the swapchain
|
||||
@@ -147,7 +154,7 @@ VkResult WrappedVulkan::vkGetSwapChainInfoWSI(
|
||||
}
|
||||
else
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, images[i].image);
|
||||
GetResourceManager()->AddLiveResource(id, pSwapchainImages[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,36 +163,36 @@ VkResult WrappedVulkan::vkGetSwapChainInfoWSI(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkAcquireNextImageWSI(
|
||||
VkResult WrappedVulkan::vkAcquireNextImageKHR(
|
||||
VkDevice device,
|
||||
VkSwapChainWSI swapChain,
|
||||
VkSwapchainKHR swapChain,
|
||||
uint64_t timeout,
|
||||
VkSemaphore semaphore,
|
||||
uint32_t* pImageIndex)
|
||||
{
|
||||
// VKTODOLOW: does this need to be intercepted/serialised?
|
||||
return ObjDisp(device)->AcquireNextImageWSI(Unwrap(device), Unwrap(swapChain), timeout, Unwrap(semaphore), pImageIndex);
|
||||
return ObjDisp(device)->AcquireNextImageKHR(Unwrap(device), Unwrap(swapChain), timeout, Unwrap(semaphore), pImageIndex);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkCreateSwapChainWSI(
|
||||
bool WrappedVulkan::Serialise_vkCreateSwapchainKHR(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
const VkSwapChainCreateInfoWSI* pCreateInfo,
|
||||
VkSwapChainWSI* pSwapChain)
|
||||
const VkSwapchainCreateInfoKHR* pCreateInfo,
|
||||
VkSwapchainKHR* pSwapChain)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(VkSwapChainCreateInfoWSI, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(VkSwapchainCreateInfoKHR, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pSwapChain));
|
||||
|
||||
// VKTODOLOW this should be tidied away
|
||||
#if defined(LINUX)
|
||||
if(pCreateInfo && pCreateInfo->pSurfaceDescription)
|
||||
{
|
||||
VkSurfaceDescriptionWindowWSI *surf = (VkSurfaceDescriptionWindowWSI*)pCreateInfo->pSurfaceDescription;
|
||||
VkSurfaceDescriptionWindowKHR *surf = (VkSurfaceDescriptionWindowKHR*)pCreateInfo->pSurfaceDescription;
|
||||
|
||||
if(surf->platform == VK_PLATFORM_XCB_WSI)
|
||||
if(surf->platform == VK_PLATFORM_XCB_KHR)
|
||||
{
|
||||
VkPlatformHandleXcbWSI *handle = (VkPlatformHandleXcbWSI *)surf->pPlatformHandle;
|
||||
VkPlatformHandleXcbKHR *handle = (VkPlatformHandleXcbKHR *)surf->pPlatformHandle;
|
||||
Keyboard::UseConnection(handle->connection);
|
||||
}
|
||||
}
|
||||
@@ -197,11 +204,8 @@ bool WrappedVulkan::Serialise_vkCreateSwapChainWSI(
|
||||
{
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
|
||||
size_t swapChainImagesSize;
|
||||
vkr = ObjDisp(device)->GetSwapChainInfoWSI(Unwrap(device), Unwrap(*pSwapChain), VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI, &swapChainImagesSize, NULL);
|
||||
vkr = ObjDisp(device)->GetSwapchainImagesKHR(Unwrap(device), Unwrap(*pSwapChain), &numIms, NULL);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
numIms = uint32_t(swapChainImagesSize/sizeof(VkSwapChainImagePropertiesWSI));
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT(uint32_t, numSwapImages, numIms);
|
||||
@@ -285,10 +289,10 @@ bool WrappedVulkan::Serialise_vkCreateSwapChainWSI(
|
||||
m_ImageInfo[liveId].arraySize = info.imageArraySize;
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArraySlice = 0;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
range.mipLevels = 1;
|
||||
range.arraySize = info.imageArraySize;
|
||||
range.aspect = VK_IMAGE_ASPECT_COLOR;
|
||||
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
|
||||
m_ImageInfo[liveId].subresourceStates.clear();
|
||||
m_ImageInfo[liveId].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
@@ -298,12 +302,12 @@ bool WrappedVulkan::Serialise_vkCreateSwapChainWSI(
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
VkResult WrappedVulkan::vkCreateSwapchainKHR(
|
||||
VkDevice device,
|
||||
const VkSwapChainCreateInfoWSI* pCreateInfo,
|
||||
VkSwapChainWSI* pSwapChain)
|
||||
const VkSwapchainCreateInfoKHR* pCreateInfo,
|
||||
VkSwapchainKHR* pSwapChain)
|
||||
{
|
||||
VkResult ret = ObjDisp(device)->CreateSwapChainWSI(Unwrap(device), pCreateInfo, pSwapChain);
|
||||
VkResult ret = ObjDisp(device)->CreateSwapchainKHR(Unwrap(device), pCreateInfo, pSwapChain);
|
||||
|
||||
if(ret == VK_SUCCESS)
|
||||
{
|
||||
@@ -317,7 +321,7 @@ VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CREATE_SWAP_BUFFER);
|
||||
Serialise_vkCreateSwapChainWSI(localSerialiser, device, pCreateInfo, pSwapChain);
|
||||
Serialise_vkCreateSwapchainKHR(localSerialiser, device, pCreateInfo, pSwapChain);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
@@ -373,16 +377,14 @@ VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
|
||||
// serialise out the swap chain images
|
||||
{
|
||||
size_t swapChainImagesSize;
|
||||
VkResult ret = vt->GetSwapChainInfoWSI(Unwrap(device), Unwrap(*pSwapChain), VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI, &swapChainImagesSize, NULL);
|
||||
uint32_t numSwapImages;
|
||||
VkResult ret = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(*pSwapChain), &numSwapImages, NULL);
|
||||
RDCASSERT(ret == VK_SUCCESS);
|
||||
|
||||
uint32_t numSwapImages = uint32_t(swapChainImagesSize)/sizeof(VkSwapChainImagePropertiesWSI);
|
||||
|
||||
VkSwapChainImagePropertiesWSI* images = new VkSwapChainImagePropertiesWSI[numSwapImages];
|
||||
VkImage* images = new VkImage[numSwapImages];
|
||||
|
||||
// go through our own function so we assign these images IDs
|
||||
ret = vkGetSwapChainInfoWSI(device, *pSwapChain, VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI, &swapChainImagesSize, images);
|
||||
ret = vkGetSwapchainImagesKHR(device, *pSwapChain, &numSwapImages, images);
|
||||
RDCASSERT(ret == VK_SUCCESS);
|
||||
|
||||
for(uint32_t i=0; i < numSwapImages; i++)
|
||||
@@ -391,9 +393,9 @@ VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
|
||||
// memory doesn't exist for genuine WSI created images
|
||||
swapImInfo.mem = VK_NULL_HANDLE;
|
||||
swapImInfo.im = images[i].image;
|
||||
swapImInfo.im = images[i];
|
||||
|
||||
ResourceId imid = GetResID(images[i].image);
|
||||
ResourceId imid = GetResID(images[i]);
|
||||
|
||||
// fill out image info so we track resource state transitions
|
||||
m_ImageInfo[imid].type = VK_IMAGE_TYPE_2D;
|
||||
@@ -405,18 +407,18 @@ VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
m_ImageInfo[imid].arraySize = pCreateInfo->imageArraySize;
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArraySlice = 0;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
range.mipLevels = 1;
|
||||
range.arraySize = pCreateInfo->imageArraySize;
|
||||
range.aspect = VK_IMAGE_ASPECT_COLOR;
|
||||
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
|
||||
m_ImageInfo[imid].subresourceStates.clear();
|
||||
m_ImageInfo[imid].subresourceStates.push_back(ImageRegionState(range, UNTRANSITIONED_IMG_STATE, VK_IMAGE_LAYOUT_UNDEFINED));
|
||||
|
||||
{
|
||||
VkImageViewCreateInfo info = {
|
||||
VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO, NULL,
|
||||
Unwrap(images[i].image), VK_IMAGE_VIEW_TYPE_2D,
|
||||
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, NULL,
|
||||
Unwrap(images[i]), VK_IMAGE_VIEW_TYPE_2D,
|
||||
pCreateInfo->imageFormat,
|
||||
{ VK_CHANNEL_SWIZZLE_R, VK_CHANNEL_SWIZZLE_G, VK_CHANNEL_SWIZZLE_B, VK_CHANNEL_SWIZZLE_A },
|
||||
{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 },
|
||||
@@ -454,13 +456,10 @@ VkResult WrappedVulkan::vkCreateSwapChainWSI(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
VkResult WrappedVulkan::vkQueuePresentKHR(
|
||||
VkQueue queue,
|
||||
VkPresentInfoWSI* pPresentInfo)
|
||||
VkPresentInfoKHR* pPresentInfo)
|
||||
{
|
||||
if(pPresentInfo->swapChainCount == 0)
|
||||
return VK_ERROR_INVALID_VALUE;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_Vulkan);
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
@@ -468,7 +467,7 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
|
||||
m_FrameCounter++; // first present becomes frame #1, this function is at the end of the frame
|
||||
|
||||
if(pPresentInfo->swapChainCount > 1 && (m_FrameCounter % 100) == 0)
|
||||
if(pPresentInfo->swapchainCount > 1 && (m_FrameCounter % 100) == 0)
|
||||
{
|
||||
RDCWARN("Presenting multiple swapchains at once - only first will be processed");
|
||||
}
|
||||
@@ -476,7 +475,7 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
// VKTODOLOW handle present info pNext
|
||||
RDCASSERT(pPresentInfo->pNext == NULL);
|
||||
|
||||
ResourceId swapid = GetResID(pPresentInfo->swapChains[0]);
|
||||
ResourceId swapid = GetResID(pPresentInfo->swapchains[0]);
|
||||
|
||||
const SwapInfo &swapInfo = m_SwapChainInfo[swapid];
|
||||
|
||||
@@ -529,7 +528,7 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
|
||||
vt->QueueWaitIdle(Unwrap(q));
|
||||
|
||||
TextPrintState textstate = { q, GetCmd(), rp, fb, vp, swapInfo.extent.width, swapInfo.extent.height };
|
||||
TextPrintState textstate = { q, GetCmd(), rp, fb, swapInfo.extent.width, swapInfo.extent.height };
|
||||
|
||||
if(activeWindow)
|
||||
{
|
||||
@@ -697,15 +696,17 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VkImageCopy cpy = {
|
||||
subr, { 0, 0, 0 },
|
||||
subr, { 0, 0, 0 },
|
||||
{ VK_IMAGE_ASPECT_COLOR, 0, 0, 1 },
|
||||
{ 0, 0, 0 },
|
||||
{ VK_IMAGE_ASPECT_COLOR, 0, 0, 1 },
|
||||
{ 0, 0, 0 },
|
||||
{ imInfo.extent.width, imInfo.extent.height, 1 },
|
||||
};
|
||||
|
||||
// VKTODOLOW back buffer must be in this layout right?
|
||||
VkImageMemoryBarrier bbTrans = {
|
||||
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
|
||||
0, 0, VK_IMAGE_LAYOUT_PRESENT_SOURCE_WSI, VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL,
|
||||
0, 0, VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR, VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL,
|
||||
0, 0, Unwrap(backbuffer),
|
||||
{ VK_IMAGE_ASPECT_COLOR, 0, 1, 0, 1 } };
|
||||
|
||||
@@ -838,14 +839,11 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
}
|
||||
}
|
||||
|
||||
vkr = vt->UnmapMemory(Unwrap(dev), readbackMem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->UnmapMemory(Unwrap(dev), readbackMem);
|
||||
|
||||
// delete all
|
||||
vkr = vt->DestroyImage(Unwrap(dev), readbackIm);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vkr = vt->FreeMemory(Unwrap(dev), readbackMem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
vt->DestroyImage(Unwrap(dev), readbackIm);
|
||||
vt->FreeMemory(Unwrap(dev), readbackMem);
|
||||
}
|
||||
|
||||
byte *jpgbuf = NULL;
|
||||
@@ -968,14 +966,14 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
|
||||
RDCLOG("Starting capture, frame %u", m_FrameCounter);
|
||||
}
|
||||
|
||||
vector<VkSwapChainWSI> unwrappedSwaps;
|
||||
vector<VkSwapchainKHR> unwrappedSwaps;
|
||||
|
||||
VkPresentInfoWSI unwrappedInfo = *pPresentInfo;
|
||||
VkPresentInfoKHR unwrappedInfo = *pPresentInfo;
|
||||
|
||||
for(uint32_t i=0; i < unwrappedInfo.swapChainCount; i++)
|
||||
unwrappedSwaps.push_back(Unwrap(unwrappedInfo.swapChains[i]));
|
||||
for(uint32_t i=0; i < unwrappedInfo.swapchainCount; i++)
|
||||
unwrappedSwaps.push_back(Unwrap(unwrappedInfo.swapchains[i]));
|
||||
|
||||
unwrappedInfo.swapChains = &unwrappedSwaps.front();
|
||||
unwrappedInfo.swapchains = &unwrappedSwaps.front();
|
||||
|
||||
return ObjDisp(queue)->QueuePresentWSI(Unwrap(queue), &unwrappedInfo);
|
||||
return ObjDisp(queue)->QueuePresentKHR(Unwrap(queue), &unwrappedInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user