Fix: Metal: Remove some shader compilation warnings

This commit is contained in:
Clément Foucault
2024-10-29 20:42:32 +01:00
parent 133f9a31bf
commit 1b8efd7d99
5 changed files with 6 additions and 4 deletions

View File

@@ -706,7 +706,7 @@ struct DepthOfFieldData {
float4 filter_samples_weight;
float filter_center_weight;
/** Max number of sprite in the scatter pass for each ground. */
int scatter_max_rect;
uint scatter_max_rect;
int _pad0, _pad1;
};

View File

@@ -14,7 +14,7 @@
void main()
{
if (gl_InstanceID >= dof_buf.scatter_max_rect) {
if (uint(gl_InstanceID) >= dof_buf.scatter_max_rect) {
/* Very unlikely to happen but better avoid out of bound access. */
gl_Position = vec4(0.0);
return;

View File

@@ -17,7 +17,7 @@
void main()
{
uint index = gl_GlobalInvocationID.x;
if (index >= resource_len) {
if (index >= uint(resource_len)) {
return;
}

View File

@@ -226,6 +226,8 @@ void main()
case DEBUG_SHADOW_TILEMAP_RANDOM_COLOR:
debug_random_tilemap_color(P, light);
break;
default:
break;
}
}
}

View File

@@ -14,7 +14,7 @@
void main()
{
int index = int(gl_GlobalInvocationID.x);
uint index = gl_GlobalInvocationID.x;
if (index >= capture_info_buf.surfel_len) {
return;
}