1
0
forked from 0ad/0ad

Fixes vertex attribute format mismatch for silhouette debug rendering.

This was SVN commit r27331.
This commit is contained in:
Vladislav Belov 2023-01-01 21:46:31 +00:00
parent ca242239f1
commit e4ded1f971
2 changed files with 4 additions and 4 deletions

View File

@ -493,7 +493,7 @@ void SilhouetteRenderer::RenderDebugOverlays(
{
deviceCommandContext->SetUniform(
colorBindingSlot, r.color.AsFloatArray());
u16 verts[] =
const float vertices[] =
{
r.x0, r.y0,
r.x1, r.y0,
@ -505,11 +505,11 @@ void SilhouetteRenderer::RenderDebugOverlays(
deviceCommandContext->SetVertexAttributeFormat(
Renderer::Backend::VertexAttributeStream::POSITION,
Renderer::Backend::Format::R16G16_SINT, 0, 0,
Renderer::Backend::Format::R32G32_SFLOAT, 0, sizeof(float) * 2,
Renderer::Backend::VertexAttributeRate::PER_VERTEX, 0);
deviceCommandContext->SetVertexBufferData(
0, verts, std::size(verts) * sizeof(verts[0]));
0, vertices, std::size(vertices) * sizeof(vertices[0]));
deviceCommandContext->Draw(0, 6);
}

View File

@ -69,7 +69,7 @@ private:
struct DebugRect
{
CColor color;
u16 x0, y0, x1, y1;
float x0, y0, x1, y1;
};
std::vector<DebugBounds> m_DebugBounds;