Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
1 answer
98 views

I am new to using WebGPU. I'm using the rust wgpu crate with compute shaders to run a cryptographic task at high speed. My shader is quite simple: Take a common input state, append a unique per-thread ...
conduition's user avatar
0 votes
1 answer
56 views

Is it at all possible to dynamically define the dimensions of a @compute @workgroup_size(x,y,z) at runtime in wgpu? My program basically needs to downscale an image in a compute shader to compare ...
Gira's user avatar
  • 3
1 vote
1 answer
154 views

I've read the Khronos wiki Memory_Model page and the glMemoryBarrier docs, and I'm still confused. I have two buffers for vertex data (A and B) that I glMapBufferRange, memcpy into them, then ...
mr grumpy's user avatar
  • 1,591
2 votes
1 answer
84 views

For example, store the output of the compute shader on a 640x640 region within a 1920x1080 image at offset 128x128 from top-left corner. It could be done by allocating a 640x640 image, writing on it ...
Alex V.'s user avatar
  • 68
0 votes
2 answers
204 views

I've got a RWStructeredBuffer<float> tau I'm writing to in a ray generation shader rayGen. The DispatchRays dimension are (tauWidth, tauHeight, 1) and tau has exactly tauWidth * tauHeight ...
0xbadf00d's user avatar
  • 18.4k
1 vote
1 answer
157 views

Following these slides https://www.nvidia.com/content/GTC-2010/pdfs/2260_GTC2010.pdf when doing a parallel reduction you should avoid GroupMemoryBarrierWithGroupSync when reducing the last 2*...
Tom Huntington's user avatar
0 votes
0 answers
23 views

I have a compute shader in Vulkan, where I launch N threads with eight sub-threads each. Each subgroup of 8 threads share an eight element 'location' array. Each of the sub-threads calculate a number ...
user23073100's user avatar
2 votes
0 answers
78 views

I'm working with a Shader Storage Buffer Object (SSBO) in a compute shader, but I'm encountering an issue where only the first element of my array of structs is being written to. The remaining ...
user avatar
0 votes
0 answers
24 views

I'm looking for a way to write to the depth buffer directly from a compute shader, I have figured out how to do this, just not how to do it properly, for now, I am binding the depth buffer to binding ...
Batres's user avatar
  • 33
0 votes
1 answer
223 views

Please help to understand what is wrong in this simple DirectX12 pipeline. I'm pretty new to DirectX12 and was not able to find any simple working C++ example of compute shader in the internet. Below ...
Yuriy Solovyov's user avatar
0 votes
0 answers
163 views

I'm working on a procedural planet generator. My implementation is running a compute shader that calculates vertice positions based on noise algorithms and writing the vertex data directly into the ...
Deltt's user avatar
  • 1
0 votes
0 answers
43 views

I have an array of regular hexagons, those hexagons all together cover a surface (equivalent of the surface of my viewport), they are ordered from the center of the surface to the edges, each hexagon ...
user2968425's user avatar
-1 votes
1 answer
132 views

I'm writing a compute shader in unity and am writing various HLSL scripts which will be referenced in the compute shader using #include. I have a struct called Move, in a script called MoveC.hlsl. I ...
Frank's user avatar
  • 21
0 votes
0 answers
32 views

I have a compute shader that culls object triangles against frustums. For culling, I use a huge vertex and index buffer and a pair of (offset, count) to identify the range of vertices for a single ...
Raildex's user avatar
  • 5,468
0 votes
0 answers
62 views

I'm building a sparse voxel octree game engine and I'm having problems writing in a compute shader. I simplified my algorithm because I only need to write to the texture. Here is what I tried: ...
Gabriel Ribeiro's user avatar
0 votes
1 answer
67 views

I have a simple particle square that I want to move with the mouse movement, mapped to -1 to 1, in such a way that its bottom left point sticks to the cursor. This is fairly easy in vertex shade where ...
Mr.Coder's user avatar
  • 437
1 vote
1 answer
176 views

