You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
during some testing for #19 I run into ValueError: Invalid shader code. Now this does also show up in #15 but I checked most of those cases and they were indeed correctly invalid. These wouldn't even work on the website. But the checks in #15 use a filtered dataset to only try shadertoys that include a image pass, not anything else (like common, buffers).
But these cases are different, one example: https://www.shadertoy.com/view/3dGXDt
on the image tab, L223 has void mainImage (with more white spaces) but the shader_type method is explicitly looking for a string with a single white space to make sure it's glsl.
So the lazy fix would be to avoid the whole elif block and just default to glsl if it isn't wgsl. Shaders without the proper mainImage function will raise an error instead about missing entry point perhaps.
Other ideas would be some regex (which can catch comments, as the current implementation might) or AST parsing for a fitting function. But I feel like the whole wgpu pipeline will do most of that for us already. And it's not really the place, since the whole task of that function is to decide between wgsl and glsl.
Will test around a bit and hopefully submit a PR later today.
The text was updated successfully, but these errors were encountered:
during some testing for #19 I run into
ValueError: Invalid shader code.
Now this does also show up in #15 but I checked most of those cases and they were indeed correctly invalid. These wouldn't even work on the website. But the checks in #15 use a filtered dataset to only try shadertoys that include a image pass, not anything else (like common, buffers).But these cases are different, one example: https://www.shadertoy.com/view/3dGXDt
on the image tab, L223 has
void mainImage
(with more white spaces) but the shader_type method is explicitly looking for a string with a single white space to make sure it's glsl.So the lazy fix would be to avoid the whole elif block and just default to glsl if it isn't wgsl. Shaders without the proper
mainImage
function will raise an error instead about missing entry point perhaps.Other ideas would be some regex (which can catch comments, as the current implementation might) or AST parsing for a fitting function. But I feel like the whole wgpu pipeline will do most of that for us already. And it's not really the place, since the whole task of that function is to decide between wgsl and glsl.
Will test around a bit and hopefully submit a PR later today.
The text was updated successfully, but these errors were encountered: