Changeset 27222

Timestamp:
Nov 13, 2022, 8:19:08 PM (20 months ago)
Author:
Vladislav Belov
Message:

Removes unused UV1 stream in OverlayRenderer and moves vertex data setup out of a loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/renderer/OverlayRenderer.cpp

    r27209 r27222  
    164164    quadVertices.AddAttribute(&quadAttributeColor);
    165165
    166     quadAttributeUV.format = Renderer::Backend::Format::R16G16_SINT;
     166    quadAttributeUV.format = Renderer::Backend::Format::RT;
    167167    quadVertices.AddAttribute(&quadAttributeUV);
    168168
     
    309309    VertexArrayIterator<CVector3D> vertexPos = m->quadAttributePos.GetIterator<CVector3D>();
    310310    VertexArrayIterator<SColor4ub> vertexColor = m->quadAttributeColor.GetIterator<SColor4ub>();
    311     VertexArrayIterator<short[2]> vertexUV = m->quadAttributeUV.GetIterator<short[2]>();
     311    VertexArrayIterator<t[2]>();
    312312
    313313    size_t indicesIdx = 0;
     
    545545    const uint32_t firstVertexOffset = m->quadVertices.GetOffset() * vertexStride;
    546546
     547
     548
     549
     550
     551
     552
     553
     554
     555
     556
     557
     558
     559
     560
     561
     562
     563
    547564    const int32_t baseTexBindingSlot = shader->GetBindingSlot(str_baseTex);
    548565    const int32_t maskTexBindingSlot = shader->GetBindingSlot(str_maskTex);
     
    565582        deviceCommandContext->SetTexture(
    566583            maskTexBindingSlot, maskPair.m_TextureMask->GetBackendTexture());
    567 
    568         // TODO: move setting format out of the loop, we might want move the offset
    569         // to the index offset when it's supported.
    570         deviceCommandContext->SetVertexAttributeFormat(
    571             Renderer::Backend::VertexAttributeStream::POSITION,
    572             m->quadAttributePos.format, m->quadAttributePos.offset, vertexStride,
    573             Renderer::Backend::VertexAttributeRate::PER_VERTEX, 0);
    574         deviceCommandContext->SetVertexAttributeFormat(
    575             Renderer::Backend::VertexAttributeStream::COLOR,
    576             m->quadAttributeColor.format, m->quadAttributeColor.offset, vertexStride,
    577             Renderer::Backend::VertexAttributeRate::PER_VERTEX, 0);
    578         deviceCommandContext->SetVertexAttributeFormat(
    579             Renderer::Backend::VertexAttributeStream::UV0,
    580             m->quadAttributeUV.format, m->quadAttributeUV.offset, vertexStride,
    581             Renderer::Backend::VertexAttributeRate::PER_VERTEX, 0);
    582         deviceCommandContext->SetVertexAttributeFormat(
    583             Renderer::Backend::VertexAttributeStream::UV1,
    584             m->quadAttributeUV.format, m->quadAttributeUV.offset, vertexStride,
    585             Renderer::Backend::VertexAttributeRate::PER_VERTEX, 0);
    586 
    587         deviceCommandContext->SetVertexBuffer(
    588             0, m->quadVertices.GetBuffer(), firstVertexOffset);
    589         deviceCommandContext->SetIndexBuffer(m->quadIndices.GetBuffer());
    590584
    591585        deviceCommandContext->DrawIndexed(m->quadIndices.GetOffset() + batchRenderData.m_IndicesBase, batchNumQuads * 6, 0);
Note: See TracChangeset for help on using the changeset viewer.