@@ -61,7 +61,6 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
|
||||
if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT)
|
||||
{
|
||||
msgPrefix = TEXT("ERROR");
|
||||
|
||||
if (!StringUtils::Compare(layerPrefix, "SC"))
|
||||
{
|
||||
if (msgCode == 3)
|
||||
@@ -79,7 +78,6 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
|
||||
else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT)
|
||||
{
|
||||
msgPrefix = TEXT("WARN");
|
||||
|
||||
if (!StringUtils::Compare(layerPrefix, "SC"))
|
||||
{
|
||||
if (msgCode == 2)
|
||||
@@ -92,7 +90,6 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
|
||||
else if (msgFlags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT)
|
||||
{
|
||||
msgPrefix = TEXT("PERF");
|
||||
|
||||
if (!StringUtils::Compare(layerPrefix, "SC"))
|
||||
{
|
||||
if (msgCode == 2)
|
||||
@@ -118,14 +115,8 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
|
||||
{
|
||||
msgPrefix = TEXT("DEBUG");
|
||||
}
|
||||
else
|
||||
{
|
||||
CRASH;
|
||||
}
|
||||
|
||||
// Send info
|
||||
LOG(Info, "[Vulkan] {0}:{1}:{2} {3}", msgPrefix, String(layerPrefix), msgCode, String(msg));
|
||||
|
||||
return VK_FALSE;
|
||||
}
|
||||
|
||||
@@ -147,6 +138,9 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugUtilsCallback(VkDebugUtilsMessageSever
|
||||
case 5: // SPIR-V module not valid: MemoryBarrier: Vulkan specification requires Memory Semantics to have one of the following bits set: Acquire, Release, AcquireRelease or SequentiallyConsistent
|
||||
case -1666394502: // After query pool creation, each query must be reset before it is used. Queries must also be reset between uses.
|
||||
case 602160055: // Attachment 4 not written by fragment shader; undefined values will be written to attachment. TODO: investigate it for PS_GBuffer shader from Deferred material with USE_LIGHTMAP=1
|
||||
case 7060244: // Image Operand Offset can only be used with OpImage*Gather operations
|
||||
case -1539028524: // SortedIndices is null so Vulkan backend sets it to default R32_SFLOAT format which is not good for UINT format of the buffer
|
||||
case -1810835948: // SortedIndices is null so Vulkan backend sets it to default R32_SFLOAT format which is not good for UINT format of the buffer
|
||||
return VK_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -214,15 +208,10 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugUtilsCallback(VkDebugUtilsMessageSever
|
||||
type = TEXT("Perf");
|
||||
}
|
||||
|
||||
// Send info
|
||||
if (callbackData->pMessageIdName)
|
||||
{
|
||||
LOG(Info, "[Vulkan] {0} {1}:{2}({3}) {4}", type, severity, callbackData->messageIdNumber, String(callbackData->pMessageIdName), String(callbackData->pMessage));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(Info, "[Vulkan] {0} {1}:{2} {3}", type, severity, callbackData->messageIdNumber, String(callbackData->pMessage));
|
||||
}
|
||||
|
||||
return VK_FALSE;
|
||||
}
|
||||
@@ -440,10 +429,11 @@ uint32 GetHash(const RenderTargetLayoutVulkan& key)
|
||||
CombineHash(hash, (uint32)key.WriteDepth);
|
||||
CombineHash(hash, (uint32)key.DepthFormat * 93473262);
|
||||
CombineHash(hash, key.RTsCount * 136);
|
||||
CombineHash(hash, key.Extent.width);
|
||||
CombineHash(hash, key.Extent.height);
|
||||
CombineHash(hash, key.Layers);
|
||||
for (int32 i = 0; i < ARRAY_COUNT(key.RTVsFormats); i++)
|
||||
{
|
||||
CombineHash(hash, (uint32)key.RTVsFormats[i]);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -452,13 +442,11 @@ uint32 GetHash(const FramebufferVulkan::Key& key)
|
||||
uint32 hash = (int32)(intptr)key.RenderPass;
|
||||
CombineHash(hash, (uint32)key.AttachmentCount * 136);
|
||||
for (int32 i = 0; i < ARRAY_COUNT(key.Attachments); i++)
|
||||
{
|
||||
CombineHash(hash, (uint32)(intptr)key.Attachments[i]);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
FramebufferVulkan::FramebufferVulkan(GPUDeviceVulkan* device, Key& key, VkExtent3D& extent, uint32 layers)
|
||||
FramebufferVulkan::FramebufferVulkan(GPUDeviceVulkan* device, Key& key, VkExtent2D& extent, uint32 layers)
|
||||
: _device(device)
|
||||
, _handle(VK_NULL_HANDLE)
|
||||
, Extent(extent)
|
||||
@@ -1271,33 +1259,23 @@ GPUDeviceVulkan::~GPUDeviceVulkan()
|
||||
|
||||
RenderPassVulkan* GPUDeviceVulkan::GetOrCreateRenderPass(RenderTargetLayoutVulkan& layout)
|
||||
{
|
||||
// Try reuse cached version
|
||||
RenderPassVulkan* renderPass;
|
||||
if (_renderPasses.TryGet(layout, renderPass))
|
||||
{
|
||||
return renderPass;
|
||||
}
|
||||
|
||||
PROFILE_CPU_NAMED("Create Render Pass");
|
||||
|
||||
// Create object and cache it
|
||||
renderPass = New<RenderPassVulkan>(this, layout);
|
||||
_renderPasses.Add(layout, renderPass);
|
||||
return renderPass;
|
||||
}
|
||||
|
||||
FramebufferVulkan* GPUDeviceVulkan::GetOrCreateFramebuffer(FramebufferVulkan::Key& key, VkExtent3D& extent, uint32 layers)
|
||||
FramebufferVulkan* GPUDeviceVulkan::GetOrCreateFramebuffer(FramebufferVulkan::Key& key, VkExtent2D& extent, uint32 layers)
|
||||
{
|
||||
// Try reuse cached version
|
||||
FramebufferVulkan* framebuffer;
|
||||
if (_framebuffers.TryGet(key, framebuffer))
|
||||
{
|
||||
return framebuffer;
|
||||
}
|
||||
|
||||
PROFILE_CPU_NAMED("Create Framebuffer");
|
||||
|
||||
// Create object and cache it
|
||||
framebuffer = New<FramebufferVulkan>(this, key, extent, layers);
|
||||
_framebuffers.Add(key, framebuffer);
|
||||
return framebuffer;
|
||||
@@ -1305,16 +1283,11 @@ FramebufferVulkan* GPUDeviceVulkan::GetOrCreateFramebuffer(FramebufferVulkan::Ke
|
||||
|
||||
PipelineLayoutVulkan* GPUDeviceVulkan::GetOrCreateLayout(DescriptorSetLayoutInfoVulkan& key)
|
||||
{
|
||||
// Try reuse cached version
|
||||
PipelineLayoutVulkan* layout;
|
||||
if (_layouts.TryGet(key, layout))
|
||||
{
|
||||
return layout;
|
||||
}
|
||||
|
||||
PROFILE_CPU_NAMED("Create Pipeline Layout");
|
||||
|
||||
// Create object and cache it
|
||||
layout = New<PipelineLayoutVulkan>(this, key);
|
||||
_layouts.Add(key, layout);
|
||||
return layout;
|
||||
@@ -1698,7 +1671,11 @@ bool GPUDeviceVulkan::Init()
|
||||
auto& limits = Limits;
|
||||
limits.HasCompute = GetShaderProfile() == ShaderProfile::Vulkan_SM5 && PhysicalDeviceLimits.maxComputeWorkGroupCount[0] >= GPU_MAX_CS_DISPATCH_THREAD_GROUPS && PhysicalDeviceLimits.maxComputeWorkGroupCount[1] >= GPU_MAX_CS_DISPATCH_THREAD_GROUPS;
|
||||
limits.HasTessellation = !!PhysicalDeviceFeatures.tessellationShader && PhysicalDeviceLimits.maxBoundDescriptorSets > (uint32_t)DescriptorSet::Domain;
|
||||
limits.HasGeometryShaders = false; // TODO: add geometry shaders support for Vulkan
|
||||
#if PLATFORM_ANDROID
|
||||
limits.HasGeometryShaders = false; // Don't even try GS on mobile
|
||||
#else
|
||||
limits.HasGeometryShaders = !!PhysicalDeviceFeatures.geometryShader;
|
||||
#endif
|
||||
limits.HasInstancing = true;
|
||||
limits.HasVolumeTextureRendering = true;
|
||||
limits.HasDrawIndirect = PhysicalDeviceLimits.maxDrawIndirectCount >= 1;
|
||||
|
||||
Reference in New Issue
Block a user