Move constant buffer init for instanced draws only, others do it in all paths
This commit is contained in:
@@ -917,10 +917,10 @@ void RenderList::ExecuteDrawCalls(const RenderContext& renderContext, DrawCallsL
|
|||||||
perDraw.DrawPadding = Float3::Zero;
|
perDraw.DrawPadding = Float3::Zero;
|
||||||
GPUConstantBuffer* perDrawCB = IMaterial::BindParameters::PerDrawConstants;
|
GPUConstantBuffer* perDrawCB = IMaterial::BindParameters::PerDrawConstants;
|
||||||
context->BindCB(2, perDrawCB); // TODO: use rootSignature/pushConstants on D3D12/Vulkan
|
context->BindCB(2, perDrawCB); // TODO: use rootSignature/pushConstants on D3D12/Vulkan
|
||||||
context->UpdateCB(perDrawCB, &perDraw);
|
|
||||||
constexpr int32 vbMax = ARRAY_COUNT(DrawCall::Geometry.VertexBuffers);
|
constexpr int32 vbMax = ARRAY_COUNT(DrawCall::Geometry.VertexBuffers);
|
||||||
if (useInstancing)
|
if (useInstancing)
|
||||||
{
|
{
|
||||||
|
context->UpdateCB(perDrawCB, &perDraw);
|
||||||
GPUBuffer* vb[vbMax + 1];
|
GPUBuffer* vb[vbMax + 1];
|
||||||
uint32 vbOffsets[vbMax + 1];
|
uint32 vbOffsets[vbMax + 1];
|
||||||
vb[3] = _instanceBuffer.GetBuffer(); // Pass object index in a vertex stream at slot 3 (used by VS in Surface.shader)
|
vb[3] = _instanceBuffer.GetBuffer(); // Pass object index in a vertex stream at slot 3 (used by VS in Surface.shader)
|
||||||
|
|||||||
Reference in New Issue
Block a user