Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ShaderModule
- data ShaderModuleDescriptor = ShaderModuleDescriptor {
- shaderLabel :: !Text
- source :: !ShaderSource
- data ShaderSource
- newtype SPIRV = SPIRV ByteString
- newtype WGSL = WGSL Text
- newtype ShaderEntryPoint = ShaderEntryPoint {}
- createShaderModule :: Device -> ShaderModuleDescriptor -> IO ShaderModule
- createShaderModuleSPIRV :: Device -> Text -> SPIRV -> IO ShaderModule
- createShaderModuleWGSL :: Device -> Text -> WGSL -> IO ShaderModule
Types
data ShaderModule Source #
Handle to a compiled shader module.
Instances
Eq ShaderModule Source # | |
Defined in WGPU.Internal.Shader (==) :: ShaderModule -> ShaderModule -> Bool # (/=) :: ShaderModule -> ShaderModule -> Bool # | |
Show ShaderModule Source # | |
Defined in WGPU.Internal.Shader showsPrec :: Int -> ShaderModule -> ShowS # show :: ShaderModule -> String # showList :: [ShaderModule] -> ShowS # | |
ToRaw ShaderModule WGPUShaderModule Source # | |
Defined in WGPU.Internal.Shader raw :: ShaderModule -> ContT c IO WGPUShaderModule Source # |
data ShaderModuleDescriptor Source #
Descriptor for a shader module.
ShaderModuleDescriptor | |
|
Instances
Eq ShaderModuleDescriptor Source # | |
Defined in WGPU.Internal.Shader | |
Show ShaderModuleDescriptor Source # | |
Defined in WGPU.Internal.Shader showsPrec :: Int -> ShaderModuleDescriptor -> ShowS # show :: ShaderModuleDescriptor -> String # showList :: [ShaderModuleDescriptor] -> ShowS # | |
ToRaw ShaderModuleDescriptor WGPUShaderModuleDescriptor Source # | |
Defined in WGPU.Internal.Shader |
data ShaderSource Source #
Source for a shader module.
ShaderSourceSPIRV !SPIRV | Use shader source from a SPIRV module (pre-compiled). |
ShaderSourceWGSL !WGSL | Use shader source from WGSL string. |
Instances
Eq ShaderSource Source # | |
Defined in WGPU.Internal.Shader (==) :: ShaderSource -> ShaderSource -> Bool # (/=) :: ShaderSource -> ShaderSource -> Bool # | |
Show ShaderSource Source # | |
Defined in WGPU.Internal.Shader showsPrec :: Int -> ShaderSource -> ShowS # show :: ShaderSource -> String # showList :: [ShaderSource] -> ShowS # |
Pre-compiled SPIRV module bytes.
WGSL shader source code.
newtype ShaderEntryPoint Source #
Name of a shader entry point.
Instances
Eq ShaderEntryPoint Source # | |
Defined in WGPU.Internal.Shader (==) :: ShaderEntryPoint -> ShaderEntryPoint -> Bool # (/=) :: ShaderEntryPoint -> ShaderEntryPoint -> Bool # | |
Show ShaderEntryPoint Source # | |
Defined in WGPU.Internal.Shader showsPrec :: Int -> ShaderEntryPoint -> ShowS # show :: ShaderEntryPoint -> String # showList :: [ShaderEntryPoint] -> ShowS # | |
IsString ShaderEntryPoint Source # | |
Defined in WGPU.Internal.Shader fromString :: String -> ShaderEntryPoint # | |
ToRawPtr ShaderEntryPoint CChar Source # | |
Defined in WGPU.Internal.Shader |
Functions
:: Device | Device for the shader. |
-> ShaderModuleDescriptor | Descriptor of the shader module. |
-> IO ShaderModule | IO action producing the shader module. |
Create a shader module from either SPIR-V or WGSL source code.
createShaderModuleSPIRV Source #
:: Device | Device for which the shader should be created. |
-> Text | Debugging label for the shader. |
-> SPIRV | Shader source code (SPIR-V bytestring). |
-> IO ShaderModule | IO action creating the shader module. |
Create a shader module from SPIR-V source code.
createShaderModuleWGSL Source #
:: Device | Device for which the shader should be created. |
-> Text | Debugging label for the shader. |
-> WGSL | Shader source code (WGSL source string). |
-> IO ShaderModule | IO action creating the shader module. |
Create a shader module from WGSL source code.