-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reparameter string needed to be ustringhash (#1841)
This patch fixes a regression that went unnoticed during the ustringhash conversion. Right now OSL expects strings to be represented at runtime as ustringhashes, but interactive parameters' values are still being stored as ustrings. This requires fixing in two locations, first the code that sets the initial value of an interactive parameter, and second the code that copies updated parameters into the interactive buffer. Tests: New reparameter-strings test. Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
- Loading branch information
Showing
7 changed files
with
48 additions
and
5 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
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,4 @@ | ||
Compiled test.osl -> test.oso | ||
test_string = initial value | ||
test_string = updated value | ||
|
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,15 @@ | ||
#!/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(" ".join([ | ||
"--layer lay0", | ||
"--param:type=string:interactive=1 test_string 'initial value'", | ||
"test --iters 2", | ||
"--reparam:type=string:interactive=1 lay0 test_string 'updated value'", | ||
])) | ||
|
||
outputs = [ "out.txt" ] | ||
|
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 test(string test_string = "override me" [[ int interactive = 1 ]]) | ||
{ | ||
printf("test_string = %s\n", test_string); | ||
} |