Struct wgpu::ShaderModule
source · pub struct ShaderModule { /* private fields */ }Expand description
Handle to a compiled shader module.
A ShaderModule represents a compiled shader module on the GPU. It can be created by passing
source code to Device::create_shader_module or valid SPIR-V binary to
Device::create_shader_module_spirv. Shader modules are used to define programmable stages
of a pipeline.
Corresponds to WebGPU GPUShaderModule.
Implementations§
source§impl ShaderModule
impl ShaderModule
sourcepub fn global_id(&self) -> Id
Available on crate feature expose-ids only.
pub fn global_id(&self) -> Id
expose-ids only.Returns a globally-unique identifier for this ShaderModule.
Calling this method multiple times on the same object will always return the same value.
The returned value is guaranteed to be different for all resources created from the same Instance.