Const.me
Posts: 6
Joined: Sat Mar 14, 2020 6:30 pm

No SSBO for vertex shaders?

Wed Apr 22, 2020 9:13 pm

Here’s GLES code of the vertex shader:

Code: Select all

struct sDrawCallData
{
	vec4 something;
	vec4 somethingElse;
};
buffer drawCalls
{
	sDrawCallData drawCallsPayload[];
};
Linker output:
error: Too many vertex shader storage blocks (1/0)
So the SSBO limit is 0, i.e. they are not available whatsoever.

Is there some workarounds to make buffers work? Or should I replace that data structure with a 2D float4 texture and use texelFetch() to read my 2 values? Or should I replace, or supplement, vertex shader with a compute shader?

P.S. The data in that buffer is dynamically updated by CPU every frame. That’s why I would prefer the buffer, especially given the GPU reports support of this extension: https://www.khronos.org/registry/OpenGL ... torage.txt

Update: the API reports GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0 and GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16. If true, it means vertex shaders can’t read from buffers, but they can read from textures, up to 16 of them.

txenoo
Posts: 2
Joined: Tue Aug 06, 2019 12:23 pm

Re: No SSBO for vertex shaders?

Tue Apr 28, 2020 5:23 pm

That is correct, SSBO are currently not available in geometry stages.

Here is the commit in Mesa with the explanation of the current status.

Code: Select all

commit d23b47fda57f63607a134f0ae31397c4ff983ec1
Author: Eric Anholt <[email protected]>
Date:   Mon Apr 22 11:24:55 2019 -0700

    v3d: Disable SSBOs and atomic counters on vertex shaders.
    
    The CTS fails on
    dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.*vertex
    when they are enabled, due to the VS being run for both bin and render.  I
    think this behavior is expected to be valid, but I can't find text in
    atomic counters or SSBO specs saying so (the closed I found was in
    shader_image_load_store).  Just disable it for now, since the closed
    source driver doesn't expose vertex atomic counters/SSBOs either.


Const.me
Posts: 6
Joined: Sat Mar 14, 2020 6:30 pm

Re: No SSBO for vertex shaders?

Thu Apr 30, 2020 6:01 am

That’s unfortunate. I don’t need any atomic counters, I just need to read from a buffer.

Apparently, textures don’t have the precision: viewtopic.php?f=68&t=266652
6 out of 8 of my floats are 3x2 transformation matrix, I need all 32 bits of the precision for them.

Using a uniform buffer for now, but the limit is small, 64kb, only enough for 4k vectors.

P.S. That’s 13 years of lag behind Windows: HLSL has Buffer<float4> since D3D 10.0…

Brian Beuken
Posts: 219
Joined: Fri Jan 29, 2016 12:51 pm

Re: No SSBO for vertex shaders?

Fri May 22, 2020 12:01 pm

hmm that is unfortunate, I am working on some tutorials for compute shaders and wanted to use the RPi4 for that.
Is it likely to be fixed soon, I know driver dev is an ongoing process.

Also does anyone know what the status is on OpenGLES3.2?


Edit, I have found that this is not just Rpi4 that has this issue, quite a few 3.1 GPU's on SBC's also report 0 for GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 's available
So its more a mesa issue than anyting specific to Rpi4 I suspect, Jetson Nano with its Nvidia supplied drivers gives better results. But I guess since they make the GPU, they're not having to guess on how things work
This GPU can support :32 Textures
This GPU can support :16 vertex SSBO
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Return to “OpenGLES”