| 534 | #endif // /ENABLE_CBUFFER_RANGE |
| 535 | |
| 536 | void OnDrawFrame() override |
| 537 | { |
| 538 | // Update scene by user input |
| 539 | UpdateScene(); |
| 540 | |
| 541 | commands->Begin(); |
| 542 | { |
| 543 | #if ENABLE_CBUFFER_RANGE |
| 544 | |
| 545 | // Update constant buffer with all settings at once |
| 546 | UpdateSettingsForTexture(GetCbufferData(0)); |
| 547 | UpdateSettingsForScreen(GetCbufferData(1)); |
| 548 | commands->UpdateBuffer(*constantBuffer, 0, cbufferData.data(), static_cast<std::uint16_t>(cbufferData.size())); |
| 549 | |
| 550 | #endif // /ENABLE_CBUFFER_RANGE |
| 551 | |
| 552 | // Draw scene into texture, then draw scene onto screen |
| 553 | commands->PushDebugGroup("RenderTexture"); |
| 554 | { |
| 555 | DrawSceneIntoTexture(); |
| 556 | } |
| 557 | commands->PopDebugGroup(); |
| 558 | |
| 559 | commands->PushDebugGroup("RenderScreen"); |
| 560 | { |
| 561 | DrawSceneOntoScreen(); |
| 562 | } |
| 563 | commands->PopDebugGroup(); |
| 564 | } |
| 565 | commands->End(); |
| 566 | commandQueue->Submit(*commands); |
| 567 | } |
| 568 | |
| 569 | }; |
| 570 |
no test coverage detected