The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [compute-shader]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
43 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
1answer
114 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
1answer
108 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 ...
2
votes
2answers
691 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,...
1
vote
1answer
381 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 ...
3
votes
2answers
139 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
1answer
155 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 ...
2
votes
1answer
435 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
0answers
195 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 ...
4
votes
0answers
156 views

Direct3D Global Atomic Issue

Recently I ran into an odd issue with some of my DirectX11 DirectCompute code when trying it on an AMD GPU for the first time where as on a NVIDIA one it had worked fine all through development. The ...
2
votes
1answer
2k views

CUDA/OpenCL vs OpenGL compute shader for Path tracer

So I want to implement a path tracer and I am confused between GPGPU computing or using OpenGL's compute shaders. I've already implemented a raytracer using GL's compute shaders. What are the main ...
2
votes
2answers
1k 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: ...
3
votes
1answer
231 views

Mipmap sampler in Metal compute kernel (not vertex or fragment shader)

I have a source texture (480x480) that was created with mipmapped set to true (error checking removed to simply this post), and a dest texture (100x100): ...
3
votes
2answers
1k views

How to use the data manipulated in OpenGL Compute Shader

I'm working with OpenGL and facing some difficulties because I'm not familiar with OpenGL. I tried to search related example in Google, but I could not find some useful code. There are five arrays. ...
1
vote
1answer
103 views

Process of compute shader in OpenGL

I'am curious about compute shader in OpenGL. Let's assume the number of points (vec4) is 900 and the work group size(= the number of work items) is 256 Then, We would have four work groups because ...
5
votes
1answer
1k views

Threads per compute shader group

The maximum allowed number of threads per compute shader group is 1024 for Shader Model 5.0. Is it advisable with regard to performance to stay close to this maximum number? In order to resolve SSAA ...
1
vote
1answer
1k views

Issue with image load stores and compute shaders

I am trying to read an input texture, modify it and then write to an output texture from a very simple compute shader. For some reason I am not able to write to the output image from the compute ...
5
votes
1answer
225 views

How to prevent moire artifacts in this light casting algorithm?

I am writing a 2D light casting algorithm with OpenGL compute shaders. The algorithm is simple: For each light source shoot out light rays from it, the ray begins at the light coordinates, it ends at ...
2
votes
1answer
673 views

Buffer of arrays in HLSL compute shader

I'm trying to follow along with a tutorial that uses an OpenGL compute shader, but I'm using D3D11. What they do is: ...
3
votes
2answers
1k views

Raytracing in OpenGL using Compute Shaders

I Recently posted this question on SO but didn't got any response so i thought to post it here since it's somewhat related to Raytracing. I am making a real time ray tracer in OpenGL using Compute ...
5
votes
1answer
789 views

UV Coordinate Interpolation in Compute Shader

I am trying to get the screen space position of each pixel in a texture on a mesh and write it into a texture. I was hoping to use a compute shader to do this: ...
4
votes
1answer
554 views

Register pressure in Compute Shader

I'm in the process of writing a Ray Tracer using DirectCompute / HLSL. First, eye rays are generated (one per pixel). Then, rays are traced, shaded and reflected in a loop. Also, shadow rays for each ...
6
votes
1answer
761 views

Can I reuse glBindBufferBase in compute shaders to keep data on GPU?

(Apologies: I am cross-posting from SO, where there is no answer. I figured it might be more appropriate to be on this site.) I'm trying to build a compute shader in OpenGL to perform a ...
3
votes
1answer
856 views

Compute shader not updating buffer, or vertex buffer unable to read the updates

I'm learning OpenGL compute shaders and following this guy's code, and I have stuff drawing, but not updating. The particles are spread out in their starting positions, but they stay there. ...
8
votes
1answer
3k views

Compute Shader vs CUDA/OpenCL

So I just recently learned about the Compute Shader and it looks from what I have picked up the same idea as parallel programming you would do with CUDA or OpenCL, but in the shader pipeline. If I ...
7
votes
1answer
448 views

Estimating the area of a triangle-circle intersection

I am trying to implement Ray Tracing with Cones (Amanatides 1984). Instead of rays, cones are shot into the scene and intersected with geometry. Since multiple triangles can occupy the cone's aperture,...
4
votes
1answer
625 views

Compute shaders: one-time-only versus persistent buffers

When using a Compute Shader, is it possible to keep a buffer in the GPU memory during the whole run-time duration of the application, so whenever the original Compute Shader or other Compute Shaders ...
4
votes
1answer
901 views

Threads lockstep and conditions in compute shader

I'm working with DirectCompute, but this question can be applied to general gpu programming I suppose. As far as I know the threads in a group works in a lockstep. ...
9
votes
1answer
356 views

Creating shared vertex normals on GPU

I've mostly succeeded at porting an implementation of Marching Cubes from CPU over to OpenGL compute shaders, but I haven't tackled normals yet and wondering the best way to go about it. My ...
4
votes
1answer
1k views

How to convert a thread ID into Screen Space Coord in an OpenGL Compute Shader?

I've written an implementation of the sphere tracing algorithm in OpenGL 4+. As an experiment/toy project, I'm re-implementing it using the OpenGL 4.3 compute shader, but I'm having trouble with the ...
7
votes
1answer
939 views

OpenGL Compute Shader generating triangle indices: How to get correct element count for glDrawElementsIndirect?

I have a sequence of compute shaders that generates an indexed mesh.The last one of those writes the generated indices like this: ...
12
votes
1answer
2k views

Synchronizing successive OpenGL Compute Shader invocations

I have a couple of compute shaders that need to be executed in a certain order and whose outputs depend on previous inputs. Ideally, I'll never need to copy a buffer client-side and do all of my work ...
13
votes
1answer
520 views

Why is work-efficiency desired in GPU programming?

I've been reading the following article on how to do a parallel scan in CUDA: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch39.html In the article, there is an emphasis on making the scan ...
8
votes
1answer
750 views

Writing to a compressed texture using a compute shader, with no extra copies

I'm trying to figure out what the best way is to generate an OpenGL texture using a compute shader. So far, I've read that pixel buffer objects are good for non-blocking CPU -> GPU transfers, and that ...
36
votes
3answers
14k 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 ...