MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / BindDrawData

Method BindDrawData

Source/Engine/Graphics/Materials/MaterialShader.cpp:98–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void IMaterial::BindParameters::BindDrawData()
99{
100 // Write draw call to the object buffer
101 ASSERT(DrawCall);
102 auto& objectBuffer = RenderContext.List->TempObjectBuffer;
103 objectBuffer.Clear();
104 ShaderObjectData objData;
105 objData.Store(*DrawCall);
106 objectBuffer.Write(objData);
107 objectBuffer.Flush(GPUContext);
108 ObjectBuffer = objectBuffer.GetBuffer()->View();
109
110 // Setup data
111 MaterialShaderDataPerDraw perDraw;
112 perDraw.DrawPadding = Float3::Zero;
113 perDraw.DrawObjectIndex = 0;
114
115 // Update constants
116 GPUContext->UpdateCB(PerDrawConstants, &perDraw);
117 GPUContext->BindCB(2, PerDrawConstants);
118}
119
120GPUPipelineState* MaterialShader::PipelineStateCache::InitPS(CullMode mode, bool wireframe)
121{

Callers 3

RenderMethod · 0.80
RenderMethod · 0.80
ApplySkyMethod · 0.80

Calls 8

ClearMethod · 0.45
StoreMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45
ViewMethod · 0.45
GetBufferMethod · 0.45
UpdateCBMethod · 0.45
BindCBMethod · 0.45

Tested by

no test coverage detected