Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Unable to get osltoy working

未关闭
#2,035 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp

调研方向

通过使用 USE_QT=ON 和 DISABLE_OSLTOY=OFF 进行构建来复现该问题,然后使用示例着色器运行 osltoy 可执行文件。从 osltoy 入口点开始调查,了解为什么着色器没有被编译或运行,以及所报告的 QLayout 警告。完成的标准是着色器在输出窗口中显示为均匀的灰色,且没有布局错误。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

Building osltoy executable works, but it doesn't do anything when run. It opens the window, but shaders are neither compiled, nor run.

OSL version and dependencies

  • OSL branch/version: 1.13.12.0.2
  • OS: Rocky Linux release 9.4
  • C++ compiler: clang-15.0.7.3
  • LLVM version: llvm-15.0.7.1
  • OIIO version: OpenImageIO-2.4.13.0.4
  • Qt version: Qt-5.15.3.8

To Reproduce

Steps to reproduce the behavior:

  1. Build OSL with USE_QT=ON and DISABLE_OSLTOY=OFF
  2. Run the osltoy executable
  3. Image
  4. Whereas I expected the shader to show uniform grey in the output window.

Evidence

  • Error messages (paste them here exactly)
    QLayout: Attempting to add QLayout "" to OSL_v1_13::OSLToyMainWindow "", which already has a layout
  • Also during compilation I get the following warnings:
/scratch/dev/OpenShadingLanguage/src/testshade/optixgridrender.cpp:999:29: warning: variable 'i' set but not used [-Wunused-but-set-variable]
                for (size_t i = 0; !format_end_found; i++) {
                            ^
/scratch/dev/OpenShadingLanguage/src/testshade/optixgridrender.cpp:999:29: warning: variable 'i' set but not used [-Wunused-but-set-variable]
                for (size_t i = 0; !format_end_found; i++) {

These should be switched for while statements. I'll make a separate PR for this.

  • Example shader code (if applicable)
shader thing
(
  output color Cout = 0.5
)
{
}

It'd be great for someone else to confirm they can reproduce this behavior, thanks!

主要语言
C++
星标
2.3k
派生
415
平均合并
2 天 14 小时
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AcademySoftwareFoundation/OpenShadingLanguage 的其他 Issue

查看 AcademySoftwareFoundation/OpenShadingLanguage 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。