
Untitled
By: a guest on
Jul 17th, 2012 | syntax:
None | size: 1.74 KB | hits: 16 | expires: Never
void NxRenderPipelineManager::DrawNonIndexed(NxRenderEffectPointer InEffect,
NxRenderResourcePointer InVertexBuffer,
int32 InVertexBufferOffset,
int InInputLayout,
D3D11_PRIMITIVE_TOPOLOGY InPrimitiveType,
UINT InVertexStride,
UINT InVertexCount,
UINT InStartVertexLocation,
INxRenderParameterManager* InParameterManager)
{
InputAssemblerStage.ClearDesiredState();
// Specify the type of geometry that we will be dealing with.
InputAssemblerStage.DesiredState.SetPrimitiveTopology(InPrimitiveType);
// Bind the vertex buffer.
InputAssemblerStage.DesiredState.SetVertexBuffer(0, InVertexBuffer->_Resource, InVertexBufferOffset, InVertexStride);
// Bind the input layout.
InputAssemblerStage.DesiredState.SetInputLayout(InInputLayout);
// Apply the state in this pipeline's input assembler
InputAssemblerStage.ApplyDesiredState(_Context);
// Use the effect to load all of the pipeline stages here.
ClearPipelineResources();
InEffect->ConfigurePipeline(this, InParameterManager);
ApplyPipelineResources();
if (InVertexCount == 0)
{
// GW-NEXUS: Cleaner way to do this?
_Context->DrawAuto();
}
else
{
_Context->Draw(InVertexCount, InStartVertexLocation);
}
}