EEVEE-Next: Resolve compilation errors in Metal #106219
|
@ -21,6 +21,8 @@ typedef struct DispatchCommand DispatchCommand;
|
|||
typedef struct DRWDebugPrintBuffer DRWDebugPrintBuffer;
|
||||
typedef struct DRWDebugVert DRWDebugVert;
|
||||
typedef struct DRWDebugDrawBuffer DRWDebugDrawBuffer;
|
||||
typedef struct FrustumCorners FrustumCorners;
|
||||
typedef struct FrustumPlanes FrustumPlanes;
|
||||
|
||||
/* __cplusplus is true when compiling with MSL. */
|
||||
# if defined(__cplusplus) && !defined(GPU_SHADER)
|
||||
|
|
|
@ -50,7 +50,8 @@ void View::frustum_boundbox_calc(int view_id)
|
|||
}
|
||||
#endif
|
||||
|
||||
MutableSpan<float4> corners = {culling_[view_id].corners, ARRAY_SIZE(culling_[view_id].corners)};
|
||||
MutableSpan<float4> corners = {culling_[view_id].frustum_corners.corners,
|
||||
ARRAY_SIZE(culling_[view_id].frustum_corners.corners)};
|
||||
|
||||
float left, right, bottom, top, near, far;
|
||||
bool is_persp = data_[view_id].winmat[3][3] == 0.0f;
|
||||
|
@ -89,15 +90,15 @@ void View::frustum_culling_planes_calc(int view_id)
|
|||
{
|
||||
float4x4 persmat = data_[view_id].winmat * data_[view_id].viewmat;
|
||||
planes_from_projmat(persmat.ptr(),
|
||||
culling_[view_id].planes[0],
|
||||
culling_[view_id].planes[5],
|
||||
culling_[view_id].planes[1],
|
||||
culling_[view_id].planes[3],
|
||||
culling_[view_id].planes[4],
|
||||
culling_[view_id].planes[2]);
|
||||
culling_[view_id].frustum_planes.planes[0],
|
||||
culling_[view_id].frustum_planes.planes[5],
|
||||
culling_[view_id].frustum_planes.planes[1],
|
||||
culling_[view_id].frustum_planes.planes[3],
|
||||
culling_[view_id].frustum_planes.planes[4],
|
||||
culling_[view_id].frustum_planes.planes[2]);
|
||||
|
||||
/* Normalize. */
|
||||
for (float4 &plane : culling_[view_id].planes) {
|
||||
for (float4 &plane : culling_[view_id].frustum_planes.planes) {
|
||||
plane.w /= normalize_v3(plane);
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +106,8 @@ void View::frustum_culling_planes_calc(int view_id)
|
|||
void View::frustum_culling_sphere_calc(int view_id)
|
||||
{
|
||||
BoundSphere &bsphere = *reinterpret_cast<BoundSphere *>(&culling_[view_id].bound_sphere);
|
||||
Span<float4> corners = {culling_[view_id].corners, ARRAY_SIZE(culling_[view_id].corners)};
|
||||
Span<float4> corners = {culling_[view_id].frustum_corners.corners,
|
||||
ARRAY_SIZE(culling_[view_id].frustum_corners.corners)};
|
||||
|
||||
/* Extract Bounding Sphere */
|
||||
if (data_[view_id].winmat[3][3] != 0.0f) {
|
||||
|
|
Loading…
Reference in New Issue