I'm trying to write a compute shader in GLSL with OpenGL, GLFW, GLEW, and GLM. The problem is that the compute shader either isn't running or isn't modifying any buffers. I have the latest NVIDIA 4060 ...
kronosta's user avatar
1 vote
0 answers
455 views

I’m working on a project in Unity where I’m using a compute shader to render grass. The rendering path is Forward+, and I’m trying to make the additional lights affect the grass. I want to achieve ...
user16287208's user avatar
1 vote
1 answer
140 views

I'm trying to unpack SNorm16 values in HLSL compute shader. Since SNorm16x4 = 8 bytes total, and Load/Store functions can only read/write 4 bytes I'm trying to get two 4 bytes values as packed to 1 ...
user3169894's user avatar
0 votes
1 answer
115 views

Using Unity 2022.3.40f1 and URP. I'm trying to implement occlusion culling with the depth buffer in a compute shader. I don't know what's wrong here but my code only works fine with the scene camera ...
Buttermilch's user avatar
0 votes
1 answer
107 views

I am trying to apply a raymarching shader to my Unity VR project. It is supposed to apply a shader to particles that represent a fluid using Smooth Particle Hydrodynamics. However, I am running into ...
pa87901's user avatar
  • 11
0 votes
0 answers
110 views

Smoothing normal on GPU might be a common question because you really can generate flat normal by triangle primitives , but you don't have adjacent faces so it is not possible to smooth normal . I ...
De Loris's user avatar
1 vote
0 answers
86 views

I am writing an FFT in GLSL and compiling to MSL using glslang and SpirvCross to support macOS. The code works fine on Windows with GLSL, but on Metal I see output that makes no sense. However, I have ...
James51332's user avatar
1 vote
0 answers
52 views

In unity I'm constructing a mesh on the GPU. Currently, I have to write the vertices / indices back to the CPU before setting them again in the mesh. This is very inefficient and takes about 90% of ...
Jimmy Diddler's user avatar
1 vote
0 answers
59 views

So I am writing a marching cubes compute shader. It’s going reasonably well and does work. I am in the processing of modifying it to remove all duplicate vertices. I want to do this in the shader. I ...
VVJ21's user avatar
  • 11
2 votes
0 answers
108 views

I wrote a compute shader in ue4 that each thread needs to get the value of a structured buffer corresponding to its own id.As shown in the figure below, for example, my texture is 8x8, the thread ...
Jarvan Du's user avatar
0 votes
0 answers
93 views

