Introduce render passes

* First API design (many features missing, including input attachments)
* Metal implementation (no OpenGL yet)
* Render-to-texture demo (a little broken until we have depth buffers)
* Update examples to use render passes
This commit is contained in:
Kai Ninomiya
2017-05-16 14:04:22 -07:00
committed by Kai Ninomiya
parent ca309db58a
commit 68df8b0a3a
34 changed files with 1305 additions and 54 deletions

View File

@@ -200,6 +200,19 @@ nxt::ShaderModule CreateShaderModule(const nxt::Device& device, nxt::ShaderStage
.GetResult();
}
void CreateDefaultRenderPass(const nxt::Device& device, nxt::RenderPass* renderPass, nxt::Framebuffer* framebuffer) {
*renderPass = device.CreateRenderPassBuilder()
.SetAttachmentCount(1)
.AttachmentSetFormat(0, nxt::TextureFormat::R8G8B8A8Unorm)
.SetSubpassCount(1)
.SubpassSetColorAttachment(0, 0, 0)
.GetResult();
*framebuffer = device.CreateFramebufferBuilder()
.SetRenderPass(*renderPass)
.SetDimensions(640, 480)
.GetResult();
}
extern "C" {
bool InitUtils(int argc, const char** argv) {
for (int i = 0; i < argc; i++) {