Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

compute shader compilation bugs?

Discussion in 'Shaders' started by gaiastellar, Nov 13, 2020.

  1. gaiastellar

    gaiastellar

    Joined:
    Nov 8, 2013
    Posts:
    57
    hi all,
    there seems to be some weird errors when trying to compile a compute shader. It claims there is 'unexpected token" at RWTexture2D<float4> result

    all i have to do is delete it, and rewrite it exactly the same and hey presto, the error is gone.

    other things too -

    a structured buffer with more than 4 elements (ints and floats) and the error is that it is out of memory for block ... etc etc
    errors for stuff that shouldnt be errors..

    anyone else getting this problem on unity 2019.4.13f1?

    thanks
     
  2. gaiastellar

    gaiastellar

    Joined:
    Nov 8, 2013
    Posts:
    57
    hi to anyone looking to reply - ive got it sorted thanks It was all down to the #include i was using - it was an .HLSL file .I changed it to a .cginc file, put it in the same folder as the shader that was using it, problem solved!! yay!!