HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Core10.Enums.BlendOp

  • 1 type
  • Packagevulkan-3.27
  • Exports52
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceBlendOp.hs
newtypenewtype BlendOp
#

VkBlendOp - Framebuffer blending operations

Description

The semantics of the basic blend operations are described in the table below:

BlendOp

RGB Components

Alpha Component

BLEND_OP_ADD

R = Rs0 × Sr + Rd × Dr G = Gs0 × Sg + Gd × Dg B = Bs0 × Sb + Bd × Db

A = As0 × Sa + Ad × Da

BLEND_OP_SUBTRACT

R = Rs0 × Sr - Rd × Dr G = Gs0 × Sg - Gd × Dg B = Bs0 × Sb - Bd × Db

A = As0 × Sa - Ad × Da

BLEND_OP_REVERSE_SUBTRACT

R = Rd × Dr - Rs0 × Sr G = Gd × Dg - Gs0 × Sg B = Bd × Db - Bs0 × Sb

A = Ad × Da - As0 × Sa

BLEND_OP_MIN

R = min(Rs0,Rd) G = min(Gs0,Gd) B = min(Bs0,Bd)

A = min(As0,Ad)

BLEND_OP_MAX

R = max(Rs0,Rd) G = max(Gs0,Gd) B = max(Bs0,Bd)

A = max(As0,Ad)

Basic Blend Operations

In this table, the following conventions are used:

  • Rs0, Gs0, Bs0 and As0 represent the first source color R, G, B, and A components, respectively.

  • Rd, Gd, Bd and Ad represent the R, G, B, and A components of the destination color. That is, the color currently in the corresponding color attachment for this fragment/sample.

  • Sr, Sg, Sb and Sa represent the source blend factor R, G, B, and A components, respectively.

  • Dr, Dg, Db and Da represent the destination blend factor R, G, B, and A components, respectively.

The blending operation produces a new set of values R, G, B and A, which are written to the framebuffer attachment. If blending is not enabled for this attachment, then R, G, B and A are assigned Rs0, Gs0, Bs0 and As0, respectively.

If the color attachment is fixed-point, the components of the source and destination values and blend factors are each clamped to [0,1] or [-1,1] respectively for an unsigned normalized or signed normalized color attachment prior to evaluating the blend operations. If the color attachment is floating-point, no clamping occurs.

See Also

VK_VERSION_1_0, ColorBlendAdvancedEXT, ColorBlendEquationEXT, PipelineColorBlendAttachmentState

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Ord BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Read BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Show BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Storable BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Zero BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp