RenderPipeline
in package
Table of Contents
Properties
- $backbuffer : RenderTarget
- $data : PipelineContainer
- $passes : array<string|int, RenderPass>
- An array of render passes
- $resourceAllocator : PipelineResources
- $resourceHandleIndex : int
- A internal counter for the next resource handle
- $resources : array<string|int, RenderResource>
- An array of render resources
Methods
- __construct() : mixed
- Constrcutor
- addPass() : void
- Adds a new render pass to the pipeline
- createColorAttachment() : TextureResource
- Createa a color attachment for a render target resource
- createDepthAttachment() : TextureResource
- Creates a depth attachment for a render target resource
- createRenderTarget() : RenderTargetResource
- Creates a new render target resource
- createRenderTargetLike() : RenderTargetResource
- Creates a new render target resource with the same dimensions and content scale as the given render target
- execute() : void
- Execute the render pipeline
- importRenderTarget() : RenderTargetResource
- Imports a render target resource
- importTexture() : TextureResource
- Imports a texture resource
- reads() : void
- Marks the given render pass as reading from the given render resource
- writes() : void
- Marks the given render pass as writing to the given render resource
- createResource() : T|RenderResource
- Creates a new render resource of given type with name
- nextResourceHandle() : int
- Returns a new resource handle
Properties
$backbuffer
private
RenderTarget
$backbuffer
$data
private
PipelineContainer
$data
$passes
An array of render passes
private
array<string|int, RenderPass>
$passes
= []
$resourceAllocator
private
PipelineResources
$resourceAllocator
$resourceHandleIndex
A internal counter for the next resource handle
private
int
$resourceHandleIndex
= 0
$resources
An array of render resources
private
array<string|int, RenderResource>
$resources
= []
Methods
__construct()
Constrcutor
public
__construct(PipelineResources $resourceAllocator, PipelineContainer $data, RenderTarget $backbuffer) : mixed
Parameters
- $resourceAllocator : PipelineResources
- $data : PipelineContainer
- $backbuffer : RenderTarget
addPass()
Adds a new render pass to the pipeline
public
addPass(RenderPass $pass) : void
Parameters
- $pass : RenderPass
createColorAttachment()
Createa a color attachment for a render target resource
public
createColorAttachment(RenderTargetResource $target, string $name[, TextureOptions|null $options = null ]) : TextureResource
Parameters
- $target : RenderTargetResource
- $name : string
- $options : TextureOptions|null = null
-
Optional texture options for the attachment
Return values
TextureResourcecreateDepthAttachment()
Creates a depth attachment for a render target resource
public
createDepthAttachment(RenderTargetResource $target[, TextureOptions|null $options = null ]) : TextureResource
Parameters
- $target : RenderTargetResource
- $options : TextureOptions|null = null
-
Optional texture options for the attachment
Return values
TextureResourcecreateRenderTarget()
Creates a new render target resource
public
createRenderTarget(string $resourceName, int $width, int $height) : RenderTargetResource
Parameters
- $resourceName : string
- $width : int
- $height : int
Return values
RenderTargetResourcecreateRenderTargetLike()
Creates a new render target resource with the same dimensions and content scale as the given render target
public
createRenderTargetLike(string $resourceName, RenderTarget $target) : RenderTargetResource
Parameters
- $resourceName : string
- $target : RenderTarget
Return values
RenderTargetResourceexecute()
Execute the render pipeline
public
execute(int $tickIndex[, ProfilerInterface|null $profiler = null ]) : void
Parameters
- $tickIndex : int
-
Lets the pipeline know which tick it is. This is used to determine the order in which this pipeline is executed. The paramter is rather important as for example the garbage collector uses this to determine when to free resources.
- $profiler : ProfilerInterface|null = null
-
An optional profiler can be passed to mesure pass cost
importRenderTarget()
Imports a render target resource
public
importRenderTarget(string $resourceName, RenderTarget $target) : RenderTargetResource
Parameters
- $resourceName : string
- $target : RenderTarget
Return values
RenderTargetResourceimportTexture()
Imports a texture resource
public
importTexture(string $resourceName, Texture $texture) : TextureResource
Parameters
- $resourceName : string
- $texture : Texture
Return values
TextureResourcereads()
Marks the given render pass as reading from the given render resource
public
reads(RenderPass $pass, RenderResource $source) : void
Parameters
- $pass : RenderPass
- $source : RenderResource
writes()
Marks the given render pass as writing to the given render resource
public
writes(RenderPass $pass, RenderResource $target) : void
Parameters
- $pass : RenderPass
- $target : RenderResource
createResource()
Creates a new render resource of given type with name
private
createResource(T> $type, string $resourceName, mixed ...$args) : T|RenderResource
Parameters
- $type : T>
- $resourceName : string
- $args : mixed
Tags
Return values
T|RenderResourcenextResourceHandle()
Returns a new resource handle
private
nextResourceHandle() : int