OpenShadingLanguage icon indicating copy to clipboard operation
OpenShadingLanguage copied to clipboard

Unable to get osltoy working

Open etheory opened this issue 2 months ago • 1 comments

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!

etheory avatar Oct 30 '25 02:10 etheory

Based on @fpsunflower's suggestion, loading a file first means it can compile, but the tool crashes so frequently as to make it unusable.

I can only get a simple red shader working. If I add metadata, segfault. If I add anything vaguely complicated, it segfaults.

I need to look into it further, but unfortunately in it's current state it's unusable still.

etheory avatar Nov 19 '25 12:11 etheory