Search Results for

    Show / Hide Table of Contents

    Class GPUShader

    The GPU resource with shader programs that can run on the GPU and are able to perform rendering calculation using textures, vertices and other resources.

    Inheritance
    Object
    ScriptingObject
    GPUResource
    GPUShader
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    GPUResource::_memoryUsage
    GPUResource::_nameCapacity
    GPUResource::_namePtr
    GPUResource::_nameSize
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    GPUResource::GetMemoryUsage()
    GPUResource::GetName()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    GPUResource::GPUResource()
    GPUResource::GPUResource(const SpawnParams& params)
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    GPUResource::LastRenderTime
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    GPUResource::OnDeleteObject()
    GPUResource::OnDeviceDispose()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    GPUResource::ReleaseGPU()
    GPUResource::Releasing
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    ScriptingObject::SetManagedInstance(MObject* instance)
    GPUResource::SetName(const StringView& name)
    GPUShader
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    GPUResource::ToString()
    ScriptingObject::UnregisterObject()
    GPUResource::~GPUResource()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Graphics/Shaders/GPUShader.h
    Syntax
    public class GPUShader : public GPUResource

    Constructors

    GPUShader()

    Declaration
    protected GPUShader()

    Fields

    _constantBuffers

    Declaration
    protected GPUConstantBuffer* _constantBuffers[GPU_MAX_CB_BINDED]
    Field Value
    GPUConstantBuffer

    _shaders

    Declaration
    protected Dictionary<uint32, GPUShaderProgram* > _shaders
    Field Value
    Dictionary<uint32, GPUShaderProgram >

    Methods

    Create(class MemoryReadStream& stream)

    Creates the shader resource and loads its data from the bytes. stream

    The stream with compiled shader data.

    True if cannot create state, otherwise false.

    Declaration
    public virtual bool Create(class MemoryReadStream& stream)
    Parameters
    class MemoryReadStream stream

    Returns
    bool

    CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, Span<byte> bytecode, MemoryReadStream& stream)

    Declaration
    protected virtual GPUShaderProgram* CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, Span<byte> bytecode, MemoryReadStream& stream) = 0
    Parameters
    ShaderStage type

    GPUShaderProgramInitializer initializer

    Span<byte> bytecode

    MemoryReadStream stream

    Returns
    GPUShaderProgram

    GetCB(int32 slot)

    Gets the constant buffer.

    Declaration
    public GPUConstantBuffer* GetCB(int32 slot) const
    Parameters
    int32 slot

    The buffer slot index.

    Returns
    GPUConstantBuffer

    The Constant Buffer object.

    GetCS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets the compute shader.

    Declaration
    public GPUShaderProgramCS* GetCS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramCS

    The shader object.

    GetDS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets domain shader.

    Declaration
    public GPUShaderProgramDS* GetDS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramDS

    The shader object.

    GetGS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets the geometry shader.

    Declaration
    public GPUShaderProgramGS* GetGS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramGS

    The shader object.

    GetHS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets the hull shader.

    Declaration
    public GPUShaderProgramHS* GetHS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramHS

    The shader object.

    GetPS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets the pixel shader.

    Declaration
    public GPUShaderProgramPS* GetPS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramPS

    The shader object.

    GetResourceType()

    Gets the GPU resource type.

    Declaration
    public virtual GPUResourceType GetResourceType() const final override
    Returns
    GPUResourceType

    Overrides
    GPUResource::GetResourceType()

    GetShader(ShaderStage stage, const StringAnsiView& name, int32 permutationIndex)

    Declaration
    protected GPUShaderProgram* GetShader(ShaderStage stage, const StringAnsiView& name, int32 permutationIndex) const
    Parameters
    ShaderStage stage

    StringAnsiView name

    int32 permutationIndex

    Returns
    GPUShaderProgram

    GetVS(const StringAnsiView& name, int32 permutationIndex = 0)

    Gets the vertex shader.

    Declaration
    public GPUShaderProgramVS* GetVS(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    GPUShaderProgramVS

    The shader object.

    HasShader(const StringAnsiView& name, int32 permutationIndex = 0)

    Determines whether the specified shader program is in the shader.

    Declaration
    public bool HasShader(const StringAnsiView& name, int32 permutationIndex = 0) const
    Parameters
    StringAnsiView name

    The shader program name.

    int32 permutationIndex

    The shader permutation index.

    Returns
    bool

    true if the shader is valid; otherwise, false.

    OnReleaseGPU()

    Releases GPU resource data (implementation).

    Declaration
    protected virtual void OnReleaseGPU() override
    Overrides
    GPUResource::OnReleaseGPU()

    ReadVertexLayout(MemoryReadStream& stream, GPUVertexLayout*& inputLayout, GPUVertexLayout*& vertexLayout)

    Declaration
    protected static void ReadVertexLayout(MemoryReadStream& stream, GPUVertexLayout*& inputLayout, GPUVertexLayout*& vertexLayout)
    Parameters
    MemoryReadStream stream

    GPUVertexLayout inputLayout

    GPUVertexLayout vertexLayout

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat