Class Shader

A SPIR-V program for one programmable stage in the graphics Pipeline.

class Shader
  : ObservableFile
  , IResource ;

Constructors

NameDescription
this (stage, filePath, hotReload) Initialize a new Shader compiled from the given filePath.
this (stage, spv) Initialize a new Shader.

Fields

NameTypeDescription
stage const(gfx.graal.pipeline.ShaderStage)The stage in the graphics pipeline in which this Shader performs.
contents const(ubyte)[]Contents of this file.
filePath const(string)Path to this file.
hotReload const(bool)Whether this file is being watched for changes.
onChanged Event!(const(ubyte)[])Fired if the file is being actively watched and when the file's contents change.
onDeleted Event!(string)Fired if the file is being actively watched and when the file was deleted.

Properties

NameTypeDescription
initialized[get] boolWhether this Shader has been successfully initialized.
exists[get] const(bool)Whether this file exists. The file could not have been found initially, later moved, or deleted.

Methods

NameDescription
initialize (device) Initialize this Shader.
watched (stage, filePath) Initialize a new Shader compiled from the given filePath. The constructed Shader will be marked for hotReload.

See Also

ObservableFile