Questions tagged [compute-shader]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
205 views

How to properly create textures using DSA for ImageTexture in OpenGL

For the old approach, generating a texture for the ImageTexture for compute shaders would look like this: ...
0 votes
1 answer
76 views

How do I tell what kind of shader an hlsl shader is by looking at the code?

How do I tell what kind of shader this is: https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianSplatting.hlsl Among these options: vs – vertex shader ps – pixel shader ...
0 votes
1 answer
102 views

Do GL compute shaders trigger TDR if they crash. Not just timeout?

I'm getting a TDR trigger after 4ms with a GL4.3 compute shader. tdrDelay is currently set to 30 secs, this obviously isn't long enough to get a timeout with the default Windows 11 tdrDelay value let ...
1 vote
1 answer
75 views

Partial Workgroup release of compute shaders?

When using compute shaders, some workgroups can be faster than others, for example when all invocations within one group go into the 'if' case, where on another workgroup the invocations go into the '...
0 votes
1 answer
414 views

OpenGL compute local size vs. performance

Does anybody know if using very small local sizes in compute shaders will hurt performance? eg. If I do this in a shader: ...
1 vote
1 answer
199 views

Workgroup size performance change?

I know, that when using compute shader, the invocations should to be grouped with respect to a multiple of the hardware minimum workgroup size (Nvidia 32, AMD 64). Otherwise cores are blocked. In case ...
2 votes
1 answer
1k views

Feeding vertex data to a compute shader

I'm writing a CAD program in vulkan. In my current design, I have line paths represented as large vertex buffers for rendering. I would like to implement an algorithm for extruding the path outwards, ...
0 votes
1 answer
132 views

Rendering light balls: Where to do perspective calculations?

After rewatching Bisqwit's starfield renderer video, I've decided to try to rewrite the program in order to learn more about compute shaders and shader programming in general. My knowledge at this ...
3 votes
2 answers
6k views

Optimizing compute shader with thread group shared memory

I'm currently learning compute shaders and I'm trying to write an optimized Game Of Life. I have a first version working that uses a Shader Storage Buffer Object. I dispatch a thread per cell I want ...
0 votes
0 answers
49 views

Opengl binding different mipmap levels of same texture2darray for use in compute shader. How to handle variable nr of levels?

So I want to make a compute shader that uses a coarse-to-fine approach. As I have learned about open gl mipmap levels it seems they could be very useful. However the only binding method which I have ...
-1 votes
1 answer
157 views

How do I view my vertex colors that I specified through the texture I've applied on my objec [OpenGL]?

I thought that if I used an image with a transparent background, I would still be able to see the colors I had specified in my vertex attribute buffer. ...
1 vote
1 answer
100 views

GLSL trying to bind two different layers from the same texture array as images. Should it work and if so what am I doing wrong?

I am new at this particular site in the SE ecosystem, but not to computer graphics in general. If I'm in the wrong spot feel free to redirect me. My question regards glsl programming and binding two ...
1 vote
0 answers
321 views

Compute shader in DirextX: difference between four kinds of memory barriers

There are four kinds of memory barriers in DirectX. Their names and definitions are: DeviceMemoryBarrier: Blocks execution of all threads in a group until all ...
0 votes
0 answers
267 views

Does RWStructuredBuffer have built-in overflow protection in hlsl?

It appears that reads to indices outside the range of a ComputeBuffer always return 0, and writes to out-of-range indices do not cause any exceptions or runtime errors. Is there built-in range-...
0 votes
1 answer
46 views

OpenCL WorkGroupSize compared to OpenGL compute shader WorkGroupSize

I've read, that OpenCL kernels are grouped like OpenGL compute shaders. That means, that you can define how many invocations should be executed within a workgroup. These invocations which are in the ...
0 votes
1 answer
424 views

OpenGL compute shader workgroup synconization

