problem with integer geometry attributes and batched shader execution
メンテナーはふだん 1 日以内に返信
@AlexMWells がすでに取り組んでいます。
2025年2月8日 から。
評価
この issue はまだ評価されていません。
説明
I'm seeing a problem with batched execution that I've managed to distill to the repro case below with testshade. Basically, if I have an integer geometry attribute, then batched OSL execution seems to disregard what the renderer writes to the destination depending on what the default value is specified in the shader. For eample, suppose I have a shader with the following parameter declaration, int face_idx = 0 [[int lockgeom=0]], the value returned by the renderer doesn't make it to the shader. But in this case it does: face_idx = 2 [[int lockgeom=0]]. FWIW, a value of '1' also fails.
This is based on OSL-v1.14.2.0 which goes dates back to September so it's possible this has been fixed?
Here's my example shader:
shader example(int face_idx = 0 [[int lockgeom = 0]],
output color dst = 0)
{
dst = color(face_idx * 0.25, 0, 0);
}
A patch to add the face_idx user-data to batched testshade:
diff --git a/src/testshade/batched_simplerend.cpp b/src/testshade/batched_simplerend.cpp
index ea2acbdf..6618fba7 100644
--- a/src/testshade/batched_simplerend.cpp
+++ b/src/testshade/batched_simplerend.cpp
@@ -21,6 +21,7 @@ struct UniqueStringCache {
, red("red")
, green("green")
, blue("blue")
+ , face_idx("face_idx")
, lookupTable("lookupTable")
, blahblah("blahblah")
, options("options")
@@ -51,6 +52,7 @@ struct UniqueStringCache {
ustring red;
ustring green;
ustring blue;
+ ustring face_idx;
ustring lookupTable;
ustring blahblah;
ustring options;
@@ -663,7 +665,17 @@ BatchedSimpleRenderer<WidthT>::get_userdata(ustringhash name,
// For testing of interactions with default values
// may not provide data for all lanes
- if (name == ucache().s && Masked<float>::is(val)) {
+ if (name == ucache().face_idx && Masked<int>::is(val)) {
+ printf("found face_idx!\n");
+ Masked<int> out(val);
+ for (int i = 0; i < WidthT; ++i) {
+ if (out[i].is_on()) {
+ out[i] = int(4 * bsg->varying.u[i]);
+ }
+ }
+ return out.mask();
+ }
+ else if (name == ucache().s && Masked<float>::is(val)) {
Masked<float> out(val);
for (int i = 0; i < WidthT; ++i) {
// NOTE: assigning to out[i] will mask by itself
Command line:
env TESTSHADE_BATCH_SIZE=16 testshade --batched --res 256 256 -o dst output.exr example
Here are the images I get:
With face_idx = 0 [[in lockgeom=0]] I get the wrong image:
With face_idx = 2 [[in lockgeom=0]] I get the expected image:
Is anyone able to reproduce this?
Thanks!
- 主要言語
- C++
- スター
- 2.3k
- フォーク
- 415
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 13
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AcademySoftwareFoundation/OpenShadingLanguage のほかの issue
-
build / testing / port / CI
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2148 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AcademySoftwareFoundation/OpenShadingLanguage#2109 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
AcademySoftwareFoundation/OpenShadingLanguage#2175 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
AcademySoftwareFoundation/OpenShadingLanguage#2146 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
AcademySoftwareFoundation/OpenShadingLanguage#2135 ·
メンテナーはふだん 1 日以内に返信
AcademySoftwareFoundation/OpenShadingLanguage の issue をすべて見る
似ている issue
-
Unconfirmed bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
luanti-org/luanti#17605 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
area: config area: firmware priority: P2 - medium size: S type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Mizithra/ActiveTerrain#16 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
grumpycoders/pcsx-redux#2171 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
bytedance/trae-agent#524 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信