AcademySoftwareFoundation / AcademySoftwareFoundation/OpenShadingLanguage

Unable to get osltoy working

Open
#2,035 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.3k
Forks
414
Avg merge
3d 1h
Merged PRs (30d)
10

Description

**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!

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by building with USE_QT=ON and DISABLE_OSLTOY=OFF, then run the osltoy executable with the example shader. Start at the osltoy entry point and investigate why the shader is not compiled or run alongside the reported QLayout warning. Done means the shader displays uniform grey in the output window without the layout error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.