MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / SetModel

Method SetModel

BakingLab/MeshRenderer.cpp:359–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void MeshRenderer::SetModel(const Model* model)
360{
361 Assert_(model != nullptr);
362 sceneModel = model;
363
364 meshInputLayouts.clear();
365 meshDepthInputLayouts.clear();
366
367 for(uint64 i = 0; i < sceneModel->Meshes().size(); ++i)
368 {
369 // Generate input layouts for the scene meshes
370 const Mesh& mesh = sceneModel->Meshes()[i];
371 ID3D11InputLayoutPtr inputLayout;
372 DXCall(device->CreateInputLayout(mesh.InputElements(), mesh.NumInputElements(),
373 meshVS->ByteCode->GetBufferPointer(), meshVS->ByteCode->GetBufferSize(), &inputLayout));
374 meshInputLayouts.push_back(inputLayout);
375
376 DXCall(device->CreateInputLayout(mesh.InputElements(), mesh.NumInputElements(),
377 meshDepthVS->ByteCode->GetBufferPointer(), meshDepthVS->ByteCode->GetBufferSize(), &inputLayout));
378 meshDepthInputLayouts.push_back(inputLayout);
379 }
380}
381
382void MeshRenderer::Update(const Camera& camera, Float2 jitterOffset)
383{

Callers 1

UpdateMethod · 0.80

Calls 8

DXCallFunction · 0.85
InputElementsMethod · 0.80
NumInputElementsMethod · 0.80
GetBufferPointerMethod · 0.80
GetBufferSizeMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected