EEVEE-Next: Support for Intel ARC GPUs

This PR adds support for Intel ARC GPUs. Due barriers inside a non
uniform control flow the Intel ARC can stall the whole system.

The cause is that a barrier is used, but some threads in the shader
have completed. The barriers might wait until it gets the signal from
the exited threads and stalls the system.

Although some implementations support it it is safer to limit the
number of HiZ levels.

Pull Request: https://projects.blender.org/blender/blender/pulls/113447
This commit is contained in:
Jeroen Bakker 2023-10-09 15:29:26 +02:00
parent f27ac434f6
commit 701c14acea
4 changed files with 4 additions and 6 deletions

View File

@ -17,7 +17,7 @@
#define LUT_WORKGROUP_SIZE 16
/* Hierarchical Z down-sampling. */
#define HIZ_MIP_COUNT 8
#define HIZ_MIP_COUNT 7
/* NOTE: The shader is written to update 5 mipmaps using LDS. */
#define HIZ_GROUP_SIZE 32

View File

@ -44,7 +44,6 @@ void HiZBuffer::sync()
hiz_update_ps_.bind_image("out_mip_4", hiz_tx_.mip_view(4));
hiz_update_ps_.bind_image("out_mip_5", hiz_tx_.mip_view(5));
hiz_update_ps_.bind_image("out_mip_6", hiz_tx_.mip_view(6));
hiz_update_ps_.bind_image("out_mip_7", hiz_tx_.mip_view(7));
/* TODO(@fclem): There might be occasions where we might not want to
* copy mip 0 for performance reasons if there is no need for it. */
hiz_update_ps_.push_constant("update_mip_0", true);

View File

@ -112,8 +112,8 @@ void main()
mask_shift = 1;
/* Level 7. */
downsample_level(out_mip_7, 7);
/* Level 7 requires barriers inside a non-uniform control flow. */
// downsample_level(out_mip_7, 7);
/* Limited by OpenGL maximum of 8 image slot. */
// downsample_level(out_mip_8, 8);
@ -121,4 +121,4 @@ void main()
// downsample_level(out_mip_10, 10);
}
}
}
}

View File

@ -21,7 +21,6 @@ GPU_SHADER_CREATE_INFO(eevee_hiz_update)
.image(4, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_mip_4")
.image(5, GPU_R32F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "out_mip_5")
.image(6, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_mip_6")
.image(7, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_mip_7")
.push_constant(Type::BOOL, "update_mip_0")
.compute_source("eevee_hiz_update_comp.glsl");