Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Base closure pointer in layer is incorrect when using batched execute

オープン
#1,801 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp, linux

調査の方向性

添付された最小テストケース、特に test2.cpp から始め、USE_BATCHED を有効にした場合と無効にした場合の両方で失敗を再現してください。process_bsdf_closure、MxLayerParams、および osl の layer closure 処理を追跡します。バッチ実行で diffuse closure が base として報告され、既存の assertion が失敗しなくなり、バッチなしの出力が正しいままであれば完了です。

索引モデルが issue の本文から書いたものです。

説明

batch shading bug shading system
Problem

Base closure pointer in osl layer points to its parent layer closure when using batched execute while it should actually point to a diffuse closure.

void process_bsdf_closure(const ClosureColor* closure) {
const ClosureComponent* comp = closure->as_comp();
const MxLayerParams* srcparams = comp->as<MxLayerParams>();
assert(srcparams->base != closure);

minimal_test_case.zip

Steps to Reproduce

Download the attached minimal sample and issue the following commands:

g++ -DUSE_BATCHED -mavx2 -mfma -mtune=skylake -mf16c -g test2.cpp -loslcomp -loslexec -loslnoise -loslquery -lOpenImageIO -lOpenImageIO_Util
./a.out
parsing mx layer closure
parsing generalized schlick closure
Error: base closure in mx layer points back to currently parsed closure

g++ -mavx2 -mfma -mtune=skylake -mf16c -g test2.cpp -loslcomp -loslexec -loslnoise -loslquery -lOpenImageIO -lOpenImageIO_Util
./a.out
parsing mx layer closure
parsing generalized schlick closure
parsing diffuse closure
<correct output, no problem!>

Here's .osl shader codes in the .zip:

shader layer_test(
                            color base_color = color(0.8, 0.8, 0.8),
                            color specular_tint = color(1.0),
                            float roughness = 0.5,
                            normal Tangent = normalize(dPdu),
                            output closure color BSDF = 0)
{
BSDF = base_color * diffuse(N);
color F0 = specular_tint;
color F90 = color(1.0);
BSDF = layer(generalized_schlick_bsdf(N, Tangent, color(1.0), color(0.0), roughness, roughness, F0, F90, 0.0, "ggx"),BSDF);
}
surface output_surface(closure color Surface = 0)
{
  Ci = Surface;
}
Versions
  • OSL branch/version: v1.13.8.0
  • OS: linux 64-bit 5.10.0-18-amd64
  • C++ compiler: g++ 10.2.1
  • LLVM version: 11.0.1-2
  • OIIO version: v2.5.4.0
主要言語
C++
スター
2.3k
フォーク
415
平均マージ
2日 14時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AcademySoftwareFoundation/OpenShadingLanguage のほかの issue

AcademySoftwareFoundation/OpenShadingLanguage の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。