More fixes for Vulkan rendering to be on pair with DirectX when it comes to accessing missing vertex buffer components

This commit is contained in:
Wojtek Figat
2025-01-09 21:46:22 +01:00
parent 3505b8971b
commit 99788e4743
7 changed files with 54 additions and 24 deletions

View File

@@ -169,15 +169,22 @@ GPUBuffer::GPUBuffer()
bool GPUBuffer::Init(const GPUBufferDescription& desc)
{
ASSERT(Math::IsInRange<uint32>(desc.Size, 1, MAX_int32)
&& Math::IsInRange<uint32>(desc.Stride, 0, 1024));
// Validate description
#if !BUILD_RELEASE
#define GET_NAME() GetName()
#else
#define GET_NAME() TEXT("")
#endif
if (Math::IsNotInRange<uint32>(desc.Size, 1, MAX_int32))
{
LOG(Warning, "Cannot create buffer '{}'. Incorrect size {}.", GET_NAME(), desc.Size);
return true;
}
if (Math::IsNotInRange<uint32>(desc.Stride, 0, 1024))
{
LOG(Warning, "Cannot create buffer '{}'. Incorrect stride {}.", GET_NAME(), desc.Stride);
return true;
}
if (EnumHasAnyFlags(desc.Flags, GPUBufferFlags::Structured))
{
if (desc.Stride <= 0)