| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Sampler
- newtype VkBorderColor = VkBorderColor Int32
- pattern VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK :: VkBorderColor
- pattern VK_BORDER_COLOR_INT_TRANSPARENT_BLACK :: VkBorderColor
- pattern VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK :: VkBorderColor
- pattern VK_BORDER_COLOR_INT_OPAQUE_BLACK :: VkBorderColor
- pattern VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE :: VkBorderColor
- pattern VK_BORDER_COLOR_INT_OPAQUE_WHITE :: VkBorderColor
- newtype VkSamplerAddressMode = VkSamplerAddressMode Int32
- pattern VK_SAMPLER_ADDRESS_MODE_REPEAT :: VkSamplerAddressMode
- pattern VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT :: VkSamplerAddressMode
- pattern VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE :: VkSamplerAddressMode
- pattern VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER :: VkSamplerAddressMode
- newtype VkFilter = VkFilter Int32
- pattern VK_FILTER_NEAREST :: VkFilter
- pattern VK_FILTER_LINEAR :: VkFilter
- newtype VkSamplerMipmapMode = VkSamplerMipmapMode Int32
- pattern VK_SAMPLER_MIPMAP_MODE_NEAREST :: VkSamplerMipmapMode
- pattern VK_SAMPLER_MIPMAP_MODE_LINEAR :: VkSamplerMipmapMode
- newtype VkSamplerCreateFlags = VkSamplerCreateFlags VkFlags
- type VkSampler = Ptr VkSampler_T
- vkCreateSampler :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkSamplerCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pSampler" ::: Ptr VkSampler) -> IO VkResult
- vkDestroySampler :: ("device" ::: VkDevice) -> ("sampler" ::: VkSampler) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO ()
- data VkSamplerCreateInfo = VkSamplerCreateInfo {
- vkSType :: VkStructureType
- vkPNext :: Ptr ()
- vkFlags :: VkSamplerCreateFlags
- vkMagFilter :: VkFilter
- vkMinFilter :: VkFilter
- vkMipmapMode :: VkSamplerMipmapMode
- vkAddressModeU :: VkSamplerAddressMode
- vkAddressModeV :: VkSamplerAddressMode
- vkAddressModeW :: VkSamplerAddressMode
- vkMipLodBias :: CFloat
- vkAnisotropyEnable :: VkBool32
- vkMaxAnisotropy :: CFloat
- vkCompareEnable :: VkBool32
- vkCompareOp :: VkCompareOp
- vkMinLod :: CFloat
- vkMaxLod :: CFloat
- vkBorderColor :: VkBorderColor
- vkUnnormalizedCoordinates :: VkBool32
Documentation
newtype VkBorderColor Source #
VkBorderColor - Specify border color used for texture lookups
Description
VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACKspecifies a transparent, floating-point format, black color.
VK_BORDER_COLOR_INT_TRANSPARENT_BLACKspecifies a transparent, integer format, black color.VK_BORDER_COLOR_FLOAT_OPAQUE_BLACKspecifies an opaque, floating-point format, black color.VK_BORDER_COLOR_INT_OPAQUE_BLACKspecifies an opaque, integer format, black color.VK_BORDER_COLOR_FLOAT_OPAQUE_WHITEspecifies an opaque, floating-point format, white color.VK_BORDER_COLOR_INT_OPAQUE_WHITEspecifies an opaque, integer format, white color.
These colors are described in detail in Texel Replacement.
See Also
Constructors
| VkBorderColor Int32 |
pattern VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK :: VkBorderColor Source #
pattern VK_BORDER_COLOR_INT_OPAQUE_BLACK :: VkBorderColor Source #
pattern VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE :: VkBorderColor Source #
pattern VK_BORDER_COLOR_INT_OPAQUE_WHITE :: VkBorderColor Source #
newtype VkSamplerAddressMode Source #
VkSamplerAddressMode - Specify behavior of sampling with texture coordinates outside an image
See Also
Constructors
| VkSamplerAddressMode Int32 |
pattern VK_SAMPLER_ADDRESS_MODE_REPEAT :: VkSamplerAddressMode Source #
VK_SAMPLER_ADDRESS_MODE_REPEAT specifies that the repeat wrap mode
will be used.
pattern VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT :: VkSamplerAddressMode Source #
VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT specifies that the mirrored
repeat wrap mode will be used.
pattern VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE :: VkSamplerAddressMode Source #
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE specifies that the clamp to edge
wrap mode will be used.
pattern VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER :: VkSamplerAddressMode Source #
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER specifies that the clamp to
border wrap mode will be used.
VkFilter - Specify filters used for texture lookups
Description
VK_FILTER_NEARESTspecifies nearest filtering.
VK_FILTER_LINEARspecifies linear filtering.VK_FILTER_CUBIC_IMGspecifies cubic filtering.
These filters are described in detail in Texel Filtering.
See Also
VkSamplerCreateInfo,
VkSamplerYcbcrConversionCreateInfo,
vkCmdBlitImage
pattern VK_FILTER_NEAREST :: VkFilter Source #
pattern VK_FILTER_LINEAR :: VkFilter Source #
newtype VkSamplerMipmapMode Source #
VkSamplerMipmapMode - Specify mipmap mode used for texture lookups
Description
VK_SAMPLER_MIPMAP_MODE_NEARESTspecifies nearest filtering.
VK_SAMPLER_MIPMAP_MODE_LINEARspecifies linear filtering.
These modes are described in detail in Texel Filtering.
See Also
Constructors
| VkSamplerMipmapMode Int32 |
pattern VK_SAMPLER_MIPMAP_MODE_NEAREST :: VkSamplerMipmapMode Source #
pattern VK_SAMPLER_MIPMAP_MODE_LINEAR :: VkSamplerMipmapMode Source #
newtype VkSamplerCreateFlags Source #
VkSamplerCreateFlags - Reserved for future use
Description
VkSamplerCreateFlags is a bitmask type for setting a mask, but is
currently reserved for future use.
See Also
Constructors
| VkSamplerCreateFlags VkFlags |
type VkSampler = Ptr VkSampler_T Source #
VkSampler - Opaque handle to a sampler object
Description
See Also
VkDescriptorImageInfo,
VkDescriptorSetLayoutBinding,
vkCreateSampler, vkDestroySampler
vkCreateSampler :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkSamplerCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pSampler" ::: Ptr VkSampler) -> IO VkResult Source #
vkCreateSampler - Create a new sampler object
Parameters
deviceis the logical device that creates the sampler.
pCreateInfois a pointer to an instance of theVkSamplerCreateInfostructure specifying the state of the sampler object.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pSamplerpoints to aVkSamplerhandle in which the resulting sampler object is returned.
Description
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
pCreateInfomust be a valid pointer to a validVkSamplerCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pSamplermust be a valid pointer to aVkSamplerhandle
Return Codes
- Success
- -
VK_SUCCESS
- Failure
- -
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
VK_ERROR_TOO_MANY_OBJECTS
See Also
VkAllocationCallbacks,
VkDevice, VkSampler,
VkSamplerCreateInfo
vkDestroySampler :: ("device" ::: VkDevice) -> ("sampler" ::: VkSampler) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #
vkDestroySampler - Destroy a sampler object
Parameters
deviceis the logical device that destroys the sampler.
sampleris the sampler to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
samplermust have completed execution
- If
VkAllocationCallbackswere provided whensamplerwas created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbackswere provided whensamplerwas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
- If
sampleris notVK_NULL_HANDLE,samplermust be a validVkSamplerhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure - 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 VkSamplerCreateInfo Source #
VkSamplerCreateInfo - Structure specifying parameters of a newly created sampler
Members
sTypeis the type of this structure.
pNextisNULLor a pointer to an extension-specific structure.flagsis reserved for future use.magFilteris aVkFiltervalue specifying the magnification filter to apply to lookups.minFilteris aVkFiltervalue specifying the minification filter to apply to lookups.mipmapModeis aVkSamplerMipmapModevalue specifying the mipmap filter to apply to lookups.addressModeUis aVkSamplerAddressModevalue specifying the addressing mode for outside [0..1] range for U coordinate.addressModeVis aVkSamplerAddressModevalue specifying the addressing mode for outside [0..1] range for V coordinate.addressModeWis aVkSamplerAddressModevalue specifying the addressing mode for outside [0..1] range for W coordinate.mipLodBiasis the bias to be added to mipmap LOD (level-of-detail) calculation and bias provided by image sampling functions in SPIR-V, as described in the Level-of-Detail Operation section.anisotropyEnableisVK_TRUEto enable anisotropic filtering, as described in the Texel Anisotropic Filtering section, orVK_FALSEotherwise.maxAnisotropyis the anisotropy value clamp used by the sampler whenanisotropyEnableisVK_TRUE. IfanisotropyEnableisVK_FALSE,maxAnisotropyis ignored.compareEnableisVK_TRUEto enable comparison against a reference value during lookups, orVK_FALSEotherwise.- Note: Some implementations will default to shader state if this member does not match.
compareOpis aVkCompareOpvalue specifying the comparison function to apply to fetched data before filtering as described in the Depth Compare Operation section.minLodandmaxLodare the values used to clamp the computed LOD value, as described in the Level-of-Detail Operation section.maxLodmust be greater than or equal tominLod.borderColoris aVkBorderColorvalue specifying the predefined border color to use.unnormalizedCoordinatescontrols whether to use unnormalized or normalized texel coordinates to address texels of the image. When set toVK_TRUE, the range of the image coordinates used to lookup the texel is in the range of zero to the image dimensions for x, y and z. When set toVK_FALSEthe range of image coordinates is zero to one. WhenunnormalizedCoordinatesisVK_TRUE, samplers have the following requirements:minFilterandmagFiltermust be equal.mipmapModemust beVK_SAMPLER_MIPMAP_MODE_NEAREST.minLodandmaxLodmust be zero.addressModeUandaddressModeVmust each be eitherVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEorVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER.anisotropyEnablemust beVK_FALSE.compareEnablemust beVK_FALSE.- The sampler must not enable sampler Y’CBCR conversion.
When
unnormalizedCoordinatesisVK_TRUE, images the sampler is used with in the shader have the following requirements:- The
viewTypemust be eitherVK_IMAGE_VIEW_TYPE_1DorVK_IMAGE_VIEW_TYPE_2D. - The image view must have a single layer and a single mip level.
- The
When
unnormalizedCoordinatesisVK_TRUE, image built-in functions in the shader that use the sampler have the following requirements:- The functions must not use projection.
- The functions must not use offsets.
Description
Note
magFilter values of VK_FILTER_NEAREST and VK_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 VK_FILTER_LINEAR
and mipmapMode of VK_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 VK_SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and
maxLod = 0.25, and using minFilter = VK_FILTER_LINEAR or
minFilter = VK_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
VkPhysicalDeviceLimits
structure. If maxSamplerAllocationCount is exceeded, vkCreateSampler
will return VK_ERROR_TOO_MANY_OBJECTS.
Since VkSampler 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 toVkPhysicalDeviceLimits::maxSamplerLodBias
- If the
anisotropic sampling
feature is not enabled,
anisotropyEnablemust beVK_FALSE - If
anisotropyEnableisVK_TRUE,maxAnisotropymust be between1.0andVkPhysicalDeviceLimits::maxSamplerAnisotropy, inclusive - If
sampler Y’CBCR conversion
is enabled and
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BITis not set for the format,minFilterandmagFiltermust be equal to the sampler Y’CBCR conversion’schromaFilter - If
unnormalizedCoordinatesisVK_TRUE,minFilterandmagFiltermust be equal - If
unnormalizedCoordinatesisVK_TRUE,mipmapModemust beVK_SAMPLER_MIPMAP_MODE_NEAREST - If
unnormalizedCoordinatesisVK_TRUE,minLodandmaxLodmust be zero - If
unnormalizedCoordinatesisVK_TRUE,addressModeUandaddressModeVmust each be eitherVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEorVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER - If
unnormalizedCoordinatesisVK_TRUE,anisotropyEnablemust beVK_FALSE - If
unnormalizedCoordinatesisVK_TRUE,compareEnablemust beVK_FALSE - If any of
addressModeU,addressModeVoraddressModeWareVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER,borderColormust be a validVkBorderColorvalue - If
sampler Y’CBCR conversion
is enabled,
addressModeU,addressModeV, andaddressModeWmust beVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,anisotropyEnablemust beVK_FALSE, andunnormalizedCoordinatesmust beVK_FALSE - The sampler reduction mode must be set to
VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXTif sampler Y’CBCR conversion is enabled - If the
{html_spec_relative}#VK_KHR_sampler_mirror_clamp_to_edgeextension is not enabled,addressModeU,addressModeVandaddressModeWmust not beVK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE - If
compareEnableisVK_TRUE,compareOpmust be a validVkCompareOpvalue - If either
magFilterorminFilterisVK_FILTER_CUBIC_IMG,anisotropyEnablemust beVK_FALSE - If either
magFilterorminFilterisVK_FILTER_CUBIC_IMG, thereductionModemember ofVkSamplerReductionModeCreateInfoEXTmust beVK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT - If
compareEnableisVK_TRUE, thereductionModemember ofVkSamplerReductionModeCreateInfoEXTmust beVK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT
Valid Usage (Implicit)
sTypemust beVK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofVkSamplerReductionModeCreateInfoEXTorVkSamplerYcbcrConversionInfo - Each
sTypemember in thepNextchain must be unique flagsmust be0magFiltermust be a validVkFiltervalueminFiltermust be a validVkFiltervaluemipmapModemust be a validVkSamplerMipmapModevalueaddressModeUmust be a validVkSamplerAddressModevalueaddressModeVmust be a validVkSamplerAddressModevalueaddressModeWmust be a validVkSamplerAddressModevalue
See Also
VkBool32, VkBorderColor,
VkCompareOp, VkFilter,
VkSamplerAddressMode, VkSamplerCreateFlags, VkSamplerMipmapMode,
VkStructureType, vkCreateSampler
Constructors