| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Shader
Synopsis
- createShaderModule :: forall a io. (PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io ShaderModule
- withShaderModule :: forall a io r. (PokeChain a, MonadIO io) => (io ShaderModule -> (ShaderModule -> io ()) -> r) -> Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> r
- destroyShaderModule :: forall io. MonadIO io => Device -> ShaderModule -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data ShaderModuleCreateInfo (es :: [Type]) = ShaderModuleCreateInfo {
- next :: Chain es
- flags :: ShaderModuleCreateFlags
- code :: ByteString
Documentation
createShaderModule :: forall a io. (PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io ShaderModule Source #
vkCreateShaderModule - Creates a new shader module object
Parameters
deviceis the logical device that creates the shader module.
pCreateInfois a pointer to aShaderModuleCreateInfostructure.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pShaderModuleis a pointer to aShaderModulehandle 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 VK_EXT_debug_report if enabled.
Valid Usage (Implicit)
devicemust be a validDevicehandle
pCreateInfomust be a valid pointer to a validShaderModuleCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure pShaderModulemust be a valid pointer to aShaderModulehandle
Return Codes
See Also
AllocationCallbacks,
Device,
ShaderModule, ShaderModuleCreateInfo
withShaderModule :: forall a io r. (PokeChain a, MonadIO io) => (io ShaderModule -> (ShaderModule -> io ()) -> r) -> Device -> ShaderModuleCreateInfo a -> Maybe AllocationCallbacks -> 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 first argument.
To just extract the pair pass '(,)' as the first argument.
destroyShaderModule :: forall io. MonadIO io => Device -> ShaderModule -> ("allocator" ::: Maybe AllocationCallbacks) -> io () Source #
vkDestroyShaderModule - Destroy a shader module
Parameters
deviceis the logical device that destroys the shader module.
shaderModuleis the handle of the shader module to destroy.pAllocatorcontrols 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
AllocationCallbackswere provided whenshaderModulewas created, a compatible set of callbacks must be provided here
- If no
AllocationCallbackswere provided whenshaderModulewas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validDevicehandle
- If
shaderModuleis notNULL_HANDLE,shaderModulemust be a validShaderModulehandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - If
shaderModuleis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
shaderModulemust be externally synchronized
See Also
data ShaderModuleCreateInfo (es :: [Type]) Source #
VkShaderModuleCreateInfo - Structure specifying parameters of a newly created shader module
Valid Usage
codeSizemust be greater than 0
- If
pCodeis a pointer to SPIR-V code,codeSizemust be a multiple of 4 pCodemust 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_glslextension specification- If
pCodeis 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
pCodeis a pointer to GLSL code, it must be valid GLSL code written to theGL_KHR_vulkan_glslGLSL extension specification pCodemust declare theShadercapability for SPIR-V codepCodemust not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix- If
pCodedeclares any of the capabilities listed as optional in the SPIR-V Environment appendix, the corresponding feature(s) must be enabled
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
pNextmust beNULLor a pointer to a valid instance ofShaderModuleValidationCacheCreateInfoEXT- The
sTypevalue of each struct in thepNextchain must be unique flagsmust be0pCodemust be a valid pointer to an array of \(\textrm{codeSize} \over 4\)uint32_tvalues
See Also
Constructors
| ShaderModuleCreateInfo | |
Fields
| |