Questions tagged [ssbo]

18 questions
3
votes
1 answer

Can an SSBO binding point index be any value?

When you specify "location = x" in a shader to specify a shader storage or uniform buffer binding point, can that number be any value? Is this binding point independent of which shader is currently bound? Would it be possible to bind all my ubos and…
1
vote
1 answer

Async SSBO Readback

When I call GetBufferSubData with my Shader Storage Buffer Object there is typically a 4ms delay. Is it possible for my application to do work during that time? // start GetBufferSubData // do client/app/CPU work // (wait if needed) // read results…
1
vote
0 answers

glLinkProgram hangs forever when creating large arrays inside a struct

I am trying to pass a large amount of data to my fragment shader, however when I try and compile and link the shader, glLinkProgram stalls and hangs forever (no errors are raised, and nothing happens except a black screen) The fragment shader…
0x003
  • 65
  • 9
1
vote
0 answers

SSBO vs VBO performance

The standard approach to rendering is to first define VBO and then use layout in layout (location = 0) in vec4 point; void main(){ gl_Position = point; } However, the exact same result could be achieved with SSBO layout(std430, binding = 0)…
alagris
  • 1,838
  • 16
  • 31
1
vote
2 answers

Can SSBO be read/write within the same shader?

I wrote a small tessellation program. I can write to a SSBO (checked output using RenderDoc) but reading the data back right away in the same shader (TCS) does not seem to work. If I set the tessellation levels directly, I can see that my code…
1
vote
1 answer

Unexpeced value upon accessing an SSBO float

I am trying to calculate a morph offset for a gpu driven animation. To that effect I have the following function (and SSBOS): layout(std140, binding = 7) buffer morph_buffer { vec4 morph_targets[]; }; layout(std140, binding = 8) buffer…
Makogan
  • 8,208
  • 7
  • 44
  • 112
1
vote
1 answer

glMapBufferRange fails with GL_OUT_OF_MEMORY on Samsung Galaxy S8 / S10 / Note 10 Lite

I am using CameraView library for Android to capture frames from the camera and process them with OpenGL shaders. I have encountered some strange behavior while trying to use compute shaders. I want to grab a camera frame as an RGB buffer of…
SadSido
  • 2,511
  • 22
  • 36
1
vote
1 answer

Rendering a float buffer on screen with OpenGL ES

I have a FloatBuffer as an output from the neural network, where the RGB channels are encoded with [-1 .. +1] values. I would like to render them on-screen, using GLSurfaceView. What is the best way to handle it? I can dump the buffer into SSBO and…
SadSido
  • 2,511
  • 22
  • 36
0
votes
0 answers

std430 struct alignment

What are the rules to align a struct according to std430? I have this struct on the CPU side: struct material { vec3 kd; vec3 ks; vec2 alpha; // Anisotropic roughness vec3 emission; vec3 emissionStrength; }; Where should I add…
RandomPigYT
  • 47
  • 1
  • 6
0
votes
0 answers

Send std::vector to glsl through SSBO

I am creating a shader in c++ with a resizable amount of lights I can pass to the shader. It seems I can pass a std::vector to a glsl array using SSBO, a feature implemented in modern OpenGL 4.2. I started by setting the glsl version to 460 core…
Lixt
  • 201
  • 4
  • 19
0
votes
0 answers

Having troubles using a compute shader in OpenGL for arbitrary computation

I am trying to take an array of custom structs and put it onto the GPU to perform some operation on, before returning the result back to the CPU. For this example I'm using a statically sized array, but later on I won't know the size of the array…
Andrey
  • 35
  • 6
0
votes
0 answers

Opengl Large SSBO hangs when reading

I have multiple SSBO(4 SSBO) of size 400400100 ints and my fragment shader updates the value of this ssbo. I do this by calling the drawelements call and I read the data after the draw call by first binding the specific SSBO and then calling the…
qwerty
  • 49
  • 9
0
votes
1 answer

Can a GLSL fragment shader run without a framebuffer and similar inconveniences?

Reapeating the above: Can a GLSL fragment shader run without a framebuffer and any rasterization stage? This perfect answer gives an insight about where to start with SSBO's. The answer has a link to OpenGL ARB extension that has a boilerplate code.…
user14063792468
  • 839
  • 12
  • 28
0
votes
1 answer

OpenGL SSBO Instancing

Binding a SSBO and accessing it via gl_InstanceID seems to work but im getting these really strange position artifacts and im not sure where they are coming from. The way im generating the random positions is pretty standard and i also tested the…
0
votes
0 answers

How to read SSBO data into CPU in LWJGL

I want a compute shader that writes 1's in the output buffer. I compile the shader and attach it to the program, then I call glDispatchCompute() function and I wait until compute shader ends. The only problem I have now is that I am not sure how to…
Ethan Ma
  • 69
  • 3
  • 7
1
2