I have Rust application using crate "glow". It is currently running on:
linux / x86_64
wasm32_unknown_unkonwn / browser
Are there GLSL debugger tools for either? (The basic OpenGL / WebGL setup is fine; basic shaders running fine, main problem is: doing something funky a fragment shader sampling a texture for data, and something going wrong there.)
SSBOs can be much larger. The OpenGL spec guarantees that UBOs can be up to 16KB in size (implementations can allow them to be bigger). The spec guarantees that SSBOs can be up to 128 MB . Most implementations will let you allocate a size up to the limit of GPU memory.
This would solve so much of my problems. Unfortunately, it says: core since OpenGL 4.3 -- is this supported in WebGL 2.0 ?
which returns float for the bytes we store. I think this is some horrendous normalization where for byte 0<= b <= 255, it returns the float 0. <= b/255.0 <= 255.0. I think the way to 'recover' this is to just round(x * 255.0). However -- I would prefer to just read the byte in the first place.
When sampling textures in WebGL, can we just read off an unsigned byte, or are we limited to reading out floats ?
I believe you are incorrect in that assertion, it should be 0.0 <= b/255.0 <= 1.0.
According to this doc page on sampler types, and this page on the texture function, if you call texture with a usampler2D, you will be returned a uvec4 (which I presume would return the original 0-255 ranged data, and could be used to reconstruct the original u32).
Try declaring your sampler as usampler2D, and ensuring that the backing storage is indeed r8g8b8a8 or equivalent (IE, the order of r, g, b, a, are irrelevant), and sampling using that to acquire a uvec4.
I got it working with float sampler + round(x * 255.0)
I believe the documentation you are pointing to is correct, and indeed it should be possible to do usampler2D and get back uvec4. I tried verifying this; for some stupid reason, it causes Xorg to freeze.
I am certain that my code is buggy, but if changing the frag shader from sampler2D to usampler2D causes Xorg to freeze, there may be some driver bugs we've just run into.