Skip to content

Commit

Permalink
Merge branch 'mmcx' into 'mmcx'
Browse files Browse the repository at this point in the history
hacky workaround to avoid convert_float error for -1 returned by vectorized isgreater on Intel GPU

See merge request fangq/mmc!3
  • Loading branch information
fangq committed Jul 18, 2019
2 parents 7995941 + 9f50a7f commit ced4ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mmc_core.cl
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ float branchless_badouel_raytet(ray *r, __constant MCXParam *gcfg,__constant int

S = (FL4(r->vec.x)*normal[eid]+FL4(r->vec.y)*normal[eid+1]+FL4(r->vec.z)*normal[eid+2]);
T = normal[eid+3] - (FL4(r->p0.x)*normal[eid]+FL4(r->p0.y)*normal[eid+1]+FL4(r->p0.z)*normal[eid+2]);
T = -convert_float4_rte(isgreater(T,FL4(0.f)))*T;
T = -convert_float4_rte(isgreater(T,FL4(0.f))*2)*FL4(0.5f)*T;
T = T/S;

S = -convert_float4_rte(isgreater(S,FL4(0.f)));
S = -convert_float4_rte(isgreater(S,FL4(0.f))*2)*FL4(0.5f);
T = S * T + (FL4(1.f)-S) * FL4(1e10f);

eid=r->eid-1;
Expand Down

0 comments on commit ced4ca6

Please sign in to comment.