KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_projection.h File Reference
#include <rhi/rhi_types.h>

Go to the source code of this file.

Functions

void RhiAdjustProjectionForBackend (float *matrix4x4, RHI_BACKEND backend)
 Convert a column-major OpenGL projection, with NDC Z in [-1, 1] and Y up, in place to the backend's clip space.
 
bool RhiBackendNeedsYFlip (RHI_BACKEND backend)
 

Function Documentation

◆ RhiAdjustProjectionForBackend()

void RhiAdjustProjectionForBackend ( float * matrix4x4,
RHI_BACKEND backend )

Convert a column-major OpenGL projection, with NDC Z in [-1, 1] and Y up, in place to the backend's clip space.

With no backend the matrix is left unchanged.

Definition at line 31 of file rhi_projection.cpp.

References NONE, and RhiBackendNeedsYFlip().

Referenced by KIGFX::GAL_MODERN::PopulateCameraUBOs().

◆ RhiBackendNeedsYFlip()

bool RhiBackendNeedsYFlip ( RHI_BACKEND backend)
Returns
true if the backend uses Y-down NDC.

Definition at line 23 of file rhi_projection.cpp.

References METAL, and VULKAN.

Referenced by KIGFX::GAL_MODERN::PopulateCameraUBOs(), KIGFX::GAL_MODERN::PopulateCursorUBO(), and RhiAdjustProjectionForBackend().