Abstract Class: Shader
Defined in: modules/core/src/adapter/resources/shader.ts:34
Immutable Shader object In WebGPU the handle can be copied between threads
Extends
Constructors
Constructor
new Shader(
device,props):Shader
Defined in: modules/core/src/adapter/resources/shader.ts:47
Create a new Shader instance
Parameters
device
props
Returns
Shader
Overrides
Properties
compilationStatus
compilationStatus:
"error"|"pending"|"success"='pending'
Defined in: modules/core/src/adapter/resources/shader.ts:44
The compilation status of the shader. 'pending' if compilation is asynchronous, and on production
destroyed
destroyed:
boolean=false
Defined in: modules/core/src/adapter/resources/resource.ts:131
Whether this resource has been destroyed
Inherited from
device
abstractreadonlydevice:Device
Defined in: modules/core/src/adapter/resources/resource.ts:124
The device that this resource is associated with
Inherited from
handle
abstractreadonlyhandle:unknown
Defined in: modules/core/src/adapter/resources/resource.ts:126
The handle for the underlying resource, e.g. WebGL object or WebGPU handle
Inherited from
id
id:
string
Defined in: modules/core/src/adapter/resources/resource.ts:118
props.id, for debugging.
Inherited from
props
readonlyprops:Required<Props>
Defined in: modules/core/src/adapter/resources/resource.ts:120
The props that this resource was created with
Inherited from
source
readonlysource:string
Defined in: modules/core/src/adapter/resources/shader.ts:42
The source code of this shader
stage
readonlystage:"vertex"|"fragment"|"compute"
Defined in: modules/core/src/adapter/resources/shader.ts:40
The stage of this shader
userData
readonlyuserData:Record<string,unknown> ={}
Defined in: modules/core/src/adapter/resources/resource.ts:122
User data object, reserved for the application
Inherited from
defaultProps
staticdefaultProps:Required<ShaderProps>
Defined in: modules/core/src/adapter/resources/shader.ts:147
Default properties for resource
Overrides
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: modules/core/src/adapter/resources/shader.ts:35
Returns
string
Overrides
asyncCompilationStatus
Get Signature
get
abstractasyncCompilationStatus():Promise<"error"|"pending"|"success">
Defined in: modules/core/src/adapter/resources/shader.ts:54
Returns
Promise<"error" | "pending" | "success">
isHandleBorrowed
Get Signature
get isHandleBorrowed():
boolean
Defined in: modules/core/src/adapter/resources/resource.ts:147
Whether luma.gl may only reference the opaque externally owned resource handle.
Returns
boolean
Inherited from
ownsHandle
Get Signature
get ownsHandle():
boolean
Defined in: modules/core/src/adapter/resources/resource.ts:140
Whether luma.gl created and owns the underlying resource handle.
Returns
boolean
Inherited from
Methods
attachResource()
attachResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:200
Attaches a resource. Attached resources are auto destroyed when this resource is destroyed Called automatically when sub resources are auto created but can be called by application
Parameters
resource
Returns
void
Inherited from
debugShader()
debugShader():
Promise<void>
Defined in: modules/core/src/adapter/resources/shader.ts:72
In browser logging of errors
Returns
Promise<void>
delete()
delete():
this
Defined in: modules/core/src/adapter/resources/resource.ts:181
Returns
this
Deprecated
Use destroy()
Inherited from
destroy()
destroy():
void
Defined in: modules/core/src/adapter/resources/resource.ts:173
destroy can be called on any resource to release it before it is garbage collected.
Returns
void
Inherited from
destroyAttachedResource()
destroyAttachedResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:214
Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.
Parameters
resource
Returns
void
Inherited from
Resource.destroyAttachedResource
destroyAttachedResources()
destroyAttachedResources():
void
Defined in: modules/core/src/adapter/resources/resource.ts:221
Destroy all owned resources. Make sure the resources are no longer needed before calling.
Returns
void
Inherited from
Resource.destroyAttachedResources
detachResource()
detachResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:207
Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.
Parameters
resource
Returns
void
Inherited from
getCompilationInfo()
abstractgetCompilationInfo():Promise<readonlyCompilerMessage[]>
Defined in: modules/core/src/adapter/resources/shader.ts:57
Get compiler log asynchronously
Returns
Promise<readonly CompilerMessage[]>
getCompilationInfoSync()
getCompilationInfoSync(): readonly
CompilerMessage[] |null
Defined in: modules/core/src/adapter/resources/shader.ts:60
Get compiler log synchronously (WebGL only)
Returns
readonly CompilerMessage[] | null
getProps()
getProps():
object
Defined in: modules/core/src/adapter/resources/resource.ts:190
Combines a map of user props and default props, only including props from defaultProps
Returns
object
returns a map of overridden default props
Inherited from
getTranslatedSource()
getTranslatedSource():
string|null
Defined in: modules/core/src/adapter/resources/shader.ts:65
Get translated shader source in host platform's native language (HLSL, GLSL, and even GLSL ES), if available
Returns
string | null
toJSON()
toJSON():
string
Defined in: modules/core/src/adapter/resources/resource.ts:113
Compact serialization for assertion diffs and structured debug logs.
Returns
string
Inherited from
toString()
toString():
string
Defined in: modules/core/src/adapter/resources/resource.ts:108
Returns
string