Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor 29 06 #66

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified first-party/glslx/linux/glslx
Binary file not shown.
Binary file modified first-party/glslx/macos/glslx
Binary file not shown.
Binary file modified first-party/glslx/win32/glslx.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion internal/CoreRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ force_inline float safe_div_neg(const float a, const float b) {

force_inline void safe_invert(const float v[3], float out_v[3]) {
for (int i = 0; i < 3; ++i) {
out_v[i] = (fabsf(v[i]) > FLT_EPS) ? (1.0f / v[i]) : copysignf(FLT_MAX, v[i]);
out_v[i] = 1.0f / ((fabsf(v[i]) > FLT_EPS) ? v[i] : copysignf(FLT_EPS, v[i]));
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/CoreSIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1466,8 +1466,8 @@ void comp_aux_inv_values(const fvec<S> o[3], const fvec<S> d[3], fvec<S> inv_d[3

void comp_aux_inv_values(const float o[3], const float d[3], float inv_d[3], float inv_d_o[3]) {
for (int i = 0; i < 3; ++i) {
inv_d[i] = (fabsf(d[i]) > FLT_EPS) ? (1.0f / d[i]) : copysignf(FLT_MAX, d[i]);
inv_d_o[i] = (fabsf(d[i]) > FLT_EPS) ? (inv_d[i] * o[i]) : copysignf(FLT_MAX, d[i]);
inv_d[i] = 1.0f / ((fabsf(d[i]) > FLT_EPS) ? d[i] : copysignf(FLT_EPS, d[i]));
inv_d_o[i] = inv_d[i] * o[i];
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/shaders/common.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ float linstep(const float smin, const float smax, const float x) {
vec3 safe_invert(vec3 v) {
vec3 ret;
[[unroll]] for (int i = 0; i < 3; ++i) {
ret[i] = (abs(v[i]) > FLT_EPS) ? (1.0 / v[i]) : _copysign(FLT_MAX, v[i]);
ret[i] = 1.0 / ((abs(v[i]) > FLT_EPS) ? v[i] : _copysign(FLT_EPS, v[i]));
}
return ret;
}
Expand Down
6 changes: 3 additions & 3 deletions internal/shaders/output/debug_rt.comp.cso.inl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/debug_rt.comp.spv.inl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/intersect_area_lights.comp.cso.inl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/intersect_area_lights.comp.spv.inl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/intersect_scene.rgen.spv.inl

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/shaders/output/intersect_scene_indirect.rgen.spv.inl

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading