You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GPURenderPipeline class represents a pre-compiled render pipeline that defines the vertex processing, fragment processing, and fixed-function state (blending, depth/stencil, rasterization) for rendering operations. Created via GPUDevice.CreateRenderPipeline() or GPUDevice.CreateRenderPipelineAsync().
Constructors
Signature
Description
GPURenderPipeline(SpawnJSObjectReference _ref)
Deserialization constructor.
Properties
Property
Type
Description
Label
string?
A label for debugging.
Methods
Method
Return Type
Description
GetBindGroupLayout(int index)
GPUBindGroupLayout
Returns the GPUBindGroupLayout at the given index. Useful when using "auto" layout.
GPURenderPipelineDescriptor
The descriptor used to create a render pipeline:
Property
Type
Description
Layout
Union<GPUPipelineLayout, string>
The pipeline layout, or "auto" for automatic layout.
Vertex
GPUVertexState
Vertex shader configuration (module, entry point, buffer layouts).
Fragment
GPUFragmentState?
Fragment shader configuration (module, entry point, color targets).
Primitive
GPUPrimitiveState?
Primitive assembly config (topology, front face, cull mode).
DepthStencil
GPUDepthStencilState?
Depth/stencil configuration.
Multisample
GPUMultisampleState?
Multisample anti-aliasing configuration.
Example
usingvarpipeline=device.CreateRenderPipeline(newGPURenderPipelineDescriptor{Layout="auto",Vertex=newGPUVertexState{Module=shaderModule,EntryPoint="vertexMain",Buffers=newGPUVertexBufferLayout[]{newGPUVertexBufferLayout{ArrayStride=20,// 5 floats * 4 bytesStepMode="vertex",Attributes=newGPUVertexAttribute[]{newGPUVertexAttribute{Format="float32x3",Offset=0,ShaderLocation=0},newGPUVertexAttribute{Format="float32x2",Offset=12,ShaderLocation=1}}}}},Fragment=newGPUFragmentState{Module=shaderModule,EntryPoint="fragmentMain",Targets=newGPUColorTargetState[]{newGPUColorTargetState{Format="bgra8unorm"}}},Primitive=newGPUPrimitiveState{Topology="triangle-list",CullMode="back",FrontFace="ccw"},DepthStencil=newGPUDepthStencilState{Format="depth24plus",DepthWriteEnabled=true,DepthCompare="less"}});// Get auto-generated bind group layoutusingvarbindGroupLayout=pipeline.GetBindGroupLayout(0);