VISU - PHP Game Framework

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

$resourceHandleIndex

A internal counter for the next resource handle

private int $resourceHandleIndex = 0

Methods

execute()

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

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
template
Return values
T|RenderResource

nextResourceHandle()

Returns a new resource handle

private nextResourceHandle() : int
Return values
int

        
On this page

Search results