mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
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:
committed by
Kai Ninomiya
parent
ca309db58a
commit
68df8b0a3a
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user