Skip to main content

Questions tagged [compute-shader]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
42 views

GLSL Compute Shader Workgroup Execution

I want to know about "If there is branch command in compute shader, and it leads some workgroup ends earlier than others, then will the 'processing units' allocated for that workgroup be used for ...
idev's user avatar
  • 13
2 votes
1 answer
85 views

OpenGL - Compute Shader - How to set local_size

This question is about the best strategy to choose a local_size in OpenGL's compute shader. The application is a Lattice Boltzmann Method (LBM) with a number of cells ranging from 100,000 to 1 million....
techwinder's user avatar
0 votes
1 answer
81 views

Average luminence and auto exposure algorithm not seeming to work properly

I've been working on adding HDR rendering, auto exposure, and tone-mapping to my rendering engine, following this blog post for doing auto exposure and it sequel as well as a few side resources for ...
Alexis Purslane's user avatar
0 votes
0 answers
18 views

CCD Sensor parallel implementation of Smear

I have rendered an image with 32bit float color channels and want to simulate the smear effect of a CCD sensor (see figure 1). Figure 1: Image of a light source. Here the full-well capacities of the ...
Thomas's user avatar
  • 1,265
1 vote
0 answers
115 views

Most efficient way to calculate signed distance field (SDF) for pixel subsamples?

Looking how to utilize as much parallelization processing as possible for the following task: A screen-sized texture is completely black except for blue pixels which are in close proximity to geometry ...
Daniel Cardin's user avatar
0 votes
1 answer
86 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 ...
Ethan's user avatar
  • 103
0 votes
1 answer
931 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: ...
Chifti Saidi's user avatar
1 vote
1 answer
81 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 '...
Thomas's user avatar
  • 1,265
1 vote
1 answer
347 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 ...
Thomas's user avatar
  • 1,265
0 votes
1 answer
144 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 ...
mindoverflow's user avatar
0 votes
1 answer
140 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 ...
lfgtm's user avatar
  • 456
0 votes
1 answer
274 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: ...
Liyuu_'s user avatar
  • 9
1 vote
1 answer
140 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 ...
mathreadler's user avatar
1 vote
0 answers
442 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 ...
Fan's user avatar
  • 11
0 votes
0 answers
319 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-...
infosizzle's user avatar
0 votes
1 answer
56 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 ...
Thomas's user avatar
  • 1,265
0 votes
1 answer
556 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 (...
Thomas's user avatar
  • 1,265
1 vote
1 answer
322 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 ...
sak's user avatar
  • 159
0 votes
0 answers
517 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 ...
user18433's user avatar
0 votes
0 answers
688 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/...
alexpanter's user avatar
1 vote
1 answer
932 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 ...
while1fork's user avatar
0 votes
0 answers
118 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?
Ravindra's user avatar
-1 votes
1 answer
165 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. ...
Selfish Stoic's user avatar
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 (...
Emil Kabirov's user avatar
1 vote
1 answer
253 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 ...
Sprinklerkopf's user avatar
3 votes
1 answer
964 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 ...
Sprinklerkopf's user avatar
0 votes
0 answers
54 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 ...
Makogan's user avatar
  • 1,706
0 votes
0 answers
121 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 ...
Matheus Markies's user avatar
0 votes
0 answers
77 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 ...
Matheus Markies's user avatar
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 ...
VIVEK Yadav's user avatar
1 vote
2 answers
671 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 ...
user369070's user avatar
1 vote
1 answer
71 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: ...
xyz's user avatar
  • 33
1 vote
1 answer
2k 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 ...
Vectorizer's user avatar
1 vote
0 answers
123 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. ...
herrmutig's user avatar
1 vote
1 answer
102 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 ...
user avatar
1 vote
2 answers
842 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 ...
mdkdy's user avatar
  • 2,169
3 votes
2 answers
7k 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 ...
François Guthmann's user avatar
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 ...
04348's user avatar
  • 23
2 votes
0 answers
614 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 ...
Ethan Ma's user avatar
1 vote
1 answer
153 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 ...
wduk's user avatar
  • 177
11 votes
1 answer
8k 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 ...
geometrian's user avatar
  • 1,980
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 ...
AverageGatsby's user avatar
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 ...
AverageGatsby's user avatar
0 votes
1 answer
283 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 ...
Karlovsky120's user avatar
2 votes
1 answer
558 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 ...
Jhonny007's user avatar
  • 179
3 votes
1 answer
476 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 ...
wduk's user avatar
  • 177
5 votes
2 answers
5k 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,...
spraff's user avatar
  • 289
1 vote
1 answer
996 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 ...
Trap's user avatar
  • 123
4 votes
2 answers
973 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 ...
Vectorizer's user avatar
1 vote
1 answer
902 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 ...
Karlovsky120's user avatar