Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RHI::InputStreamLayoutBuilder Class Reference

#include <InputStreamLayoutBuilder.h>

Classes

class  BufferDescriptorBuilder
 

Public Member Functions

void Begin ()
 Begin building a new InputStreamLayout. This is optional for the first InputStreamLayout.
 
void SetTopology (PrimitiveTopology topology)
 Set the PrimitiveTopology used by the InputStreamLayout. The default is TriangleList.
 
BufferDescriptorBuilderAddBuffer (StreamStepFunction stepFunction=StreamStepFunction::PerVertex, uint32_t stepRate=1)
 Add a buffer descriptor to the InputStreamLayout. Use the returned BufferBuilder to register Channels and Padding.
 
InputStreamLayout End ()
 Finalize and return the InputStreamLayout.
 

Detailed Description

Provides a convenient way to construct InputStreamLayout objects, which describes the input assembly stream buffer layout for the pipeline state.

The general usage includes adding one or more stream buffer descriptors, and adding one or more channels descriptors to each buffer. Examples are shown below.

1) Individual Stream Buffers - each stream channel is contained in a separate buffers

layoutBuilder.AddBuffer()->Channel("POSITION", RHI::Format::R32G32B32_FLOAT);
layoutBuilder.AddBuffer()->Channel("COLOR", RHI::Format::R32G32B32A32_FLOAT);
layoutBuilder.AddBuffer()->Channel("UV", RHI::Format::R32G32_FLOAT);
layout = layoutBuilder.End();
BufferDescriptorBuilder * Channel(AZStd::string_view semantic, Format format)
Registers the next stream channel in the current buffer.
Definition: InputStreamLayoutBuilder.h:51
InputStreamLayout End()
Finalize and return the InputStreamLayout.
BufferDescriptorBuilder * AddBuffer(StreamStepFunction stepFunction=StreamStepFunction::PerVertex, uint32_t stepRate=1)
Add a buffer descriptor to the InputStreamLayout. Use the returned BufferBuilder to register Channels...

2) Interleaved Stream Buffers - a single buffer contains all stream channels

layoutBuilder.AddBuffer()
->Channel("POSITION", RHI::Format::R32G32B32_FLOAT)
->Channel("COLOR", RHI::Format::R8G8B8A8_UNORM)
->Channel("UV", RHI::Format::R32G32_FLOAT);
layout = layoutBuilder.End();

3) Multiple Interleaved Stream Buffers - multiple buffers with multiple channels

layoutBuilder.AddBuffer()
->Channel("POSITION", RHI::Format::R32G32B32_FLOAT)
->Channel("COLOR", RHI::Format::R32G32B32A32_FLOAT);
layoutBuilder.AddBuffer()
->Channel("UV0", RHI::Format::R32G32_FLOAT)
->Channel("UV1", RHI::Format::R32G32_FLOAT);
layout = layoutBuilder.End();

The documentation for this class was generated from the following file: