MCPcopy Create free account
hub / github.com/Kitware/VTK / EncodePropListRenderCommand

Method EncodePropListRenderCommand

Rendering/WebGPU/vtkWebGPURenderer.cxx:753–784  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

751
752//------------------------------------------------------------------------------
753wgpu::CommandBuffer vtkWebGPURenderer::EncodePropListRenderCommand(
754 vtkProp** propList, int listLength)
755{
756 this->UpdateBuffers();
757
758 // Because all the command encoding / rendering function use the props of the this->PropArray
759 // list, we're going to replace the list so that only the props we're interested in are rendered.
760 // We need to backup the original list though to restore it afterwards
761 vtkProp** propArrayBackup = this->PropArray;
762 int propCountBackup = this->PropArrayCount;
763
764 this->PropArray = propList;
765 this->PropArrayCount = listLength;
766
767 this->RecordRenderCommands();
768
769 // Restoring
770 this->PropArray = propArrayBackup;
771 this->PropArrayCount = propCountBackup;
772
773 vtkWebGPURenderWindow* renderWindow =
774 vtkWebGPURenderWindow::SafeDownCast(this->GetRenderWindow());
775 wgpu::CommandEncoder commandEncoder = renderWindow->GetCommandEncoder();
776 wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
777
778 // The command encoder of the render window has finished so we need to recreate a new one so that
779 // it's ready to be used again by someone else
780 renderWindow->CreateCommandEncoder();
781
782 this->DrawBackgroundInClearPass = false;
783 return commandBuffer;
784}
785
786//------------------------------------------------------------------------------
787void vtkWebGPURenderer::BeginRecording()

Callers 1

FirstPassRenderMethod · 0.80

Calls 6

UpdateBuffersMethod · 0.95
RecordRenderCommandsMethod · 0.95
GetCommandEncoderMethod · 0.80
GetRenderWindowMethod · 0.45
FinishMethod · 0.45
CreateCommandEncoderMethod · 0.45

Tested by

no test coverage detected