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
2
votes
1 answer

DirectCompute writing to buffer speed

Im working on a particle sim and have ran into a bit of a bottleneck, using UAV to write to a RWStructured single float buffer is around 10 times too slow. From experimentation it seems there is no shortage in bandwidth but just the access time…
Jake Freelander
  • 1,471
  • 1
  • 19
  • 26
1
vote
3 answers

DirectCompute information

I've been trying to make use of the GPU as part of a project of mine. I've looked into both CUDA and OpenCL, but the lack of information showing you how to introduce these into a project is shocking. Even their dedicated forum groups are dead. So…
N0xus
  • 2,674
  • 12
  • 65
  • 126
1
vote
1 answer

Can I avoid exposing the kernel source code in Direct Compute?

Hiding kernel source or Offline compilation in Direct Compute For example: In CUDA, kernel source will be built into .exe and others can't view the kernel source. In opencl, for first execution, kernel source in .cl file is compiled using…
Zarsr
  • 39
  • 7
1
vote
1 answer

Compute shader best-practice/modern-style examples

I've been writing gpgpu compute shaders in the most awful style (i.e. just one monolithic procedure). I think the problem is I've read virtual no code that's not like this, so I was hoping someone can point me to some code to learn style from. I'm…
Tom Huntington
  • 2,260
  • 10
  • 20
1
vote
0 answers

GPGPU threading strategy

I want to improve the performance of a compute shader. Each thread group of the shader needs 8 blocks of data, each block has 24 elements. I’m primarily optimizing for GeForce 1080Ti in my development PC and Tesla V100 in the production servers, but…
Soonts
  • 20,079
  • 9
  • 57
  • 130
1
vote
1 answer

Warp threads not SIMD synchronous

I'm going through the parallel reduction example from Nvidia. If tid < 32 then the threads are all meant to be in the same warp and so the instructions are suppose to be SIMD synchronous, so we can assume that sdata[tid] += sdata[tid + 32];…
1
vote
1 answer

warning X4000: use of potentially uninitialized variable

HLSL compiler emit the error message "warning X4000: use of potentially uninitialized variable" with the following code: float4 GetPixelColorFromRawImage( in ByteAddressBuffer Source, in uint2 SourceSize, in uint2 …
fpiette
  • 11,983
  • 1
  • 24
  • 46
1
vote
1 answer

DirectX/DirectCompute ByteAddressBuffer initialization failed

I cannot initialize a ByteAddressBuffer from my C++ application: every API call succeed but in the shader, the data is always 0xFF. To create and initialize the ByteAddressBuffer, I use the function below. pInitData point to a buffer containing a…
fpiette
  • 11,983
  • 1
  • 24
  • 46
1
vote
1 answer

DirectX/DirectCompute CreateBuffer failure 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…
fpiette
  • 11,983
  • 1
  • 24
  • 46
1
vote
0 answers

Is order of workgroup execution in a compute shader deterministic and ordered?

I'm writing a Compute Shader in Unity. I understand that a set of threads within a workgroup can execute in any order / fully in parallel on the hardware. What I'm not sure about is whether a set of workgroups are executed in a particular order? If…
Joseph Humfrey
  • 2,974
  • 2
  • 23
  • 34
1
vote
1 answer

reading GPU resource data by CPU

i am learning directx11 these days. and i have been stuck in compute shader section. so i made four resource and three corresponding view. immutable input buffer = {1,1,1,1,1} / SRV immutable input buffer = {2,2,2,2,2} / SRV output buffer …
KIM CHANGJUN
  • 99
  • 11
1
vote
1 answer

HLSL Compiler omitting crucial statements

I have this compute shader that traverses a binary tree. It used to work fine with the separately installed DirectX SDK (June), with compiler #43. The compilers #46 and #47 (from Windows SDKs 8.0 and 8.1, respectively) however seem to omit two…
kiw
  • 748
  • 1
  • 9
  • 18
1
vote
1 answer

Converting a texture to a 1d array of float values using a compute shader

I have a fairly simple requirement for a compute shader (DirectCompute through Unity). I have a 128x128 texture and I'd like to turn the red channel of that texture into a 1d array of floats. I need to do this very often so just doing a cpu-side for…
EmmetOT
  • 552
  • 1
  • 7
  • 23
1
vote
1 answer

Compile error when trying to access StructuredBuffer

I want to access a StructuredBufferin a compute shader but I get the error: Shader error in 'Particle.compute': array, matrix, vector, or indexable object type expected in index expression at Particle.compute(28) (on d3d11) The code: #pragma…
morteza khosravi
  • 1,599
  • 1
  • 20
  • 36
1
vote
2 answers

Convert SlimDX.Direct3D11 Texture2D to .Net Bitmap

Converting an .Net Bitmap to a SlimDx Texture2D works very fast like this: http://www.rolandk.de/index.php?option=com_content&view=article&id=65:bitmap-from-texture-d3d11&catid=16:blog&Itemid=10 private Texture2D TextureFromBitmap(FastBitmapSingle…