Vulkan: Shader Compilation Errors

Fixing several shader compilation errors when using the vulkan backend.

* `eevee_lightprobe_irradiance_load_comp`: local variables used same name as push constants.
* `compositor_summed_area_table_compute_complete_y_prologues`: loop with texture_size call

Pull Request: https://projects.blender.org/blender/blender/pulls/110891
This commit is contained in:
Jeroen Bakker
2023-08-07 14:49:08 +02:00
parent 6273a2dca4
commit 8de4b5a5ed
3 changed files with 11 additions and 10 deletions

View File

@@ -4,9 +4,10 @@
void main()
{
int x = int(gl_GlobalInvocationID.x);
int num_rows = texture_size(incomplete_y_prologues_tx).y;
vec4 accumulated_color = vec4(0.0);
for (int y = 0; y < texture_size(incomplete_y_prologues_tx).y; y++) {
for (int y = 0; y < num_rows; y++) {
accumulated_color += texture_load(incomplete_y_prologues_tx, ivec2(x, y));
accumulated_color += texture_load(complete_x_prologues_sum_tx, ivec2(gl_WorkGroupID.x, y));
imageStore(complete_y_prologues_img, ivec2(x, y), accumulated_color);

View File

@@ -105,24 +105,24 @@ SphericalHarmonicL1 lightprobe_irradiance_sample(
sampler3D atlas_tx, vec3 P, vec3 V, vec3 Ng, const bool do_bias)
{
vec3 lP;
int grid_index = 0;
int index = 0;
#ifdef IRRADIANCE_GRID_UPLOAD
grid_index = grid_start_index;
index = grid_start_index;
#endif
for (; grid_index < IRRADIANCE_GRID_MAX; grid_index++) {
for (; index < IRRADIANCE_GRID_MAX; index++) {
/* Last grid is tagged as invalid to stop the iteration. */
if (grids_infos_buf[grid_index].grid_size.x == -1) {
if (grids_infos_buf[index].grid_size.x == -1) {
/* Sample the last grid instead. */
grid_index -= 1;
index -= 1;
break;
}
/* If sample fall inside the grid, step out of the loop. */
if (lightprobe_irradiance_grid_local_coord(grids_infos_buf[grid_index], P, lP)) {
if (lightprobe_irradiance_grid_local_coord(grids_infos_buf[index], P, lP)) {
break;
}
}
IrradianceGridData grid_data = grids_infos_buf[grid_index];
IrradianceGridData grid_data = grids_infos_buf[index];
/* TODO(fclem): Make sure this is working as expected. */
mat3x3 world_to_grid_transposed = mat3x3(grid_data.world_to_grid_transposed);

View File

@@ -1,13 +1,13 @@
#pragma BLENDER_REQUIRE(gpu_shader_math_vector_lib.glsl)
vec3 lightprobe_irradiance_grid_sample_position(mat4 grid_local_to_world,
vec3 lightprobe_irradiance_grid_sample_position(mat4 grid_local_to_world_mat,
ivec3 grid_res,
ivec3 cell_coord)
{
vec3 ls_cell_pos = (vec3(cell_coord) + vec3(0.5)) / vec3(grid_res);
ls_cell_pos = ls_cell_pos * 2.0 - 1.0;
vec3 ws_cell_pos = (grid_local_to_world * vec4(ls_cell_pos, 1.0)).xyz;
vec3 ws_cell_pos = (grid_local_to_world_mat * vec4(ls_cell_pos, 1.0)).xyz;
return ws_cell_pos;
}