Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to link compute shader #6

Open
alecvn opened this issue May 20, 2019 · 5 comments
Open

Error: Unable to link compute shader #6

alecvn opened this issue May 20, 2019 · 5 comments

Comments

@alecvn
Copy link

alecvn commented May 20, 2019

Hi

When I check out the project I get the following error:

-------- GLSL link error: Compute info
------------
0(53) : error C5041: cannot locate suitable resource to bind variable "TempArray0". Possibly large array.
0(14) : error C5041: cannot locate suitable resource to bind variable "ImmCB_0_0_1". Possibly large array.

I'm on Ubuntu 18.04 and Unity 2018.3.0f2. My graphics API is OpenGLCore.

@alecvn
Copy link
Author

alecvn commented May 22, 2019

So it would seem like the reason for this is that I'm on OpenGLCore and not DirectX. I will see if I can make it work for OpenGL and post a solution here, but I'm a little in over my head.

@StripedMonkey
Copy link

@alecvn Did you ever get this working? I've taken a stab at the issue, and it seems to be related to the fact that the Lookup Table for the Marching cubes is a convenient 4096 ints long. According to what I'm seeing you can't have an integer array that large in OpenGL and you have to use a buffer to store said information. But I'm unsure of how to set everything up in hlsl.

I'm going to work on this myself, but I'm hoping you have a head start that I can use as I'm a bit over my head as well. It should be noted that issue #11 is the same issue.

My current plan is to try and switch over to vulkan and get that working, but the (probably) simpler solution would be to implement it in openGL properly using buffers.

@alecvn
Copy link
Author

alecvn commented May 15, 2020

@StripedMonkey I'm afraid I never got this working, no. I don't think Sebastian really has time to help people out with these Coding Adventures either, as I've never seen him respond to tickets against them. So I think you're on your own I'm afraid. You'll probably get at least some support over at the GameDev StackExchange. Please do update here if you manage to solve the problem.

@kolop315
Copy link

I fixed it by changing the array of 256x16 ints to only 256x2. Each value was at most 11, so it only really needs 4bits out of the 32 an int holds. I also replaced the "-1" values with 15(binary 1111 or hex F). After the permutation of the corners is known, I convert the 2 ints back into an array of 16. Still, I'm pretty sure that shaders are not meant to hold look-up tables of any sort. I just altered what was already there, rather than doing it as it really should be done(presumably with buffers).

Changed-Files.zip

@StripedMonkey
Copy link

Lookup tables are 100% not what shaders or GPUs are really designed to hold heh. I'm glad you got it working. :D

It's been a bit since I messed with this, but if I recall correctly I had concluded that DX11 had the ability to have arbitrary static integer tables larger than 256 (or was it 1024?) but OpenGL had nothing that would have been viable in the previous state of the tables and Vulkan was a bit beyond what I was willing to sink the time investment into, so that didn't really come to pass.

Based on what I'm reading buffers might indeed be the "proper" solution, but I can't seem to figure out why they didn't come up as a solution when I was reading about it. Was the vulkan conversion of hlsl shaders broken for buffers? I recall something like that being a thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants