createShader

fun GpuDevice.createShader(code: ByteArray, format: ShaderFormat, stage: ShaderStage, entryPoint: String, samplers: Int = 0, storageTextures: Int = 0, storageBuffers: Int = 0, uniformBuffers: Int = 0): GpuShader(source)

Creates a shader for stage from code in format. The resource counts must match what the shader declares, or binding at draw time fails. Pass the Int counts by name.

Throws

if code is empty or a count is negative.

if the backend rejects the shader.


Creates the backend's shader from shader, picking the format this device supports.

Throws

if the backend rejects the shader.