Fix dummy vertex buffer on d3d11 and d3d12 to be float4 instead of byte4

This commit is contained in:
Wojtek Figat
2025-04-03 19:09:12 +02:00
parent 0cfab003ef
commit 5873c48ed6
2 changed files with 4 additions and 4 deletions

View File

@@ -409,8 +409,8 @@ GPUBuffer* GPUDeviceDX11::GetDummyVB()
if (!_dummyVB)
{
_dummyVB = CreateBuffer(TEXT("DummyVertexBuffer"));
auto* layout = GPUVertexLayout::Get({{ VertexElement::Types::Attribute3, 0, 0, 0, PixelFormat::R8G8B8A8_UNorm }});
_dummyVB->Init(GPUBufferDescription::Vertex(layout, sizeof(Color32), 1, &Color32::Transparent));
auto* layout = GPUVertexLayout::Get({{ VertexElement::Types::Attribute3, 0, 0, 0, PixelFormat::R32G32B32A32_Float }});
_dummyVB->Init(GPUBufferDescription::Vertex(layout, sizeof(Color), 1, &Color::Transparent));
}
return _dummyVB;
}

View File

@@ -256,8 +256,8 @@ void GPUContextDX12::Reset()
if (!_device->DummyVB)
{
_device->DummyVB = _device->CreateBuffer(TEXT("DummyVertexBuffer"));
auto* layout = GPUVertexLayout::Get({{ VertexElement::Types::Attribute3, 0, 0, 0, PixelFormat::R8G8B8A8_UNorm }});
_device->DummyVB->Init(GPUBufferDescription::Vertex(layout, sizeof(Color32), 1, &Color32::Transparent));
auto* layout = GPUVertexLayout::Get({ { VertexElement::Types::Attribute3, 0, 0, 0, PixelFormat::R32G32B32A32_Float } });
_device->DummyVB->Init(GPUBufferDescription::Vertex(layout, sizeof(Color), 1, &Color::Transparent));
}
((GPUBufferDX12*)_device->DummyVB)->GetVBView(dummyVBView);
_commandList->IASetVertexBuffers(GPU_MAX_VB_BINDED, 1, &dummyVBView);