Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
inspectredc committed Jun 1, 2024
1 parent 6fb6b38 commit a4fa04e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/graphic/Fast3D/gfx_metal_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ MTL::VertexDescriptor* gfx_metal_build_shader(char buf[8192], size_t& num_floats
// end vertex shader

append_line(buf, &len, "float mod(float a, float b) {");
append_line(
buf, &len,
" return float(a - b * floor(a / b));");
append_line(buf, &len, " return float(a - b * floor(a / b));");
append_line(buf, &len, "}");

append_line(buf, &len, "float3 mod(float3 a, float3 b) {");
Expand All @@ -267,9 +265,9 @@ MTL::VertexDescriptor* gfx_metal_build_shader(char buf[8192], size_t& num_floats
append_line(buf, &len, "}");

append_line(buf, &len, "float4 mod(float4 a, float4 b) {");
append_line(
buf, &len,
" return float4(a.x - b.x * floor(a.x / b.x), a.y - b.y * floor(a.y / b.y), a.z - b.z * floor(a.z / b.z), a.w - b.w * floor(a.w / b.w));");
append_line(buf, &len,
" return float4(a.x - b.x * floor(a.x / b.x), a.y - b.y * floor(a.y / b.y), a.z - b.z * floor(a.z / "
"b.z), a.w - b.w * floor(a.w / b.w));");
append_line(buf, &len, "}");

append_line(buf, &len, "#define WRAP(x, low, high) mod((x)-(low), (high)-(low)) + (low)");
Expand Down

0 comments on commit a4fa04e

Please sign in to comment.