I am calculating the Summed Area Table(SAT) of a texture with help of a compute shader in OpenGL. The texture which needs to be summed, has a dimension size of more than my GPU supports (...
1 vote
1 answer
231 views

Having trouble understanding advection from GPU gems fluid dynamics example

So I am trying to implement a fluid simulation, as described in Chapter 38 of GPU Gems. I am also drawing heavily from the excellent implementation by Pavel. Where I'm getting a bit stuck is with ...
0 votes
0 answers
396 views

Is it possible to put matrix computation in Compute Shader?

With the library glm, we can do matrix computations on the CPU. However, the GPU is more suitable to do this. So what if I put the matrix computations in a Compute ...
0 votes
0 answers
558 views

Bind shader storage buffer object for vertex input

I'm trying to learn about compute shaders, and as such decided to give it a go at implementing the particle system described in these slides: https://www.khronos.org/assets/uploads/developers/library/...
1 vote
1 answer
900 views

On modern GPUs, what hardware do vertex/pixel shaders have access to that compute shaders don't?

Suppose that someone implemented rendering for a video game using entirely GPGPU apis, like compute shaders or CUDA. Would it be possible to achieve the same performance as standard graphics pipelines ...
5 votes
2 answers
4k views

What's the point of "work groups" for OpenGL compute shaders?

glDispatchCompute has the number of work groups as arguments. What is the point of having work groups? How are they useful, compared to just having NxM independent pixel calculations with a known (x,...
0 votes
0 answers
111 views

Inter-Process communication in compute shaders

How do I write a code to facilitate common shared memory for communication between multiple shaders as well as processes within them in python?
1 vote
1 answer
205 views

SSAO with reconstructed depths yields strip artifacts

I wrote an ssao algorithm with compute shaders and view-position-reconstruction from the depth buffer. It works great for objects near by but results in strip or banding artifacts for large planes ...
1 vote
1 answer
2k views

Compute shader workgroups execution and size [closed]

I want to clarify how are workgroups executed on various GPUs, thus I have several questions. I know that different GPU architectures work differently, but I expect an answer YES if there is single (...
3 votes
1 answer
777 views

Compute Shader shared average value

Short Question: How can i integrate a buffer variable in a compute shader over each pixel i.e. how can i ensure memory coherence in such a case? Long Question: I've written a deferred renderer with ...
0 votes
0 answers
45 views

Offsetting value in shader causes unexpected/wrong logic

Let me explain what I am doing. I am trying to reduce the memory footprint of a voxel based algorithm by storing the voxel data as a hash map in an SSBO, as opposed to a 3D image. I am visualizing the ...
0 votes
0 answers
104 views

Unity crashes when running path tracing

I'm studying path tracing, at the moment I created a compute shader that aims to calculate the intersection of rays with meshes. However, when I run the code the unity crashes, displaying a graphics ...
2 votes
1 answer
5k views

Performance difference in OpenGL compute shader vs Vulkan Compute Shader vs Cuda/OpenCL and others

I have been told there is no performance difference if you are skilled enough when it comes to gpu computing. And cuda only performs better because nvidia wants it to. I have also read graphic api's ...
59 votes
3 answers
35k views

When is a compute shader more efficient than a pixel shader for image filtering?

Image filtering operations such as blurs, SSAO, bloom and so forth are usually done using pixel shaders and "gather" operations, where each pixel shader invocation issues a number of texture fetches ...
0 votes
0 answers
73 views

Unity path tracing makes the pc crash

Good Morning. I'm testing Path Tracing techniques with unity, following this tutorial. http://three-eyed-games.com/2019/03/18/gpu-path-tracing-in-unity-part-3/ But I'm in trouble. Whenever I try to ...
1 vote
2 answers
589 views

Is there an efficient way to achieve color blending in compute shaders?

What I want is a function like imageStore, but instead of replacing a value - applying a blend operation to it, e.g. addition. It is not possible to do something ...
1 vote
1 answer
67 views

Mat4 that is written to a storage buffer in a compute shader has an altered value when read back

I am attempting to use a compute shader to calculate joint transforms for animations. I use a loop to calculate the global joint transforms from the local transforms. Relevant code below: ...
1 vote
1 answer
1k views

GLSL Compute Shader Setting "shared" memory buffer size

Is it possible to set the size of the shared memory of a compute shader workgroup from the host code? There is a way to do this in CUDA and I am suspecting that, since there is an GLSL extension to ...
1 vote
0 answers
107 views

GL_OUT_OF_MEMORY Error when glDispatchCompute takes longer

I built a simple Ray Tracer which takes use of OpenGL's Compute Shader and traces ".obj" Files. The results are passed to the Host-Program via glMapBufferRange after finishing computing. ...
1 vote
1 answer
98 views

Is glDispatchCompute(a,b,c) any faster than glDispatchCompute(a*b*c,1,1)?

In my application, there is no inherent 2D or 3D structure to the computer shader instances. So having multiple dimensions doesn't benefit me semantically in any way. I am wondering, whether it still ...
0 votes
2 answers
753 views

Using imageLoad/imageStore to perform atomic add

I have a rgba16f texture that I fill with values using nvidia GL_NV_shader_atomic_fp16_vector extension, which allows to perform ...
2 votes
1 answer
3k views

Using buffers correctly in OpenGL compute shaders

I'm re-writing an algorithm that I first wrote using matrix/vector operation into OpenGL kernels in order to try to maximiz the performances. I have a basic knowledge of OpenGL, so I was able to get ...
2 votes
0 answers
551 views

How to retrieve data from Compute Shader to CPU?

I want to retrieve data that has created by the compute shader but have no clue how it works. After researching a few forums and articles on how it should work and this is what I came up with. Compute ...
10 votes
1 answer
7k views

Performance of Compute Shaders vs. Fragment Shaders for Deferred Rendering

I have written a deferred renderer that can use either a fragment shader or a compute shader to execute the shading pass. Unfortunately, the compute shader implementation runs slower. I'm trying to ...
1 vote
1 answer
130 views

Reading from buffer versus calculating on the fly performance

I am creating a fast fourier transform algorithm for the compute shader - i am no expert on how GPUs really run optimally so thought i would ask here. I have the option to calculate on the fly or ...
2 votes
1 answer
2k views

Sharing memory between compute shader and pixel shader

I am relatively new to compute shaders and gpgpu in general so bear with me if i am missing the point somewhere. The main thing i do not yet understand / see is how to get memory from a compute ...
2 votes
0 answers
1k views

Groupshared memory and parallel reduction over multiple kernel dispatch

I am doing some parallel reduction and mostly following these nVidia slides. However they are not very detailed in places or I might be missing/misunderstanding something. Edit 2: While I figured ...
0 votes
1 answer
257 views

Only each third image in swapchain is being used, causing flickering

I've managed to write a "small" Vulkan program that outputs a solid color using compute shader directly to swapchain. However, it doesn't work properly. ImageMemoryBarriers I've setup don't ...
2 votes
1 answer
539 views

GLSL Compute Shader doesn't run for large inputs

The shader takes an SSBO of Photons that have a position, direction, wavelength and intensity and each thread is responsible for tracing exactly one photon through the grid, where at each grid cell ...
3 votes
1 answer
448 views

Compute shader textures compared 2D float4 arrays

I am wondering is there a difference in performance between using floating point textures as my 2D float4 array vs just passing in 2D float4 arrays? 2D float arrays eliminate the need to do texture ...
1 vote
2 answers
3k views

Passing parameters in Metal Compute Kernel using Swift 4

On the CPU side, I have a structure I want to pass to the compute kernel: ...
1 vote
1 answer
965 views

Procedural terrain: What's the best approach to calculate noise in the GPU?

A few years ago I started creating a procedural planet engine/renderer for a game in Unity, which after a couple of years I had to stop developing due to lack of time. At the time i didn't know too ...
4 votes
2 answers
915 views

Can gl_WorkGroupSize be set outside the compute shader?

I am migrating code from CUDA to OpenGL compute shaders. I could not find a way to set the local workgroup size outside the shader; is there a way to set gl_WorkGroupSize in the calling program like ...
1 vote
1 answer
796 views

Controling order of execution of a (compute) shader on an array of vertices (data) in Vulkan

Is it possible to force Vulkan to execute a shader on vertices (data) in a semi-consecutive manner? For example, if the data passed to the shaders as a binary tree, shader would process it one layer ...
1 vote
0 answers
757 views

Is a smaller local-size/threadgroup-size better for compute shader performance?

A compute shader defines the number of threads it requires to be executed. This number can be called "local size" or "threadgroup size" according to the API, and be factored into 3 separate dimensions ...