vulkan-3.26.1: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Core10.Sampler

Synopsis

Documentation

createSampler Source #

Arguments

:: forall a io. (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io) 
=> Device

device is the logical device that creates the sampler.

-> SamplerCreateInfo a

pCreateInfo is a pointer to a SamplerCreateInfo structure specifying the state of the sampler object.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io Sampler 

vkCreateSampler - Create a new sampler object

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle
  • pCreateInfo must be a valid pointer to a valid SamplerCreateInfo structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • pSampler must be a valid pointer to a Sampler handle

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, Sampler, SamplerCreateInfo

withSampler :: forall a io r. (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io) => Device -> SamplerCreateInfo a -> Maybe AllocationCallbacks -> (io Sampler -> (Sampler -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createSampler and destroySampler

To ensure that destroySampler is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

destroySampler Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that destroys the sampler.

-> Sampler

sampler is the sampler to destroy.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io () 

vkDestroySampler - Destroy a sampler object

Valid Usage

  • All submitted commands that refer to sampler must have completed execution
  • If AllocationCallbacks were provided when sampler was created, a compatible set of callbacks must be provided here
  • If no AllocationCallbacks were provided when sampler was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle
  • If sampler is not NULL_HANDLE, sampler must be a valid Sampler handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • If sampler is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to sampler must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, Sampler

data SamplerCreateInfo (es :: [Type]) Source #

VkSamplerCreateInfo - Structure specifying parameters of a newly created sampler

Description

Mapping of OpenGL to Vulkan filter modes

magFilter values of FILTER_NEAREST and FILTER_LINEAR directly correspond to GL_NEAREST and GL_LINEAR magnification filters. minFilter and mipmapMode combine to correspond to the similarly named OpenGL minification filter of GL_minFilter_MIPMAP_mipmapMode (e.g. minFilter of FILTER_LINEAR and mipmapMode of SAMPLER_MIPMAP_MODE_NEAREST correspond to GL_LINEAR_MIPMAP_NEAREST).

There are no Vulkan filter modes that directly correspond to OpenGL minification filters of GL_LINEAR or GL_NEAREST, but they can be emulated using SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and maxLod = 0.25, and using minFilter = FILTER_LINEAR or minFilter = FILTER_NEAREST, respectively.

Note that using a maxLod of zero would cause magnification to always be performed, and the magFilter to always be used. This is valid, just not an exact match for OpenGL behavior. Clamping the maximum LOD to 0.25 allows the λ value to be non-zero and minification to be performed, while still always rounding down to the base level. If the minFilter and magFilter are equal, then using a maxLod of zero also works.

The maximum number of sampler objects which can be simultaneously created on a device is implementation-dependent and specified by the maxSamplerAllocationCount member of the PhysicalDeviceLimits structure.

Note

For historical reasons, if maxSamplerAllocationCount is exceeded, some implementations may return ERROR_TOO_MANY_OBJECTS. Exceeding this limit will result in undefined behavior, and an application should not rely on the use of the returned error code in order to identify when the limit is reached.

Since Sampler is a non-dispatchable handle type, implementations may return the same handle for sampler state vectors that are identical. In such cases, all such objects would only count once against the maxSamplerAllocationCount limit.

Valid Usage

  • The absolute value of mipLodBias must be less than or equal to PhysicalDeviceLimits::maxSamplerLodBias

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, BorderColor, CompareOp, Filter, SamplerAddressMode, SamplerCreateFlags, SamplerMipmapMode, StructureType, createSampler

Constructors

SamplerCreateInfo 

Fields

Instances

Instances details
Extensible SamplerCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Sampler

Methods

extensibleTypeName :: String Source #

getNext :: forall (es :: [Type]). SamplerCreateInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [TYPE LiftedRep]). SamplerCreateInfo ds -> Chain es -> SamplerCreateInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends SamplerCreateInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (SamplerCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Sampler

(Extendss SamplerCreateInfo es, PeekChain es) => FromCStruct (SamplerCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Sampler

(Extendss SamplerCreateInfo es, PokeChain es) => ToCStruct (SamplerCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Sampler

es ~ ('[] :: [Type]) => Zero (SamplerCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Sampler

newtype Sampler Source #

Constructors

Sampler Word64 

Instances

Instances details
Storable Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

Show Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

Eq Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

(==) :: Sampler -> Sampler -> Bool #

(/=) :: Sampler -> Sampler -> Bool #

Ord Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

HasObjectType Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero Sampler Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

zero :: Sampler Source #

newtype BorderColor Source #

VkBorderColor - Specify border color used for texture lookups

Description

These colors are described in detail in Texel Replacement.

See Also

VK_VERSION_1_0, SamplerCreateInfo

Constructors

BorderColor Int32 

Bundled Patterns

pattern BORDER_COLOR_FLOAT_TRANSPARENT_BLACK :: BorderColor

BORDER_COLOR_FLOAT_TRANSPARENT_BLACK specifies a transparent, floating-point format, black color.

pattern BORDER_COLOR_INT_TRANSPARENT_BLACK :: BorderColor

BORDER_COLOR_INT_TRANSPARENT_BLACK specifies a transparent, integer format, black color.

pattern BORDER_COLOR_FLOAT_OPAQUE_BLACK :: BorderColor

BORDER_COLOR_FLOAT_OPAQUE_BLACK specifies an opaque, floating-point format, black color.

pattern BORDER_COLOR_INT_OPAQUE_BLACK :: BorderColor

BORDER_COLOR_INT_OPAQUE_BLACK specifies an opaque, integer format, black color.

pattern BORDER_COLOR_FLOAT_OPAQUE_WHITE :: BorderColor

BORDER_COLOR_FLOAT_OPAQUE_WHITE specifies an opaque, floating-point format, white color.

pattern BORDER_COLOR_INT_OPAQUE_WHITE :: BorderColor

BORDER_COLOR_INT_OPAQUE_WHITE specifies an opaque, integer format, white color.

pattern BORDER_COLOR_INT_CUSTOM_EXT :: BorderColor

BORDER_COLOR_INT_CUSTOM_EXT indicates that a SamplerCustomBorderColorCreateInfoEXT structure is included in the SamplerCreateInfo::pNext chain containing the color data in integer format.

pattern BORDER_COLOR_FLOAT_CUSTOM_EXT :: BorderColor

BORDER_COLOR_FLOAT_CUSTOM_EXT indicates that a SamplerCustomBorderColorCreateInfoEXT structure is included in the SamplerCreateInfo::pNext chain containing the color data in floating-point format.

Instances

Instances details
Storable BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

Read BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

Show BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

Eq BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

Ord BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

Zero BorderColor Source # 
Instance details

Defined in Vulkan.Core10.Enums.BorderColor

newtype Filter Source #

VkFilter - Specify filters used for texture lookups

Description

These filters are described in detail in Texel Filtering.

See Also

VK_VERSION_1_0, BlitImageInfo2, SamplerCreateInfo, SamplerYcbcrConversionCreateInfo, cmdBlitImage

Constructors

Filter Int32 

Bundled Patterns

pattern FILTER_NEAREST :: Filter

FILTER_NEAREST specifies nearest filtering.

pattern FILTER_LINEAR :: Filter

FILTER_LINEAR specifies linear filtering.

pattern FILTER_CUBIC_EXT :: Filter

FILTER_CUBIC_EXT specifies cubic filtering.

Instances

Instances details
Storable Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Read Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Show Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Eq Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Methods

(==) :: Filter -> Filter -> Bool #

(/=) :: Filter -> Filter -> Bool #

Ord Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Zero Filter Source # 
Instance details

Defined in Vulkan.Core10.Enums.Filter

Methods

zero :: Filter Source #

newtype SamplerMipmapMode Source #

VkSamplerMipmapMode - Specify mipmap mode used for texture lookups

Description

These modes are described in detail in Texel Filtering.

See Also

VK_VERSION_1_0, SamplerCreateInfo

Constructors

SamplerMipmapMode Int32 

Bundled Patterns

pattern SAMPLER_MIPMAP_MODE_NEAREST :: SamplerMipmapMode

SAMPLER_MIPMAP_MODE_NEAREST specifies nearest filtering.

pattern SAMPLER_MIPMAP_MODE_LINEAR :: SamplerMipmapMode

SAMPLER_MIPMAP_MODE_LINEAR specifies linear filtering.

Instances

Instances details
Storable SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

Read SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

Show SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

Eq SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

Ord SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

Zero SamplerMipmapMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerMipmapMode

newtype SamplerAddressMode Source #

VkSamplerAddressMode - Specify behavior of sampling with texture coordinates outside an image

See Also

VK_VERSION_1_0, SamplerCreateInfo

Bundled Patterns

pattern SAMPLER_ADDRESS_MODE_REPEAT :: SamplerAddressMode

SAMPLER_ADDRESS_MODE_REPEAT specifies that the repeat wrap mode will be used.

pattern SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT :: SamplerAddressMode

SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT specifies that the mirrored repeat wrap mode will be used.

pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE :: SamplerAddressMode

SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE specifies that the clamp to edge wrap mode will be used.

pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER :: SamplerAddressMode

SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER specifies that the clamp to border wrap mode will be used.

pattern SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE :: SamplerAddressMode

SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE specifies that the mirror clamp to edge wrap mode will be used. This is only valid if samplerMirrorClampToEdge is enabled, or if the VK_KHR_sampler_mirror_clamp_to_edge extension is enabled.

Instances

Instances details
Storable SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

Read SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

Show SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

Eq SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

Ord SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

Zero SamplerAddressMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerAddressMode

newtype SamplerCreateFlagBits Source #

VkSamplerCreateFlagBits - Bitmask specifying additional parameters of sampler

Description

Note

The approximations used when SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT is specified are implementation defined. Some implementations may interpolate between fragment density levels in a subsampled image. In that case, this bit may be used to decide whether the interpolation factors are calculated per fragment or at a coarser granularity.

See Also

VK_VERSION_1_0, SamplerCreateFlags

Bundled Patterns

pattern SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM :: SamplerCreateFlagBits

SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM specifies that the sampler will read from images using only OpImageWeightedSampleQCOM, OpImageBoxFilterQCOM, OpImageBlockMatchGatherSSDQCOM, OpImageBlockMatchGatherSADQCOM, OpImageBlockMatchWindowSSDQCOM, OpImageBlockMatchWindowSADQCOM, OpImageBlockMatchSSDQCOM, or OpImageBlockMatchSADQCOM.

pattern SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT :: SamplerCreateFlagBits

SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT specifies that cube map edge handling is not performed.

pattern SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: SamplerCreateFlagBits

SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT specifies that the sampler can be used with descriptor buffers when capturing and replaying (e.g. for trace capture and replay), see OpaqueCaptureDescriptorDataCreateInfoEXT for more detail.

pattern SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT :: SamplerCreateFlagBits

SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT specifies that the implementation may use approximations when reconstructing a full color value for texture access from a subsampled image.

pattern SAMPLER_CREATE_SUBSAMPLED_BIT_EXT :: SamplerCreateFlagBits

SAMPLER_CREATE_SUBSAMPLED_BIT_EXT specifies that the sampler will read from an image created with flags containing IMAGE_CREATE_SUBSAMPLED_BIT_EXT.

Instances

Instances details
Storable SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Bits SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

FiniteBits SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Read SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Show SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Eq SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Ord SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits

Zero SamplerCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.SamplerCreateFlagBits