Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- createShaderModule :: forall a io. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io ShaderModule
- withShaderModule :: forall a io r. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> (io ShaderModule -> (ShaderModule -> io ()) -> r) -> r
- destroyShaderModule :: forall io. MonadIO io => Device -> ShaderModule -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data ShaderModuleCreateInfo (es :: [Type]) = ShaderModuleCreateInfo {
- next :: Chain es
- flags :: ShaderModuleCreateFlags
- code :: ByteString
- newtype ShaderModule = ShaderModule Word64
- newtype ShaderModuleCreateFlags = ShaderModuleCreateFlags Flags
Documentation
:: forall a io. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) | |
=> Device |
|
-> ShaderModuleCreateInfo a |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io ShaderModule |
vkCreateShaderModule - Creates a new shader module object
Description
Once a shader module has been created, any entry points it contains can be used in pipeline shader stages as described in Compute Pipelines and Graphics Pipelines.
Note
If the
maintenance5
feature is enabled, shader module creation can be omitted entirely.
Instead, applications should provide the ShaderModuleCreateInfo
structure directly in to pipeline creation by chaining it to
PipelineShaderStageCreateInfo
. This avoids the
overhead of creating and managing an additional object.
Valid Usage
- If
pCreateInfo
is notNULL
,pCreateInfo->pNext
must beNULL
or a pointer to aShaderModuleValidationCacheCreateInfoEXT
structure
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pCreateInfo
must be a valid pointer to a validShaderModuleCreateInfo
structure - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure -
pShaderModule
must be a valid pointer to aShaderModule
handle
Return Codes
See Also
VK_VERSION_1_0,
AllocationCallbacks
,
Device
, ShaderModule
,
ShaderModuleCreateInfo
withShaderModule :: forall a io r. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> (io ShaderModule -> (ShaderModule -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createShaderModule
and destroyShaderModule
To ensure that destroyShaderModule
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.
:: forall io. MonadIO io | |
=> Device |
|
-> ShaderModule |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io () |
vkDestroyShaderModule - Destroy a shader module
Description
A shader module can be destroyed while pipelines created using its shaders are still in use.
Valid Usage
- If
AllocationCallbacks
were provided whenshaderModule
was created, a compatible set of callbacks must be provided here
- If no
AllocationCallbacks
were provided whenshaderModule
was created,pAllocator
must beNULL
Valid Usage (Implicit)
-
device
must be a validDevice
handle
- If
shaderModule
is notNULL_HANDLE
,shaderModule
must be a validShaderModule
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure - If
shaderModule
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
shaderModule
must be externally synchronized
See Also
data ShaderModuleCreateInfo (es :: [Type]) Source #
VkShaderModuleCreateInfo - Structure specifying parameters of a newly created shader module
Valid Usage
- If pCode is a pointer to
SPIR-V code,
pCode
must point to valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification - If pCode is a pointer to
SPIR-V code,
pCode
must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix - If pCode is a pointer to
SPIR-V code,
pCode
must declare theShader
capability for SPIR-V code - If pCode is a pointer to
SPIR-V code,
pCode
must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix - If pCode is a pointer to
SPIR-V code, and
pCode
declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied - If pCode is a pointer to
SPIR-V code,
pCode
must not declare any SPIR-V extension that is not supported by the API, as described by the Extension section of the SPIR-V Environment appendix - If pCode is a pointer to
SPIR-V code, and
pCode
declares any of the SPIR-V extensions listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied - If the
VK_NV_glsl_shader
extension is not enabled,
pCode
must be a pointer to SPIR-V code - If
pCode
is a pointer to GLSL code, it must be valid GLSL code written to theGL_KHR_vulkan_glsl
GLSL extension specification -
codeSize
must be greater than 0
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
-
flags
must be0
-
pCode
must be a valid pointer to an array of \(\textrm{codeSize} \over 4\)uint32_t
values
See Also
VK_VERSION_1_0,
ShaderModuleCreateFlags
,
StructureType
, createShaderModule
,
getShaderModuleCreateInfoIdentifierEXT
ShaderModuleCreateInfo | |
|
Instances
newtype ShaderModule Source #
VkShaderModule - Opaque handle to a shader module object
See Also
VK_VERSION_1_0,
PipelineShaderStageCreateInfo
,
createShaderModule
,
destroyShaderModule
,
getShaderModuleIdentifierEXT
Instances
newtype ShaderModuleCreateFlags Source #
VkShaderModuleCreateFlags - Reserved for future use
Description
ShaderModuleCreateFlags
is a bitmask type for setting a mask, but is
currently reserved for future use.