| 113 | } |
| 114 | |
| 115 | void EnvironmentMapPass::Render( |
| 116 | nvrhi::ICommandList* commandList, |
| 117 | const ICompositeView& compositeView) |
| 118 | { |
| 119 | commandList->beginMarker("Environment Map"); |
| 120 | |
| 121 | for (uint viewIndex = 0; viewIndex < compositeView.GetNumChildViews(ViewType::PLANAR); viewIndex++) |
| 122 | { |
| 123 | const IView* view = compositeView.GetChildView(ViewType::PLANAR, viewIndex); |
| 124 | |
| 125 | nvrhi::GraphicsState state; |
| 126 | state.pipeline = m_RenderPso; |
| 127 | state.framebuffer = m_FramebufferFactory->GetFramebuffer(*view); |
| 128 | state.bindings = { m_RenderBindingSet }; |
| 129 | state.viewport = view->GetViewportState(); |
| 130 | |
| 131 | SkyConstants skyConstants = {}; |
| 132 | skyConstants.matClipToTranslatedWorld = view->GetInverseViewProjectionMatrix() * affineToHomogeneous(translation(-view->GetViewOrigin())); |
| 133 | commandList->writeBuffer(m_SkyCB, &skyConstants, sizeof(skyConstants)); |
| 134 | |
| 135 | commandList->setGraphicsState(state); |
| 136 | |
| 137 | nvrhi::DrawArguments args; |
| 138 | args.instanceCount = 1; |
| 139 | args.vertexCount = 4; |
| 140 | commandList->draw(args); |
| 141 | } |
| 142 | |
| 143 | commandList->endMarker(); |
| 144 | } |
nothing calls this directly
no test coverage detected