Fix 107322: MacOS/ATI Crash When Starting Eevee #109358
@ -118,7 +118,7 @@ float search_horizon(vec3 vI,
|
||||
}
|
||||
|
||||
float prev_time, time = 0.0;
|
||||
for (float iter = 0.0; time < ssray.max_time && iter < sample_count; iter++) {
|
||||
Jeroen-Bakker marked this conversation as resolved
Outdated
|
||||
for (int iter = 0; time < ssray.max_time && iter < sample_count; iter++) {
|
||||
Jeroen-Bakker marked this conversation as resolved
Outdated
Clément Foucault
commented
`sample_count` needs to be declared as int. Better do the conversion out of the loop `const int i_sample_count = int(sample_count)`
|
||||
prev_time = time;
|
||||
/* Gives us good precision at center and ensure we cross at least one pixel per iteration. */
|
||||
time = 1.0 + iter + sqr((iter + noise) / sample_count) * ssray.max_time;
|
||||
Jeroen-Bakker marked this conversation as resolved
Outdated
Clément Foucault
commented
`iter` needs to be explicitly converted to float here.
|
||||
|
@ -137,8 +137,8 @@ bool raytrace(Ray ray,
|
||||
#ifdef METAL_AMD_RAYTRACE_WORKAROUND
|
||||
bool hit_failsafe = true;
|
||||
#endif
|
||||
const float max_steps = 255.0;
|
||||
for (float iter = 1.0; !hit && (time < ssray.max_time) && (iter < max_steps); iter++) {
|
||||
const int max_steps = 255;
|
||||
for (int iter = 1; !hit && (time < ssray.max_time) && (iter < max_steps); iter++) {
|
||||
float stride = 1.0 + iter * params.trace_quality;
|
||||
Jeroen-Bakker marked this conversation as resolved
Outdated
Clément Foucault
commented
`iter` needs to be explicitly converted to float here.
|
||||
float lod = log2(stride) * lod_fac;
|
||||
|
||||
@ -210,8 +210,8 @@ bool raytrace_planar(Ray ray, RayTraceParameters params, int planar_ref_id, out
|
||||
/* On very sharp reflections, the ray can be perfectly aligned with the view direction
|
||||
* making the tracing useless. Bypass tracing in this case. */
|
||||
bool hit = false;
|
||||
const float max_steps = 255.0;
|
||||
for (float iter = 1.0; !hit && (time < ssray.max_time) && (iter < max_steps); iter++) {
|
||||
const int max_steps = 255;
|
||||
for (int iter = 1; !hit && (time < ssray.max_time) && (iter < max_steps); iter++) {
|
||||
float stride = 1.0 + iter * params.trace_quality;
|
||||
Jeroen-Bakker marked this conversation as resolved
Outdated
Clément Foucault
commented
`iter` needs to be explicitly converted to float here.
|
||||
|
||||
prev_time = time;
|
||||
|
Loading…
Reference in New Issue
Block a user
My apologies @Jeroen-Bakker , after testing the patch locally, one omission was that we also need to tag the function with no inline, though this should only be done for AMD platforms on Metal. Without this, the crash can still occur for certain material variants it appears.
I hope this is okay to include.
raytrace_lib.glsl
and