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
20
votes
5 answers

OpenCL vs. DirectCompute?

I'm looking for comparisons between OpenCL and DirectCompute, but I haven't found anything. OpenCL's advantages of being cross-platform and having a wider range of supported GPUs don't matter to me. I'm fine with coding on Windows against DX11…
royco
  • 5,409
  • 13
  • 60
  • 84
17
votes
5 answers

Where can I find some in-depth DirectX 11 tutorials?

So far the only tutorials I've been able to find are on directx11tutorials.com, which are essentially inferred from the existing samples. Does anyone know where to find other tutorials, or better yet open source projects using DirectX 11? (Extra…
Stefan Valianu
  • 1,370
  • 2
  • 13
  • 24
13
votes
2 answers

Threads and Thread Groups on the GPU

I'm wondering about the "grids" of threads/thread groups I can dispatch on the GPU. I'm using Direct Compute so I'll give a concrete example using that API. For example, if I call Dispatch(2,2,2), I understand it dispatches 2x2x2 = 8 thread groups…
l3utterfly
  • 2,106
  • 4
  • 32
  • 58
8
votes
1 answer

DirectX 11 - Compute shader: Writing to an output resource

I've just started using the Compute shader stage in DirectX 11 and encountered some unwanted behaviour when writing to an output resource in the Compute shader. I seem to get only zeroes as output which, to my understanding, means that out-of-bound…
SvinSimpe
  • 850
  • 1
  • 12
  • 28
7
votes
1 answer

Will C++ AMP run on a machine without a compatible GPU?

I understand that C++ AMP is accelerated by GPUs that support DirectX 11. However, my question is, if the compiled C++ AMP program is run on a machine without a DirectX 11 compatible GPU, what happens? Does it get emulated by some software…
Jonathan DeCarlo
  • 2,798
  • 1
  • 20
  • 24
7
votes
1 answer

DirectCompute atomic counter

In a compute shader (with Unity) I have a raycast finding intersections with mesh triangles. At some point I would like to return how many intersections are found. I can clearly see how many intersections there are by marking the pixels, however if…
7
votes
1 answer

HLSL buffer stride and threading - what is happening here?

I'm really new to DirectCompute technologies, and have been attempting to learn from the documentation on the msdn website, which is.. dense, to say the least. I'd like to make a basic hlsl file that takes in a 4x4 matrix and a 4xN matrix and…
Zach H
  • 469
  • 5
  • 18
6
votes
2 answers

DirectCompute optimal numthreads setup

I've recently been playing with compute shaders and I'm trying to determine the most optimal way to setup my [numthreads(x,y,z)] and dispatch calls. My demo window is 800x600 and I am launching 1 thread per pixel. I am performing 2D texture…
Valentin
  • 1,731
  • 2
  • 19
  • 29
4
votes
1 answer

How to work with 8-bit char data in HLSL?

I'm converting some OpenCL code to DirectCompute and need to process 8-bit character strings in a compute shader but don't find an HLSL data type for "byte" or "char". OpenCL supports a "char" type, so I was expecting an equivalent. What is the best…
4
votes
3 answers

DirectCompute versus OpenCL for GPU programming?

I have some (financial) tasks which should map well to GPU computing, but I'm not really sure if I should go with OpenCL or DirectCompute. I did some GPU computing, but it was a long time ago (3 years). I did it through OpenGL since there was not…
Meh
  • 7,016
  • 10
  • 53
  • 76
4
votes
2 answers

How can I feed compute shader results into vertex shader w/o using a vertex buffer?

Before I go into details I want outline the problem: I use RWStructuredBuffers to store the output of my compute shaders (CS). Since vertex and pixel shaders can’t read from RWStructuredBuffers, I map a StructuredBuffer onto the same slot (u0/t0)…
3
votes
2 answers

Implementing a SpinLock in a HLSL DirectCompute shader

I try to implement a spin lock in a compute shader. But my implementation it doesn't seems to lock anything. Here is how I implement the spin lock: void LockAcquire() { uint Value = 1; [allow_uav_condition] while (Value) { …
fpiette
  • 11,983
  • 1
  • 24
  • 46
3
votes
0 answers

DirectCompute from C background

Interested to develop some image analysis algo. Real beginner in GPU computing, I was years ago a physics researcher used with C programming, working only on algo not on GUI side, using simple tools such as smart text editor and gcc. Not interested…
davide445
  • 63
  • 3
3
votes
1 answer

HLSL Get number of threadGroups and numthreads in code

my question concerns ComputeShader, HLSL code in particular. So, DeviceContext.Dispath(X, Y, Z) spawns X * Y * Z groups, each of which has x * y * z individual threads set in attribute [numthreads(x,y,z)]. The question is, how can I get total number…
Ilia
  • 331
  • 5
  • 12
3
votes
2 answers

DirectX 11 Compute Shader device synchronization?

Background: perform benchmarking/comparisson over GPGPU platforms. Problem: Device synchronization when dispatching a DirectX 11 Compute Shader. Looking for the equivalent of cudaDeviceSynchronize() of clFinish(...) to make a fair comparisson of…
thorbear
  • 41
  • 4
1
2 3 4 5 6