This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.StructuredBuffer Class

StructuredBuffer is a buffer for structures: it represents a uniform array of structures.

StructuredBuffer resource can specified via the following flags:

  • USAGE_GPU_RESOURCE specifies a resource that can be read and written by the GPU. It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
  • USAGE_IMMUTABLE specifies a resources that can only be read by the GPU. It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
  • USAGE_CPU_RESOURCE specifies a resource that is accessible by both the GPU (read only mode) and the CPU (write only mode). It also creates a temporary direct staging buffer to copy the data from the main buffer and gets the data by the CPU.
  • USAGE_STAGING specifies a resource that supports direct data transfer from the GPU to CPU.
  • USAGE_SHARED specifies that a resource is accessible by an external graphics API.

See Also
#

  • StructuredBuffer C++ sample provided in the Samples (Samples -> C++ -> Render) section of UNIGINE SDK Browser.

StructuredBuffer Class

Properties

string DebugName#

The friendly name of the structured buffer used for GPU debugging (RenderDoc, NVIDIA Nsight). It can be used to help you determine if the corresponding object interface pointer caused the leak. Memory leaks are reported by the debug software layer by outputting a list of object interface pointers along with their friendly names.

int NumElements#

The number of elements in the structured buffer.

bool IsUsageShared#

The value indicating if the resource has the USAGE_SHARED flag enabled.

bool IsUsageStaging#

The value indicating if the resource has the USAGE_STAGING flag enabled.

bool IsUsageCPUResource#

The value indicating if the resource has the USAGE_CPU_RESOURCE flag enabled.

bool IsUsageImmutable#

The value indicating if the resource has the USAGE_IMMUTABLE flag enabled.

bool IsUsageGPUResource#

The value indicating if the resource has the USAGE_GPU_RESOURCE flag enabled.

Members


StructuredBuffer ( ) #

Constructor. Creates a new structured buffer.
Source code (C++)
StructuredBufferPtr input_buffer = StructuredBuffer::create();

IntPtr GetD3D11ShaderResourceView ( ) #

Gets a shader-resource view that specifies the subresources a shader can access during rendering.

Return value

A pointer to D3D11 shader resource view.

IntPtr GetD3D11UnorderedAccessView ( ) #

Gets a view for an unordered access resource that specifies the parts of a resource the pipeline can access during rendering.

Return value

A pointer to a D3D11 unordered access view.

int GetData ( IntPtr data ) #

Gets the data from StructuredBuffer instance.

Arguments

  • IntPtr data - A pointer to the data.

Return value

1 if StructuredBuffer data was returned; otherwise, 0.

int GetGLBufferID ( ) #

Returns the Id of buffer.

Return value

An Id of the buffer.

void Clear ( ) #

Clears smart pointer.

int Create ( int flags, IntPtr data, uint structure_size, uint num_elements ) #

Arguments

  • int flags - StructuredBuffer flag.
  • IntPtr data - Pointer to the source data.
  • uint structure_size - The size of the structured buffer.
  • uint num_elements - Number of elements in the structured buffer.

Return value

1 if the StructuredBuffer was created successfully; otherwise, 0.

int Create ( int flags, uint structure_size, uint num_elements ) #

Constructor. Creates a new structured buffer with the specified parameters.

Arguments

  • int flags - StructuredBuffer flag.
  • uint structure_size - The size of the structured buffer.
  • uint num_elements - Number of elements in the structured buffer.

Return value

1 if the StructuredBuffer was created successfully; otherwise, 0.

void Destroy ( ) #

Destroys smart pointer.

void ClearBuffer ( ) #

Clears the structured buffer.

void Copy ( StructuredBuffer src ) #

Copies the data from the specified source structured buffer.

Arguments

  • StructuredBuffer src - Source structured buffer to copy data from.

ResourceExternalMemory GetResourceExternalMemory ( ) #

Returns the resource in video memory. If the USAGE_SHARED flag is not enabled for the resource, this method returns NULL.

Return value

The resource in video memory. If the USAGE_SHARED flag is not enabled for the resource, this method returns NULL.
Last update: 19.04.2024
Build: ()