-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Bugs in vector2.h, vector4.h, color2.h, color4.h, docs (#1892)
Fix a variety of typos in the 2- and 4-component color and vector helper structs. Very embarrassing! Also embarrassing, a typo in the docs had said that the way to overload the `!=` operator was with a function called `__operator__ne__` while actually, all along it had been `__operator__neq__`. Comprehensive test of color2, color4, vector2, vector4. New testing header: testsuite/common/shaders/osl-unittest.h This has utilities to make it easier to make unit tests for shader functions in our testsuite. Various other minor fixes to these headers. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
30 changed files
with
896 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Compiled test.osl -> test.oso | ||
parameter initialization: param1 = 0.5 1.5 | ||
parameter initialization: param2 = 0.25 0.25 | ||
|
||
PASS: param1 == color2(0.5, 1.5) | ||
PASS: -param1 == color2(-0.5, -1.5) | ||
PASS: param1 != param2 | ||
PASS: param1 + param2 == color2(0.75, 1.75) | ||
PASS: param1 + 1 == color2(1.5, 2.5) | ||
PASS: param1 + 1.0 == color2(1.5, 2.5) | ||
PASS: 1 + param1 == color2(1.5, 2.5) | ||
PASS: 1.0 + param1 == color2(1.5, 2.5) | ||
PASS: param1 - param2 == color2(0.25, 1.25) | ||
PASS: param1 - 1 == color2(-0.5, 0.5) | ||
PASS: param1 - 1.0 == color2(-0.5, 0.5) | ||
PASS: 1 - param1 == color2(0.5, -0.5) | ||
PASS: 1.0 - param1 == color2(0.5, -0.5) | ||
PASS: param1 * param2 == color2(0.125, 0.375) | ||
PASS: param1 * 2 == color2(1.0, 3.0) | ||
PASS: param1 * 2.0 == color2(1.0, 3.0) | ||
PASS: 2 * param1 == color2(1.0, 3.0) | ||
PASS: 2.0 * param1 == color2(1.0, 3.0) | ||
PASS: param1 / param2 == color2(2.0, 6.0) | ||
PASS: param1 / 2 == color2(0.25, 0.75) | ||
PASS: param1 / 2.0 == color2(0.25, 0.75) | ||
PASS: 2 / param1 == color2(4.0, 2.0/1.5) | ||
PASS: 2.0 / param1 == color2(4.0, 2.0/1.5) | ||
PASS: abs(color2(0.5, 1.5)) == color2(abs(xcomp(color2(0.5, 1.5))), abs(ycomp(color2(0.5, 1.5)))) | ||
PASS: abs(color2(-0.5, -1.5)) == color2(abs(xcomp(color2(-0.5, -1.5))), abs(ycomp(color2(-0.5, -1.5)))) | ||
PASS: ceil(color2(0.5, 1.5)) == color2(ceil(xcomp(color2(0.5, 1.5))), ceil(ycomp(color2(0.5, 1.5)))) | ||
PASS: ceil(color2(-0.5, -1.5)) == color2(ceil(xcomp(color2(-0.5, -1.5))), ceil(ycomp(color2(-0.5, -1.5)))) | ||
PASS: floor(color2(0.5, 1.5)) == color2(floor(xcomp(color2(0.5, 1.5))), floor(ycomp(color2(0.5, 1.5)))) | ||
PASS: floor(color2(-0.5, -1.5)) == color2(floor(xcomp(color2(-0.5, -1.5))), floor(ycomp(color2(-0.5, -1.5)))) | ||
PASS: sqrt(color2(0.5, 1.5)) == color2(sqrt(xcomp(color2(0.5, 1.5))), sqrt(ycomp(color2(0.5, 1.5)))) | ||
PASS: exp(color2(0.5, 1.5)) == color2(exp(xcomp(color2(0.5, 1.5))), exp(ycomp(color2(0.5, 1.5)))) | ||
PASS: log(color2(0.5, 1.5)) == color2(log(xcomp(color2(0.5, 1.5))), log(ycomp(color2(0.5, 1.5)))) | ||
PASS: log2(color2(0.5, 1.5)) == color2(log2(xcomp(color2(0.5, 1.5))), log2(ycomp(color2(0.5, 1.5)))) | ||
PASS: mix(color2(1.0, 2.0), color2(21.0, 22.0), 0.0) == color2(1.0, 2.0) | ||
PASS: mix(color2(1.0, 2.0), color2(21.0, 22.0), 1.0) == color2(21.0, 22.0) | ||
PASS: mix(color2(1.0, 2.0), color2(21.0, 22.0), 0.5) == color2(11.0, 12.0) | ||
PASS: smoothstep(color2(1.0, 2.0), color2(3.0, 4.0), color2(0.0, 0.0)) == color2(0.0, 0.0) | ||
PASS: smoothstep(color2(1.0, 2.0), color2(3.0, 4.0), color2(10.0, 10.0)) == color2(1.0, 1.0) | ||
PASS: smoothstep(color2(1.0, 2.0), color2(3.0, 4.0), color2(2.0, 3.0)) == color2(0.5, 0.5) | ||
PASS: clamp(color2(0.0, 0.0), color2(1.0, 2.0), color2(2.0, 3.0)) == color2(1.0, 2.0) | ||
PASS: clamp(color2(10.0, 10.0), color2(1.0, 2.0), color2(2.0, 3.0)) == color2(2.0, 3.0) | ||
PASS: clamp(color2(1.5, 2.5), color2(1.0, 2.0), color2(2.0, 3.0)) == color2(1.5, 2.5) | ||
PASS: clamp(color2(0.25, 0.5), 1.0, 2.0) == color2(1.0, 1.0) | ||
PASS: clamp(color2(2.25, 2.5), 1.0, 2.0) == color2(2.0, 2.0) | ||
PASS: clamp(color2(1.25, 1.5), 1.0, 2.0) == color2(1.25, 1.5) | ||
PASS: max(color2(1.0, 4.0), color2(2.0, 3.0)) == color2(2.0, 4.0) | ||
PASS: min(color2(1.0, 4.0), color2(2.0, 3.0)) == color2(1.0, 3.0) | ||
PASS: fmod(color2(5.0, 8.0), color2(2.0, 3.0)) == color2(fmod(xcomp(color2(5.0, 8.0)), xcomp(color2(2.0, 3.0))), fmod(ycomp(color2(5.0, 8.0)), ycomp(color2(2.0, 3.0)))) | ||
PASS: pow(color2(2.0, 3.0), color2(2.5, 3.5)) == color2(pow(xcomp(color2(2.0, 3.0)), xcomp(color2(2.5, 3.5))), pow(ycomp(color2(2.0, 3.0)), ycomp(color2(2.5, 3.5)))) | ||
PASS: sign(color2(0.5, -0.5)) == color2(sign(xcomp(color2(0.5, -0.5))), sign(ycomp(color2(0.5, -0.5)))) | ||
PASS: sign(color2(-0.5, 0.5)) == color2(sign(xcomp(color2(-0.5, 0.5))), sign(ycomp(color2(-0.5, 0.5)))) | ||
PASS: sin(color2(0.5, 1.5)) == color2(sin(xcomp(color2(0.5, 1.5))), sin(ycomp(color2(0.5, 1.5)))) | ||
PASS: cos(color2(0.5, 1.5)) == color2(cos(xcomp(color2(0.5, 1.5))), cos(ycomp(color2(0.5, 1.5)))) | ||
PASS: tan(color2(0.5, 1.5)) == color2(tan(xcomp(color2(0.5, 1.5))), tan(ycomp(color2(0.5, 1.5)))) | ||
PASS: asin(color2(0.5, 0.25)) == color2(asin(xcomp(color2(0.5, 0.25))), asin(ycomp(color2(0.5, 0.25)))) | ||
PASS: acos(color2(0.5, 0.25)) == color2(acos(xcomp(color2(0.5, 0.25))), acos(ycomp(color2(0.5, 0.25)))) | ||
PASS: atan2(color2(0.5, 1.5), color2(1.0, 4.0)) == color2(atan2(xcomp(color2(0.5, 1.5)), xcomp(color2(1.0, 4.0))), atan2(ycomp(color2(0.5, 1.5)), ycomp(color2(1.0, 4.0)))) | ||
PASS: atan2(color2(2.0, 0.5), 1.0) == color2(atan2(2.0, 1.0), atan2(0.5, 1.0)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright Contributors to the Open Shading Language project. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | ||
|
||
command = testshade("test") |
Oops, something went wrong.