| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.Sampler
Synopsis
- createSampler :: forall a io. (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io) => Device -> SamplerCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Sampler
- withSampler :: forall a io r. (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io) => Device -> SamplerCreateInfo a -> Maybe AllocationCallbacks -> (io Sampler -> (Sampler -> io ()) -> r) -> r
- destroySampler :: forall io. MonadIO io => Device -> Sampler -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data SamplerCreateInfo (es :: [Type]) = SamplerCreateInfo {
- next :: Chain es
- flags :: SamplerCreateFlags
- magFilter :: Filter
- minFilter :: Filter
- mipmapMode :: SamplerMipmapMode
- addressModeU :: SamplerAddressMode
- addressModeV :: SamplerAddressMode
- addressModeW :: SamplerAddressMode
- mipLodBias :: Float
- anisotropyEnable :: Bool
- maxAnisotropy :: Float
- compareEnable :: Bool
- compareOp :: CompareOp
- minLod :: Float
- maxLod :: Float
- borderColor :: BorderColor
- unnormalizedCoordinates :: Bool
- newtype Sampler = Sampler Word64
- newtype BorderColor where
- BorderColor Int32
- pattern BORDER_COLOR_FLOAT_TRANSPARENT_BLACK :: BorderColor
- pattern BORDER_COLOR_INT_TRANSPARENT_BLACK :: BorderColor
- pattern BORDER_COLOR_FLOAT_OPAQUE_BLACK :: BorderColor
- pattern BORDER_COLOR_INT_OPAQUE_BLACK :: BorderColor
- pattern BORDER_COLOR_FLOAT_OPAQUE_WHITE :: BorderColor
- pattern BORDER_COLOR_INT_OPAQUE_WHITE :: BorderColor
- pattern BORDER_COLOR_INT_CUSTOM_EXT :: BorderColor
- pattern BORDER_COLOR_FLOAT_CUSTOM_EXT :: BorderColor
- newtype Filter where
- Filter Int32
- pattern FILTER_NEAREST :: Filter
- pattern FILTER_LINEAR :: Filter
- pattern FILTER_CUBIC_IMG :: Filter
- newtype SamplerMipmapMode where
- newtype SamplerAddressMode where
- SamplerAddressMode Int32
- pattern SAMPLER_ADDRESS_MODE_REPEAT :: SamplerAddressMode
- pattern SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT :: SamplerAddressMode
- pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE :: SamplerAddressMode
- pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER :: SamplerAddressMode
- pattern SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE :: SamplerAddressMode
- newtype SamplerCreateFlagBits where
- type SamplerCreateFlags = SamplerCreateFlagBits
Documentation
Arguments
| :: forall a io. (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> SamplerCreateInfo a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io Sampler |
vkCreateSampler - Create a new sampler object
Valid Usage
- There must be less than
PhysicalDeviceLimits::maxSamplerAllocationCountVkSampler objects currently created on the device.
Valid Usage (Implicit)
devicemust be a validDevicehandle
pCreateInfomust be a valid pointer to a validSamplerCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure pSamplermust be a valid pointer to aSamplerhandle
Return Codes
See Also
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 first argument.
To just extract the pair pass (,) as the first argument.
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Sampler |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io () |
vkDestroySampler - Destroy a sampler object
Valid Usage
- All submitted commands that refer to
samplermust have completed execution
- If
AllocationCallbackswere provided whensamplerwas created, a compatible set of callbacks must be provided here - If no
AllocationCallbackswere provided whensamplerwas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validDevicehandle
- If
sampleris notNULL_HANDLE,samplermust be a validSamplerhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - If
sampleris a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
samplermust be externally synchronized
See Also
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. If maxSamplerAllocationCount is exceeded, createSampler
will return ERROR_TOO_MANY_OBJECTS.
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
mipLodBiasmust be less than or equal toPhysicalDeviceLimits::maxSamplerLodBias
maxLodmust be greater than or equal tominLod- If the
anisotropic sampling
feature is not enabled,
anisotropyEnablemust beFALSE - If
anisotropyEnableisTRUE,maxAnisotropymust be between1.0andPhysicalDeviceLimits::maxSamplerAnisotropy, inclusive - If
sampler Y′CBCR conversion
is enabled and the
potential format features
of the sampler Y′CBCR conversion do not support
FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT,minFilterandmagFiltermust be equal to the sampler Y′CBCR conversion’schromaFilter - If
unnormalizedCoordinatesisTRUE,minFilterandmagFiltermust be equal - If
unnormalizedCoordinatesisTRUE,mipmapModemust beSAMPLER_MIPMAP_MODE_NEAREST - If
unnormalizedCoordinatesisTRUE,minLodandmaxLodmust be zero - If
unnormalizedCoordinatesisTRUE,addressModeUandaddressModeVmust each be eitherSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEorSAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - If
unnormalizedCoordinatesisTRUE,anisotropyEnablemust beFALSE - If
unnormalizedCoordinatesisTRUE,compareEnablemust beFALSE - If any of
addressModeU,addressModeVoraddressModeWareSAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER,borderColormust be a validBorderColorvalue - If
sampler Y′CBCR conversion
is enabled,
addressModeU,addressModeV, andaddressModeWmust beSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,anisotropyEnablemust beFALSE, andunnormalizedCoordinatesmust beFALSE - The sampler reduction mode must be set to
SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGEif sampler Y′CBCR conversion is enabled - If
samplerMirrorClampToEdge
is not enabled, and if the
VK_KHR_sampler_mirror_clamp_to_edgeextension is not enabled,addressModeU,addressModeVandaddressModeWmust not beSAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE - If
compareEnableisTRUE,compareOpmust be a validCompareOpvalue - If either
magFilterorminFilterisFILTER_CUBIC_EXT,anisotropyEnablemust beFALSE - If
compareEnableisTRUE, thereductionModemember ofSamplerReductionModeCreateInfomust beSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenminFilterandmagFiltermust be equal - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenmipmapModemust beSAMPLER_MIPMAP_MODE_NEAREST - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenminLodandmaxLodmust be zero - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenaddressModeUandaddressModeVmust each be eitherSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEorSAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenanisotropyEnablemust beFALSE - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thencompareEnablemust beFALSE - If
flagsincludesSAMPLER_CREATE_SUBSAMPLED_BIT_EXT, thenunnormalizedCoordinatesmust beFALSE - If
borderColoris set to one ofBORDER_COLOR_FLOAT_CUSTOM_EXTorBORDER_COLOR_INT_CUSTOM_EXT, then aSamplerCustomBorderColorCreateInfoEXTmust be present in thepNextchain - If the
customBorderColors
feature is not enabled,
borderColormust not be set toBORDER_COLOR_FLOAT_CUSTOM_EXTorBORDER_COLOR_INT_CUSTOM_EXT - The maximum number of samplers with custom border colors which can
be simultaneously created on a device is implementation-dependent
and specified by the
maxCustomBorderColorSamplers
member of the
PhysicalDeviceCustomBorderColorPropertiesEXTstructure
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_SAMPLER_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofSamplerCustomBorderColorCreateInfoEXT,SamplerReductionModeCreateInfo, orSamplerYcbcrConversionInfo - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofSamplerCreateFlagBitsvaluesmagFiltermust be a validFiltervalueminFiltermust be a validFiltervaluemipmapModemust be a validSamplerMipmapModevalueaddressModeUmust be a validSamplerAddressModevalueaddressModeVmust be a validSamplerAddressModevalueaddressModeWmust be a validSamplerAddressModevalue
See Also
Bool32,
BorderColor,
CompareOp,
Filter,
SamplerAddressMode,
SamplerCreateFlags,
SamplerMipmapMode,
StructureType, createSampler
Constructors
| SamplerCreateInfo | |
Fields
| |
Instances
VkSampler - Opaque handle to a sampler object
See Also
DescriptorImageInfo,
DescriptorSetLayoutBinding,
ImageViewHandleInfoNVX,
createSampler,
destroySampler
Instances
| Eq Sampler Source # | |
| Ord Sampler Source # | |
Defined in Vulkan.Core10.Handles | |
| Show Sampler Source # | |
| Storable Sampler Source # | |
| Zero Sampler Source # | |
Defined in Vulkan.Core10.Handles | |
| HasObjectType Sampler Source # | |
Defined in Vulkan.Core10.Handles Methods objectTypeAndHandle :: Sampler -> (ObjectType, Word64) Source # | |
| IsHandle Sampler Source # | |
Defined in Vulkan.Core10.Handles | |
newtype BorderColor Source #
VkBorderColor - Specify border color used for texture lookups
Description
These colors are described in detail in Texel Replacement.
See Also
Constructors
| BorderColor Int32 |
Bundled Patterns
Instances
VkFilter - Specify filters used for texture lookups
Description
These filters are described in detail in Texel Filtering.
See Also
SamplerCreateInfo,
SamplerYcbcrConversionCreateInfo,
cmdBlitImage
Bundled Patterns
| pattern FILTER_NEAREST :: Filter |
|
| pattern FILTER_LINEAR :: Filter |
|
| pattern FILTER_CUBIC_IMG :: Filter |
Instances
| Eq Filter Source # | |
| Ord Filter Source # | |
| Read Filter Source # | |
| Show Filter Source # | |
| Storable Filter Source # | |
| Zero Filter Source # | |
Defined in Vulkan.Core10.Enums.Filter | |
newtype SamplerMipmapMode Source #
VkSamplerMipmapMode - Specify mipmap mode used for texture lookups
Description
These modes are described in detail in Texel Filtering.
See Also
Constructors
| SamplerMipmapMode Int32 |
Bundled Patterns
| pattern SAMPLER_MIPMAP_MODE_NEAREST :: SamplerMipmapMode |
|
| pattern SAMPLER_MIPMAP_MODE_LINEAR :: SamplerMipmapMode |
|
Instances
newtype SamplerAddressMode Source #
VkSamplerAddressMode - Specify behavior of sampling with texture coordinates outside an image
See Also
Constructors
| SamplerAddressMode Int32 |
Bundled Patterns
| pattern SAMPLER_ADDRESS_MODE_REPEAT :: SamplerAddressMode |
|
| pattern SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT :: SamplerAddressMode |
|
| pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE :: SamplerAddressMode |
|
| pattern SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER :: SamplerAddressMode |
|
| pattern SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE :: SamplerAddressMode |
|
Instances
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
Constructors
| SamplerCreateFlagBits Flags |
Bundled Patterns
| pattern SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT :: SamplerCreateFlagBits |
|
| pattern SAMPLER_CREATE_SUBSAMPLED_BIT_EXT :: SamplerCreateFlagBits |
|