Fix: EEVEE-Next: Metal compilation

Compilation errors after #119436

Pull Request: https://projects.blender.org/blender/blender/pulls/119709
This commit is contained in:
Miguel Pozo
2024-03-20 19:09:31 +01:00
parent 81ceff8e73
commit 9b1ba4fced
4 changed files with 10 additions and 10 deletions

View File

@@ -854,7 +854,7 @@ void ShadowModule::begin_sync()
sub.bind_ssbo("surfel_buf", &surfels_buf);
sub.bind_ssbo("capture_info_buf", &capture_info_buf);
sub.push_constant("directional_level", directional_level);
sub.push_constant("tilemap_projection_ratio", projection_ratio);
sub.push_constant("tilemap_proj_ratio", projection_ratio);
sub.bind_resources(inst_.lights);
sub.dispatch(&inst_.volume_probes.bake.dispatch_per_surfel_);
@@ -869,7 +869,7 @@ void ShadowModule::begin_sync()
sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data);
sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data);
sub.bind_texture("depth_tx", &src_depth_tx_);
sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio);
sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio);
sub.bind_resources(inst_.lights);
sub.dispatch(&dispatch_depth_scan_size_);
}
@@ -885,7 +885,7 @@ void ShadowModule::begin_sync()
sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data);
sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data);
sub.bind_ssbo("bounds_buf", &manager.bounds_buf.current());
sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio);
sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio);
sub.push_constant("pixel_world_radius", &pixel_world_radius_);
sub.push_constant("fb_resolution", &usage_tag_fb_resolution_);
sub.push_constant("fb_lod", &usage_tag_fb_lod_);
@@ -1118,7 +1118,7 @@ void ShadowModule::end_sync()
sub.shader_set(inst_.shaders.static_shader_get(SHADOW_TILEMAP_TAG_USAGE_VOLUME));
sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data);
sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data);
sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio);
sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio);
sub.bind_resources(inst_.uniform_data);
sub.bind_resources(inst_.hiz_buffer.front);
sub.bind_resources(inst_.sampling);

View File

@@ -111,7 +111,7 @@ void shadow_tag_usage_tilemap_punctual(
lP += vec3(0.0, 0.0, -light.shadow_projection_shift);
float footprint_ratio = shadow_punctual_footprint_ratio(
light, P, drw_view_is_perspective(), dist_to_cam, tilemap_projection_ratio);
light, P, drw_view_is_perspective(), dist_to_cam, tilemap_proj_ratio);
if (radius == 0) {
int face_id = shadow_punctual_face_index_get(lP);

View File

@@ -127,7 +127,7 @@ float shadow_directional_level_fractional(LightData light, vec3 lP)
lod = length(lP.xy) * narrowing / lod_min_half_size;
}
float clipmap_lod = lod + light.lod_bias;
return clamp(clipmap_lod, light.clipmap_lod_min, light.clipmap_lod_max);
return clamp(clipmap_lod, float(light.clipmap_lod_min), float(light.clipmap_lod_max));
}
int shadow_directional_level(LightData light, vec3 lP)

View File

@@ -64,7 +64,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_opaque)
.sampler(0, ImageType::DEPTH_2D, "depth_tx")
.storage_buf(5, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]")
.storage_buf(6, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]")
.push_constant(Type::FLOAT, "tilemap_projection_ratio")
.push_constant(Type::FLOAT, "tilemap_proj_ratio")
.additional_info("eevee_shared", "draw_view", "draw_view_culling", "eevee_light_data")
.compute_source("eevee_shadow_tag_usage_comp.glsl");
@@ -75,7 +75,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_surfels)
/* ShadowTileDataPacked is uint. But MSL translation need the real type. */
.storage_buf(7, Qualifier::READ_WRITE, "uint", "tiles_buf[]")
.push_constant(Type::INT, "directional_level")
.push_constant(Type::FLOAT, "tilemap_projection_ratio")
.push_constant(Type::FLOAT, "tilemap_proj_ratio")
.additional_info("eevee_shared",
"draw_view",
"draw_view_culling",
@@ -96,7 +96,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_transparent)
.storage_buf(4, Qualifier::READ, "ObjectBounds", "bounds_buf[]")
.storage_buf(5, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]")
.storage_buf(6, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]")
.push_constant(Type::FLOAT, "tilemap_projection_ratio")
.push_constant(Type::FLOAT, "tilemap_proj_ratio")
.push_constant(Type::FLOAT, "pixel_world_radius")
.push_constant(Type::IVEC2, "fb_resolution")
.push_constant(Type::INT, "fb_lod")
@@ -117,7 +117,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_volume)
.local_group_size(VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE)
.storage_buf(4, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]")
.storage_buf(5, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]")
.push_constant(Type::FLOAT, "tilemap_projection_ratio")
.push_constant(Type::FLOAT, "tilemap_proj_ratio")
.additional_info("eevee_volume_properties_data",
"eevee_shared",
"draw_view",