MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / beginFrame

Method beginFrame

samples/SharedHandles/SharedHandles.cpp:182–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 }
181
182 void beginFrame( vk::Extent2D extent )
183 {
184 std::array<vk::ClearValue, 2> clearValues;
185 clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f );
186 clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 );
187 vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer].get(), vk::Rect2D( vk::Offset2D( 0, 0 ), extent ), clearValues );
188
189 commandBuffer->begin( vk::CommandBufferBeginInfo() );
190 commandBuffer->beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline );
191 commandBuffer->bindPipeline( vk::PipelineBindPoint::eGraphics, graphicsPipeline.get() );
192 commandBuffer->bindDescriptorSets( vk::PipelineBindPoint::eGraphics, pipelineLayout.get(), 0, descriptorSet.get(), nullptr );
193
194 commandBuffer->setViewport( 0, vk::Viewport( 0.0f, 0.0f, static_cast<float>( extent.width ), static_cast<float>( extent.height ), 0.0f, 1.0f ) );
195 commandBuffer->setScissor( 0, vk::Rect2D( vk::Offset2D( 0, 0 ), extent ) );
196 }
197
198 void endFrame()
199 {

Callers 1

renderFrameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected