EEVEE-Next: Resolve compilation errors in Metal #106219

Merged
Jeroen Bakker merged 8 commits from Jason-Fielder/blender:MetalEEVEENext_shaderCompilation into main 2023-04-20 08:03:42 +02:00
2 changed files with 13 additions and 9 deletions
Showing only changes of commit 6aa0011068 - Show all commits

View File

@ -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)

View File

@ -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) {