Add default values for blending.

This commit is contained in:
Chinmay Garde
2021-06-22 14:00:01 -07:00
committed by Dan Field
parent 8fb7637115
commit 507037d790
2 changed files with 9 additions and 7 deletions

View File

@@ -95,15 +95,16 @@ struct ColorAttachmentDescriptor {
/// final_color = final_color & write_mask;
/// ```
BlendFactor src_color_blend_factor;
BlendOperation color_blend_op;
BlendFactor dst_color_blend_factor;
BlendFactor src_color_blend_factor = BlendFactor::kOne;
BlendOperation color_blend_op = BlendOperation::kAdd;
BlendFactor dst_color_blend_factor = BlendFactor::kZero;
BlendFactor src_alpha_blend_factor;
BlendOperation alpha_blend_op;
BlendFactor dst_alpha_blend_factor;
BlendFactor src_alpha_blend_factor = BlendFactor::kOne;
BlendOperation alpha_blend_op = BlendOperation::kAdd;
BlendFactor dst_alpha_blend_factor = BlendFactor::kZero;
std::underlying_type_t<ColorWriteMask> write_mask;
std::underlying_type_t<ColorWriteMask> write_mask =
static_cast<uint64_t>(ColorWriteMask::kAll);
constexpr bool operator==(const ColorAttachmentDescriptor& o) const {
return format == o.format && //

View File

@@ -43,6 +43,7 @@ BoxPrimitive::BoxPrimitive(std::shared_ptr<Context> context)
// Configure the sole color attachments pixel format.
ColorAttachmentDescriptor color0;
color0.format = PixelFormat::kPixelFormat_B8G8R8A8_UNormInt_SRGB;
desc.SetColorAttachmentDescriptor(0u, std::move(color0));
}