Class ResampleShader

RGBA8 texture resizing shader.

class ResampleShader
  : ComputeShader;

Constructors

NameDescription
this (inputTexture, outputTexture, owner) Constructs a resample shader for resizing from an input texture to an output texture.
this (inputTexture, outputWidth, outputHeight, owner) Constructs a resample shader and creates a new output texture of the given size.

Fields

NameTypeDescription
inputTexture TextureInput texture to be resized.
outputTexture TextureOutput texture to write resized data.
computeSubroutineIndices uint[]Array of compute shader subroutine indices.
fragmentSubroutineIndices uint[]Array of fragment shader subroutine indices.
parameters dlib.container.mappedlist.MappedList!(dagon.graphics.shader.BaseShaderParameter)List of shader parameters.
program BaseShaderProgramShader program to use.
validationEnabled boolIn debug mode, enables or disables shader validation on bind.
vertexSubroutineIndices uint[]Array of vertex shader subroutine indices.
_destSize ShaderParameter!(dlib.math.vector.Vector!(float,2).Vector)Destination texture size parameter.
_srcSize ShaderParameter!(dlib.math.vector.Vector!(float,2).Vector)Source texture size parameter.
cs dlib.text.str.StringCompute shader source code.

Methods

NameDescription
bindParameters (state) Binds shader parameters and image textures.
run () Runs the resample compute shader.
barrier (barrier) Inserts a memory barrier for compute shader resource synchronization.
bind () Binds the underlying shader program.
bindImageTexture (unit, texture, accessMode) Binds a texture as an image for read/write access in the shader.
createBlockParameter (name, length, location) Creates a uniform block parameter of type T.
createParameter (name) Creates a uniform parameter of type T.
createParameterArray (name) Creates a uniform array parameter of type T.
createParameterSubroutine (name, shaderType) Creates a subroutine parameter.
dispatch (workGroupsX, workGroupsY, workGroupsZ) Dispatches the compute shader with the specified work group counts.
getParameter (name) Gets a parameter by name.
getParameterValue (name) Gets the value of a parameter by name.
load (filename) Loads shader source code from a file, supporting #include directives.
run (width, height, depth, barrier) Runs the compute shader for the given workload size and inserts a memory barrier.
setParameter (name, val) Sets a uniform parameter of type T to a value.
setParameterCallback (name, val) Sets a uniform parameter of type T to a callback.
setParameterRef (name, val) Sets a uniform parameter of type T to a reference.
setParameterSubroutine (name, shaderType, subroutineName) Sets a subroutine parameter with a specific subroutine name.
unbind () Unbinds the underlying shader program.
unbindParameters (state) Unbinds all parameters.
validate () Validates the program.
computeWorkGroups (width, height, depth, wgx, wgy, wgz) Computes the number of work groups needed for the given workload size.