Render Pass

  • See samples/testDrv3d/render_pass_tests.h for example usage.

Callable D3D:: methods

RenderPass *create_render_pass(const RenderPassDesc &rp_desc)

Creates render pass object.

Render pass objects are intended to be created once (and ahead of time), used many times

Note

No external sync required

Warning

Do not run per frame/realtime!

Warning

Avoid using at time sensitive places!

Warning

Will assert-fail if rp_desc.bindCount is 0

Parameters:

rp_desc – Description of render pass to be created

Returns:

Pointer to opaque RenderPass object, may be nullptr if description is invalid

void delete_render_pass(RenderPass *rp)

Deletes render pass object.

Note

Sync with usage is required (must not delete object that is in use in current CPU frame)

Warning

All usage to object becomes invalid right after method call

Parameters:

rp – Object to be deleted

void begin_render_pass(RenderPass *rp, const RenderPassArea area, const RenderPassTarget *targets)

Begins render pass rendering.

After this command, viewport is reset to area supplied and subpass 0, described in render pass object, is started

Note

Must be external synced (GPU lock required)

Warning

When inside pass, all other GPU execution methods aside of Draw* are prohibited!

Warning

Avoid writes/reads outside area, it is UB in general

Warning

Will assert-fail if other render pass is already in process

Warning

Backbuffer can’t be used as target

Parameters:
  • rp – Render pass resource to begin with

  • area – Rendering area restriction

  • targets – Array of targets that will be used in rendering

void next_subpass()

Advances to next subpass.

Increases subpass number and executes necessary synchronization as well as binding, described for this subpass

Viewport is reset to render area on every call

Note

Must be external synced (GPU lock required)

Warning

Will assert-fail if there is no subpass to advance to

Warning

Will assert-fail if called outside of render pass

void end_render_pass()

Ends render pass.

Processes store&sync operations described in render pass

After this call, any non Draw operations are allowed and render targets are reset to backbuffer

Note

Must be external synced (GPU lock required)

Warning

Will assert-fail if subpass is not final

Warning

Will assert-fail if called outside of render pass

inline void allow_render_pass_target_load()

When renderpass splits validation is enabled in Vulkan this command tells that we actually want to load previous contents of attached color targets or depth to render on top of it. Otherwise loading previous contents treated as renderpass split and the validation fails (we want to avoid RP splits cause of performance impact on TBDR). If it’s known that the render target will be just fully redrawn (like in most postfx), it’s better to use d3d::clearview(CLEAR_DISCARD, …) instead of this command.