Questions tagged [directcompute]

Microsoft DirectCompute is an application programming interface (API) that supports general-purpose computing on graphics processing units on Microsoft's Windows Vista, Windows 7 and Windows 8.

DirectCompute is part of the Microsoft DirectX collection of APIs, and was initially released with the DirectX 11 API but runs on graphics processing units that use either DirectX 10 or DirectX 11.

The DirectCompute architecture shares a range of computational interfaces with its competitors: OpenCL and CUDA.

79 questions
3
votes
1 answer

Understanding the "sampler array index must be a literal expression" error in ComputeShaders

Let's say I have a compute shader that retrieves data from a Texture2DArray using the Id of the group like this: Texture2DArray gTextureArray[2]; [numthreads(32, 1, 1)] void Kernel(uint3 GroupID : SV_GroupID, uint3 GroupThreadID :…
Gabriel C.
  • 97
  • 1
  • 10
3
votes
1 answer

GPU and determinism

I was thinking of off-loading some math operations to the GPU. As I'm already using D3D11 I'd use a compute shader to do the work. But the thing is I need the results to be the same for the same input, no matter what GPU the user might have. (only…
Bob Coder
  • 391
  • 3
  • 13
3
votes
0 answers

DirectX11 Radix Sort

I'm struggling to implement an efficient Radix Sort in DirectX11. I need to quickly sort no more than 256K items. It doesn't need to be in-place. Using CUDA / OpenCL is not an option. I have it almost working, but it has a few problems: The…
Hybrid
  • 396
  • 4
  • 20
2
votes
1 answer

Sample code for AES Encryption/Decryption using DirectCompute

would anyone happen to know of an implementation of AES Encryption/Decryption (any type) using DirectCompute (including the HLSL source code)? I've read a few of the papers discussing AES on the GPU and they tend to make reference to either CUDA or…
SJoshi
  • 1,866
  • 24
  • 47
2
votes
0 answers

GPU frustum culling : why using scan?

I'm trying to implement frustum culling in the gpu. After reading a bit and also stumbling on this very helpfull repo : https://github.com/ellioman/Indirect-Rendering-With-Compute-Shaders , I've noticed that the goto implementation seems to be Test…
Ragekit
  • 41
  • 2
2
votes
1 answer

DirectCompute: How to read from a RWTexture2D?

I have the following buffer: RWTexture2D Output : register(u0); This buffer is used by a compute shader for rendering a computed image. To write a pixel in that texture, I just use code similar to this: Output[XY] =…
fpiette
  • 11,983
  • 1
  • 24
  • 46
2
votes
1 answer

DirectCompute CreateBuffer fails with error 0x80070057 (E_INVALIDARG)

I'm trying to create a buffer in GPU memory to upload data from CPU. GPU access will be readonly. Data will be used as an input buffer for a compute shader. CreateBuffer() fails with error 0x80070057 (E_INVALIDARG). I read the docs and read it again…
fpiette
  • 11,983
  • 1
  • 24
  • 46
2
votes
0 answers

"D3D12 ERROR: ID3D12Device::CreateComputePipelineState: Root Signature doesn't match Compute Shader..." where is the mistake in my code?

The full error in the debug output is: "D3D12 ERROR: ID3D12Device::CreateComputePipelineState: Root Signature doesn't match Compute Shader: Shader SRV descriptor range (RegisterSpace=0, NumDescriptors=1, BaseShaderRegister=0) is not fully bound in…
MNagy
  • 423
  • 7
  • 20
2
votes
1 answer

Is it possible to write to a non 4-bytes aligned address with HLSL compute shader?

I am trying to convert an existing OpenCL kernel to an HLSL compute shader. The OpenCL kernel samples each pixel in an RGBA texture and writes each color channel to a tighly packed array. So basically, I need to write to a tightly packed uchar array…
Elad Maimoni
  • 3,703
  • 3
  • 20
  • 37
2
votes
1 answer

D3D12 Use backbuffer surface as unordered access view (UAV)

Im making a simple raytracer for a schoolproject were a compute shader is supposed to be used to shade a triangle or some other primitive. For this I'd like to write to a backbuffer-surface directly in the compute shader, to then present the…
2
votes
1 answer

Set counter of append/consume buffer on GPU?

I have an application that uses two compute shaders. Shader #1 produces data x and stores it in A, bound as an Append Buffer. Shader #2 runs on all of x from A, bound as a consume buffer. I would like to extend this by adding Shader #3, which runs…
sebf
  • 2,831
  • 5
  • 32
  • 50
2
votes
1 answer

Is it possible to run directcompute on multiple GPUs?

I'm interested in DirectCompute and I would like to know if it's possible, having two different Graphics adapters connected to the computer to use Direct Compute on both at the same time, like in CUDA. As far as a i know dispatching a computer…
sorts
  • 21
  • 2
2
votes
1 answer

Unity Compute Shader, Array Indexing through SV_DispatchThreadID

I have a problem with array indexing on GPU in Compute Shader and I'm stuck with it for weeks. I'm trying to use the x value of SV_DispatchThreadID as the index of my particle array (as it is shown in some example on the web). It is working... But…
2
votes
2 answers

compute shader with numthreads (1,1,1) runs extremly slow

I am just beginning to learn DirectX programming, using F# and SharpDX as .NET wrapper. As a test case I render the Mandelbrot set. The computation is done using 2 compute shaders. The first shader computes the depth for each pixel (function…
2
votes
1 answer

Do DirectX Compute Shaders support 2D arrays in shared memory?

I want to use groupshared memory in a DirectX Compute Shader to reduce global memory bandwidth and hopefully improve performance. My input data is a Texture2D and I can access it using 2D indexing like so: Input[threadID.xy] I would like to have a…
shoelzer
  • 10,648
  • 2
  • 28
  • 49