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.Sampler

  • 9 types
  • 3 values
  • Packagevulkan-3.27
  • Exports43
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceSampler.hs
valuecreateSampler
  1. :: (Extendss SamplerCreateInfo a, PokeChain a, MonadIO io)
  2. => Device

    device is the logical device that creates the sampler.

  3. -> SamplerCreateInfo a

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

  4. -> "allocator" ::: Maybe AllocationCallbacks

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

  5. -> 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

valuedestroySampler
  1. :: MonadIO io
  2. => Device

    device is the logical device that destroys the sampler.

  3. -> Sampler

    sampler is the sampler to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

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

  5. -> 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

datadata SamplerCreateInfo (es :: [Type])
#

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.

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.

When this structure is used to write a descriptor via writeSamplerDescriptorsEXT, applications can give the descriptor a debug name in a similar way to naming an object, via the DebugUtilsObjectNameInfoEXT structure. However, as there is no actual object, DebugUtilsObjectNameInfoEXT must be passed via the pNext chain of this structure, with a objectType of OBJECT_TYPE_UNKNOWN and a objectHandle of NULL_HANDLE. The name is attached to the unique set of descriptor bits written by the implementation, and writing the same bits again with new debug info may rename the original descriptor.

Implementations are not prevented from returning the same bits for different descriptors. This can result in multiple different samplers mapping to the same name.

DescriptorSetAndBindingMappingEXT can also be chained in the same way when defining an embedded sampler via DescriptorSetAndBindingMappingEXT, naming the embedded sampler.

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, DescriptorMappingSourceConstantOffsetEXT, DescriptorMappingSourceIndirectIndexArrayEXT, DescriptorMappingSourceIndirectIndexEXT, DescriptorMappingSourcePushIndexEXT, DescriptorMappingSourceShaderRecordIndexEXT, Filter, SamplerAddressMode, SamplerCreateFlags, SamplerMipmapMode, StructureType, createSampler, writeSamplerDescriptorsEXT

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
newtypenewtype Sampler
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
newtypenewtype BorderColor
#

VkBorderColor - Specify border color used for texture lookups

Description

These colors are described in detail in Border Replacement.

See Also

VK_VERSION_1_0, SamplerCreateInfo

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype Filter
#

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

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
  • Ord FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
  • Read FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
  • Show FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
  • Storable FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
  • Zero FilterDefined in vulkan-3.27 · Vulkan.Core10.Enums.Filter
newtypenewtype SamplerMipmapMode
#

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

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype SamplerAddressMode
#

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

Description

See Also

VK_VERSION_1_0, SamplerCreateInfo

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype CompareOp
#

VkCompareOp - Comparison operator for depth, stencil, and sampler operations

Description

Comparison operators are used for:

Each such use describes how the reference and test values for that comparison are determined.

See Also

VK_VERSION_1_0, PipelineDepthStencilStateCreateInfo, SamplerCreateInfo, StencilOpState, cmdSetDepthCompareOp, cmdSetDepthCompareOp, cmdSetStencilOp, cmdSetStencilOp

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
  • Ord CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
  • Read CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
  • Show CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
  • Storable CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
  • Zero CompareOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.CompareOp
newtypenewtype SamplerCreateFlagBits
#

VkSamplerCreateFlagBits - Bitmask specifying additional parameters of sampler

Description

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

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …