don't interrupt render pass before color clear

This commit is contained in:
Samuliak
2024-05-24 15:28:16 +02:00
committed by Evan Husted
parent 305a703d4a
commit 8f91b556af
3 changed files with 26 additions and 15 deletions

View File

@@ -6,8 +6,7 @@ struct VertexOut {
float4 position [[position]];
};
vertex VertexOut vertexMain(ushort vid [[vertex_id]])
{
vertex VertexOut vertexMain(ushort vid [[vertex_id]]) {
int low = vid & 1;
int high = vid >> 1;
@@ -21,8 +20,11 @@ vertex VertexOut vertexMain(ushort vid [[vertex_id]])
return out;
}
fragment float4 fragmentMain(VertexOut in [[stage_in]],
constant float4& clear_color [[buffer(0)]])
{
return clear_color;
struct FragmentOut {
float4 color [[color(COLOR_ATTACHMENT_INDEX)]];
};
fragment FragmentOut fragmentMain(VertexOut in [[stage_in]],
constant float4& clear_color [[buffer(0)]]) {
return {clear_color};
}