Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- createShaderModule :: PokeChain a => Device -> ShaderModuleCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ShaderModule
- withShaderModule :: PokeChain a => Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> (ShaderModule -> IO r) -> IO r
- destroyShaderModule :: Device -> ShaderModule -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ()
- data ShaderModuleCreateInfo (es :: [Type]) = ShaderModuleCreateInfo {
- next :: Chain es
- flags :: ShaderModuleCreateFlags
- code :: ByteString
Documentation
createShaderModule :: PokeChain a => Device -> ShaderModuleCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ShaderModule Source #
vkCreateShaderModule - Creates a new shader module object
Parameters
Device
is the logical device that creates the shader module.
pCreateInfo
is a pointer to aShaderModuleCreateInfo
structure.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pShaderModule
is a pointer to aShaderModule
handle in which the resulting shader module object is returned.
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.
If the shader stage fails to compile
ERROR_INVALID_SHADER_NV
will be
generated and the compile log will be reported back to the application
by
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_debug_report
if enabled.
Valid Usage (Implicit)
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
AllocationCallbacks
,
Device
,
ShaderModule
, ShaderModuleCreateInfo
withShaderModule :: PokeChain a => Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> (ShaderModule -> IO r) -> IO r Source #
A safe wrapper for createShaderModule
and destroyShaderModule
using
bracket
The allocated value must not be returned from the provided computation
destroyShaderModule :: Device -> ShaderModule -> ("allocator" ::: Maybe AllocationCallbacks) -> IO () Source #
vkDestroyShaderModule - Destroy a shader module
Parameters
Device
is the logical device that destroys the shader module.
ShaderModule
is the handle of the shader module to destroy.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
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)
- 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
codeSize
must be greater than 0
- If
pCode
is a pointer to SPIR-V code,codeSize
must be a multiple of 4 pCode
must point to either valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification or valid GLSL code which must be written to theGL_KHR_vulkan_glsl
extension specification- If
pCode
is a pointer to SPIR-V code, that code 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 GLSL code, it must be valid GLSL code written to theGL_KHR_vulkan_glsl
GLSL extension specification pCode
must declare theShader
capability for SPIR-V codepCode
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
declares any of the capabilities listed as optional in the SPIR-V Environment appendix, the corresponding feature(s) must be enabled.
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
pNext
must beNULL
or a pointer to a valid instance ofShaderModuleValidationCacheCreateInfoEXT
- The
sType
value of each struct in thepNext
chain must be unique Flags
must be0
pCode
must be a valid pointer to an array of \(\textrm{codeSize} \over 4\)uint32_t
values
See Also
ShaderModuleCreateInfo | |
|