| 249 | } |
| 250 | |
| 251 | bool CubeMapArrayApp::Render() |
| 252 | { |
| 253 | if (!UserInterfaceApp::Render()) |
| 254 | return false; |
| 255 | |
| 256 | const CubeMapArrayFrame& frame = GetCurrentFrame(); |
| 257 | |
| 258 | // 1) Render cube instances of 'CUBE_MAP_ARRAY_SIZE' count |
| 259 | META_DEBUG_GROUP_VAR(s_debug_group, "Cube Instances Rendering"); |
| 260 | frame.render_cmd_list.ResetWithState(m_render_state, &s_debug_group); |
| 261 | frame.render_cmd_list.SetViewState(GetViewState()); |
| 262 | m_cube_buffers_ptr->Draw(frame.render_cmd_list, frame.cube.program_bindings, 0U, CUBE_MAP_ARRAY_SIZE); |
| 263 | |
| 264 | // 2) Render sky-box after cubes to minimize overdraw |
| 265 | m_sky_box.Draw(frame.render_cmd_list, frame.sky_box.program_bindings, GetViewState()); |
| 266 | |
| 267 | RenderOverlay(frame.render_cmd_list); |
| 268 | |
| 269 | frame.render_cmd_list.Commit(); |
| 270 | |
| 271 | // Execute command list on render queue and present frame to screen |
| 272 | GetRenderContext().GetRenderCommandKit().GetQueue().Execute(frame.execute_cmd_list_set); |
| 273 | GetRenderContext().Present(); |
| 274 | |
| 275 | return true; |
| 276 | } |
| 277 | |
| 278 | void CubeMapArrayApp::OnContextReleased(rhi::IContext& context) |
| 279 | { |
no test coverage detected