-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move qualifying GroupData params onto stack
Signed-off-by: Chris Hellmuth <[email protected]>
- Loading branch information
Showing
14 changed files
with
112 additions
and
7 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.
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,10 @@ | ||
// Copyright Contributors to the Open Shading Language project. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | ||
|
||
// upstream shader connects directly to output parameter; | ||
// make sure we don't optimize it onto stack | ||
shader connected_output_shader(output float Val_Out = -2.) | ||
{ | ||
printf("side-effect\n"); | ||
} |
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,8 @@ | ||
// Copyright Contributors to the Open Shading Language project. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | ||
|
||
shader input_shader(output float Val_Out = -1.) | ||
{ | ||
Val_Out = float(cellnoise(u, v)); | ||
} |
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,8 @@ | ||
// Copyright Contributors to the Open Shading Language project. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | ||
|
||
shader main_shader(float Val_In = -3.) | ||
{ | ||
printf("Val_in = %f\n", Val_In); | ||
} |
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,17 @@ | ||
Compiled connected_output.osl -> connected_output_shader.oso | ||
Compiled input.osl -> input_shader.oso | ||
Compiled main.osl -> main_shader.oso | ||
Connect input_layer.Val_Out to main_layer.Val_In | ||
Val_in = 0.860313 | ||
|
||
Groupdata size: 12 | ||
Connect input_layer.Val_Out to main_layer.Val_In | ||
Val_in = 0.860313 | ||
|
||
Groupdata size: 8 | ||
Connect input_layer.Val_Out to test_layer.Val_Out | ||
Connect test_layer.Val_Out to main_layer.Val_In | ||
side-effect | ||
Val_in = 0.860313 | ||
|
||
Groupdata size: 12 |
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,25 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright Contributors to the Open Shading Language project. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | ||
|
||
shader_commands = " ".join([ | ||
"-shader input_shader input_layer", | ||
"-shader main_shader main_layer", | ||
"-connect input_layer Val_Out main_layer Val_In", | ||
]) | ||
for opt in [0, 1]: | ||
# Assert that groupdata is sized differently based on opt_groupdata param | ||
command += testshade("{} --options opt_groupdata={} --print-groupdata".format(shader_commands, opt)) | ||
|
||
# Assert that opt_groupdata correctly skips connected output parameters | ||
# Other skip conditions (renderer outputs, closures) are covered by existing tests | ||
shader_commands = " ".join([ | ||
"-shader input_shader input_layer", | ||
"-shader connected_output_shader test_layer", | ||
"-shader main_shader main_layer", | ||
"-connect input_layer Val_Out test_layer Val_Out", | ||
"-connect test_layer Val_Out main_layer Val_In", | ||
]) | ||
command += testshade("{} --print-groupdata".format(shader_commands)) |