The render-pass-render-area feature allows specifying a sub-region of the attachments that the render pass will use. The “render area” defines the rectangle within which rendering operations, including load and store operations, must be performed. Rendering operations may still modify texels outside of the render area.
Additional functionalities:
wgpu::RenderPassRenderAreaRect as chained struct for wgpu::RenderPassDescriptor. It defines a rect of {x, y, width, height} to indicate that rendering operations are only performed on the texels within this rect region of the attachments.Example Usage:
wgpu::RenderPassRenderAreaRect rect; rect.x = 10; rect.y = 10; rect.width = 100; rect.height = 100; wgpu::RenderPassDescriptor renderPassDesc = ...; renderPassDesc.nextInChain = ▭ auto renderPassEncoder = encoder.BeginRenderPass(&renderPassDesc); // Draw commands here... renderPassEncoder.End();
Notes:
wgpu::RenderPassEncoder::SetScissorRect() must be contained by the render area rect specified in wgpu::RenderPassRenderAreaRect.