directcompute

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

半腔热情 提交于 2019-12-03 17:14:21
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) and (u4/t4): cbuffer cbWorld : register (b1) { float4x4 worldViewProj; int dummy; } struct VS_IN { float4 pos : POSITION; float4 col : COLOR; }; struct PS_IN { float4 pos : SV_POSITION; float4 col : COLOR; }; RWStructuredBuffer<float4> colorOutputTable : register (u0); // 2D color data StructuredBuffer<float4> output2 : register (t0); // same as u0

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

柔情痞子 提交于 2019-12-03 05:53:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . 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 points for project code using DirectX 11 :) ) 回答1: I think there

DirectX 11 - Compute shader: Writing to an output resource

守給你的承諾、 提交于 2019-12-03 01:32:52
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 reads has been performed in the Compute shader. (Out-of-bound writes results in no-ops) Creating the Compute shader components Input resources First I create an ID3D11Buffer* for input data. This is passed as a resource when creating the SRV used for input to the Compute shader stage. If the input data never changes then we could release the

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

半城伤御伤魂 提交于 2019-12-02 19:16:27
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 points for project code using DirectX 11 :) ) I think there are still no DX11 tutorials / books. If you want to study DirectX in-depth, you could grab some DX10 book and also examine DX11 SDK and MSDN . There is nothing really new in DirectX 11 (in application architecture / code building principles) , so you could examine new API features and (if you

D3D12 Use backbuffer surface as unordered access view (UAV)

雨燕双飞 提交于 2019-12-02 05:41:20
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 results imideatly. I know for certain that this is possible in DX11 though i can't seem to get it to work in DX12. I couldn't gather that much information about this, but i found this gamedev thread discussing the exact same problem I try to figure out and they seem to come to the conclusion which was my go to workaround: writing to an intermediate texture