Merge remote-tracking branch 'origin/master' into 1.10

# Conflicts:
#	Source/Engine/Core/Math/Vector3.cpp
#	Source/Engine/Core/Math/Vector3.h
#	Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp
#	Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp
#	Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h
This commit is contained in:
Wojtek Figat
2025-03-09 09:23:42 +01:00
6 changed files with 39 additions and 14 deletions

View File

@@ -1292,7 +1292,8 @@ Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type)
LOAD_FAILED();
}
#endif
result->RegisterObject();
if (!result->IsInternalType())
result->RegisterObject();
// Register asset
AssetsLocker.Lock();

View File

@@ -560,14 +560,9 @@ void GPUContextVulkan::UpdateDescriptorSets(const SpirvShaderDescriptorInfo& des
VkBuffer buffer = VK_NULL_HANDLE;
VkDeviceSize offset = 0, range = 0;
uint32 dynamicOffset = 0;
if (handle)
handle->DescriptorAsDynamicUniformBuffer(this, buffer, offset, range, dynamicOffset);
else
{
const auto dummy = _device->HelperResources.GetDummyBuffer(PixelFormat::R32_SInt);
buffer = dummy->GetHandle();
range = dummy->GetSize();
}
if (!handle)
handle = (GPUConstantBufferVulkan*)_device->HelperResources.GetDummyConstantBuffer();
handle->DescriptorAsDynamicUniformBuffer(this, buffer, offset, range, dynamicOffset);
needsWrite |= dsWriter.WriteDynamicUniformBuffer(descriptorIndex, buffer, offset, range, dynamicOffset, index);
break;
}

View File

@@ -232,6 +232,19 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugUtilsCallback(VkDebugUtilsMessageSever
LOG(Info, "[Vulkan] {0} {1}:{2}({3}) {4}", type, severity, callbackData->messageIdNumber, String(callbackData->pMessageIdName), message);
else
LOG(Info, "[Vulkan] {0} {1}:{2} {3}", type, severity, callbackData->messageIdNumber, message);
#if BUILD_DEBUG
if (auto* context = (GPUContextVulkan*)GPUDevice::Instance->GetMainContext())
{
if (auto* state = (GPUPipelineStateVulkan*)context->GetState())
{
const StringAnsi vsName = state->DebugDesc.VS ? state->DebugDesc.VS->GetName() : StringAnsi::Empty;
const StringAnsi psName = state->DebugDesc.PS ? state->DebugDesc.PS->GetName() : StringAnsi::Empty;
LOG(Warning, "[Vulkan] Error during rendering with VS={}, PS={}", String(vsName), String(psName));
}
}
#endif
return VK_FALSE;
}
@@ -765,7 +778,6 @@ bool BufferedQueryPoolVulkan::HasRoom() const
HelperResourcesVulkan::HelperResourcesVulkan(GPUDeviceVulkan* device)
: _device(device)
, _dummyVB(nullptr)
{
Platform::MemoryClear(_dummyTextures, sizeof(_dummyTextures));
Platform::MemoryClear(_staticSamplers, sizeof(_staticSamplers));
@@ -918,10 +930,20 @@ GPUBufferVulkan* HelperResourcesVulkan::GetDummyVertexBuffer()
return _dummyVB;
}
GPUConstantBuffer* HelperResourcesVulkan::GetDummyConstantBuffer()
{
if (!_dummyCB)
{
_dummyCB = _device->CreateConstantBuffer(256, TEXT("DummyConstantBuffer"));
}
return _dummyCB;
}
void HelperResourcesVulkan::Dispose()
{
SAFE_DELETE_GPU_RESOURCES(_dummyTextures);
SAFE_DELETE_GPU_RESOURCE(_dummyVB);
SAFE_DELETE_GPU_RESOURCE(_dummyCB);
if (_dummyBuffers)
{
for (int32 i = 0; i < (int32)PixelFormat::MAX; i++)

View File

@@ -310,7 +310,8 @@ private:
GPUDeviceVulkan* _device;
GPUTextureVulkan* _dummyTextures[6];
GPUBufferVulkan** _dummyBuffers = nullptr;
GPUBufferVulkan* _dummyVB;
GPUBufferVulkan* _dummyVB = nullptr;
GPUConstantBuffer* _dummyCB = nullptr;
VkSampler _staticSamplers[GPU_STATIC_SAMPLERS_COUNT];
public:
@@ -321,6 +322,7 @@ public:
GPUTextureVulkan* GetDummyTexture(SpirvShaderResourceType type);
GPUBufferVulkan* GetDummyBuffer(PixelFormat format);
GPUBufferVulkan* GetDummyVertexBuffer();
GPUConstantBuffer* GetDummyConstantBuffer();
void Dispose();
};