C# Класс Axiom.Graphics.GpuProgramUsage

This class makes the usage of a vertex and fragment programs (low-level or high-level), with a given set of parameters, explicit.
Using a vertex or fragment program can get fairly complex; besides the fairly rudimentary process of binding a program to the GPU for rendering, managing usage has few complications, such as:
  • Programs can be high level (e.g. Cg, GLSlang) or low level (assembler). Using either should be relatively seamless, although high-level programs give you the advantage of being able to use named parameters, instead of just indexed registers
  • Programs and parameters can be shared between multiple usages, in order to save memory
  • When you define a user of a program, such as a material, you often want to be able to set up the definition but not load / compile / assemble the program at that stage, because it is not needed just yet. The program should be loaded when it is first needed, or earlier if specifically requested. The program may not be defined at this time, you may want to have scripts that can set up the definitions independent of the order in which those scripts are loaded.
This class packages up those details so you don't have to worry about them. For example, this class lets you define a high-level program and set up the parameters for it, without having loaded the program (which you normally could not do). When the program is loaded and compiled, this class will then validate the parameters you supplied earlier and turn them into runtime parameters.

Just incase it wasn't clear from the above, this class provides linkage to both GpuProgram and HighLevelGpuProgram, despite its name.

Наследование: DisposableObject, Resource.IListener
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
parameters GpuProgramParameters
program Axiom.Graphics.GpuProgram
type GpuProgramType

Открытые методы

Метод Описание
Clone ( ) : GpuProgramUsage

Creates and returns a copy of this GpuProgramUsage object.

GpuProgramUsage ( GpuProgramType type ) : System

Default constructor.

Приватные методы

Метод Описание
Load ( ) : void

Load this usage (and ensure program is loaded).

Unload ( ) : void

Unload this usage.

Описание методов

Clone() публичный метод

Creates and returns a copy of this GpuProgramUsage object.
public Clone ( ) : GpuProgramUsage
Результат GpuProgramUsage

GpuProgramUsage() публичный метод

Default constructor.
public GpuProgramUsage ( GpuProgramType type ) : System
type GpuProgramType Type of program to link to.
Результат System

Описание свойств

parameters защищенное свойство

Low level GPU program parameters.
protected GpuProgramParameters,Axiom.Graphics parameters
Результат GpuProgramParameters

program защищенное свойство

Reference to the program whose usage is being specified within this class.
protected GpuProgram,Axiom.Graphics program
Результат Axiom.Graphics.GpuProgram

type защищенное свойство

Type of program (vertex or fragment) this usage is being specified for.
protected GpuProgramType type
Результат GpuProgramType