I have a wgsl compute shader, that essentially checks pairs of datapoints and counts the number pairs that meet a certain requirement (passes(i,j) is true) for each point. (ie. if there are 5 passing ...
Bagel03's user avatar
  • 725
3 votes
0 answers
208 views

I am experimenting whith webgpu. I found out that transferring data between cpu and gpu can be quite slow. My goal is to simulate particle physics on the gpu using webgpu's compute shaders, then use ...
Victor's user avatar
  • 708
0 votes
1 answer
355 views

I am doing a fluid simulation, and implementing such simulation with the CPU is very slow, especially when the simulation grid size gets bigger or is a 3d grid. So I used shaders to get the ...
Mohamad T Shehab's user avatar
0 votes
0 answers
88 views

EDIT: In the comment below, pmdj pointed out 2 bugs in my code. For clarity, I will not copy all the code and output buffer contents. Instead I modified both and left the originals as comments. ...
Reinhard Männer's user avatar
1 vote
1 answer
349 views

I am having unexpected results while comparing a WebGPU compute shader with it's cpu equivalent. This is a CPU version of a function that does Verlet Integration for simulating particles. ...
Victor's user avatar
  • 708
0 votes
0 answers
65 views

I would like to use all 8-bits as flags on a lowp float stored in an image. However, for some reason the data is never retained when I read it back. I use uintBitsToFloat and floatBitsToUint like so. (...
Griffort's user avatar
  • 1,315
0 votes
1 answer
169 views

I have coded a WGSL compute shader that outputs the result given an input as argument. Now I need to run this shader many times using different inputs. All of the compute shader steps should be the ...
James's user avatar
  • 153
2 votes
1 answer
429 views

Overview I have been working on a compute shader for awhile now. Initially it would take in 1 camera feed of 320x256 pixels. This all works great. Now I want to be able to handle multiple cameras, ...
Lilly's user avatar
  • 83
1 vote
0 answers
116 views

I have a system of 1000 particles that go through a sort of n-body simulation on the GPU, where each particle can interact with each other particle. I would like to achieve something that looks like ...
pgcomai's user avatar
  • 11
2 votes
1 answer
1k views

What's the difference between: void glDispatchCompute(1​, 1​, 1); layout(local_size_x = 100​, local_size_y = 100​, local_size_z = 1​) in; and: void glDispatchCompute(100​, 100, 1); layout(...
Shahashahaha's user avatar
0 votes
2 answers
1k views

So Im trying to make a compute shader for my unity game, and I keep getting this strange error: Shader error in 'PathTracing': undeclared identifier 'intersectionPos' at kernel CSMain at PathTracing....
Cracker 83's user avatar
1 vote
0 answers
137 views

I'm struggling with a Compute Shader whose purpose is to take a byte array of rgba values and write them to a render texture. I'm passing in ints (as I don't believe I can use byte itself) to the ...
arvinkx's user avatar
  • 193
0 votes
2 answers
279 views

I have a RWTexture2D<float4> which was filled by a ray generation shader. I need to scale every pixel by a common constant value, which is only known after the ray generation shader has finished....
0xbadf00d's user avatar
  • 18.4k
1 vote
0 answers
57 views

I'm writing an iOS app (currently running on iPad) and I'm using some metal compute shaders for some heavy math processing. Things have been working great but I have run into some issues lately in ...
Jimbo17's user avatar
  • 13
1 vote
1 answer
275 views

i am making a compute shader to use with bevy 0.12 so im using wgsl. i want to index into an array like this: fn is_boxed_in(x: u32, y: u32, z: u32, voxels: array<ShaderVoxel, 4096>) -> bool {...
NewUser69420's user avatar
0 votes
1 answer
73 views

I am trying to run a simple test compute shader. But when i map the buffer the shader modifies i get back all 0's. Instead of the expected outcome of numbers[index] = numbers[index] + 2u it also does ...
NewUser69420's user avatar
2 votes
1 answer
596 views

We have an OpenGL solver. Given a list of many items, each has a coordinate and a float value. We run a compute shader of the size of those items that does the computation and adds the value to the ...
RRR's user avatar
  • 529
0 votes
1 answer
337 views

I am trying to just test out the compute shaders so I'm trying to add 2 arrays together but I get this error during run time: thread 'Compute Task Pool (6)' panicked at C:\Users\bramb\.cargo\...
NewUser69420's user avatar
1 vote
0 answers
600 views

I am reading a small github project, within which there is a compute shader code to organize an index buffer of indirect draw call as follows, layout(local_size_x=1024, local_size_y=1, local_size_z=1) ...
0x314159's user avatar
0 votes
2 answers
1k views

I've been searching for different resources and it seems to not be possible to read from a storage texture and then write back to it. That's why I've tried to use 2 separate textures: one as ...
Ustym Ukhman's user avatar
0 votes
1 answer
152 views

My goal is to generate a luminance waveform similar to this using a compute shader. My setup is: Cpp window application EGL/egl.h GLES3/gl31.h (specifically requesting an ES 3.1 context) libGLESv2....
MindStudio's user avatar
0 votes
1 answer
178 views

Here's how the object is defined in C#, for Unity to be able to work with it : (please note: I left all fields -- even the ones not used in this question -- in case the issue was in an seemingly-...
jeancallisti's user avatar
  • 1,804
0 votes
1 answer
95 views

This wouldn't be too hard if this wasn't mixing several worlds : the world of algorithmics, the world of C# and the world of compute shaders (in Unity). EDIT: This is somewhat related. My scenario is ...
jeancallisti's user avatar
  • 1,804
2 votes
1 answer
810 views

I am working in C#, with Unity. I have created a compute shader to which I want to pass my array of C# data structures. That's when I realized I might have gone overboard with fancy data structures, ...
jeancallisti's user avatar
  • 1,804

1
2 3 4 5
12