[vulkan] Use a template for the attachment desciptions

This commit is contained in:
Bill Currie 2022-04-03 13:15:30 +09:00
parent c8e299ca58
commit f66df59c43

View file

@ -116,86 +116,55 @@
{ color = "[0, 0, 0, 0]"; }, // translucent { color = "[0, 0, 0, 0]"; }, // translucent
{ color = "[0, 0, 0, 1]"; }, // output { color = "[0, 0, 0, 1]"; }, // output
); );
attachment_template = {
samples = 1;
loadOp = dont_care;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
};
renderpass = { renderpass = {
attachments = ( attachments = (
{ {
@inherit = $properties.attachment_template;
format = $properties.images.depth.format; format = $properties.images.depth.format;
samples = 1;
loadOp = clear; loadOp = clear;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = depth_stencil_attachment_optimal; finalLayout = depth_stencil_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.color.format; format = $properties.images.color.format;
samples = 1;
loadOp = clear; loadOp = clear;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.emission.format; format = $properties.images.emission.format;
samples = 1;
loadOp = clear; loadOp = clear;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.normal.format; format = $properties.images.normal.format;
samples = 1;
loadOp = dont_care;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.position.format; format = $properties.images.position.format;
samples = 1;
loadOp = dont_care;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.opaque.format; format = $properties.images.opaque.format;
samples = 1;
loadOp = dont_care;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $properties.images.translucent.format; format = $properties.images.translucent.format;
samples = 1;
loadOp = clear; loadOp = clear;
storeOp = dont_care;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = color_attachment_optimal;
}, },
{ {
@inherit = $properties.attachment_template;
format = $output.format; format = $output.format;
samples = 1;
loadOp = clear; loadOp = clear;
storeOp = store; storeOp = store;
stencilLoadOp = dont_care;
stencilStoreOp = dont_care;
initialLayout = undefined;
finalLayout = present_src_khr; finalLayout = present_src_khr;
}, },
); );