<p>So I am new to the DX12 world. I am currently trying to tweek the nbody_gravity DX12 sample, but appending or calling another Compute Shader which is to add 2 buffers to produce an output in a different buffer.</p>

<ol>
<li>I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found"</li>
<li>When i printed the debug error it says the following: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.</li>
</ol>

<p>I am invoking my shader after the default invocation to the nBodyGravity.hlsl is done:</p>

<pre><code>ComPtr&lt;ID3DBlob&gt; computeShader;
ComPtr&lt;ID3DBlob&gt; computeShader_m;

#if defined(_DEBUG)
        // Enable better shader debugging with the graphics debugging tools.
        UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
#else
        UINT compileFlags = 0;
#endif


        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"NBodyGravityCS.hlsl").c_str(), nullptr, nullptr, "CSMain", "cs_5_0", compileFlags, 0, &amp;computeShader, nullptr));

//extra call for my shader
ComPtr&lt;ID3DBlob&gt; error_ptr;
        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &amp;computeShader_m, &amp;error_ptr));

if (error_ptr)
{
    OutputDebugStringA((char *)error_ptr-&gt;GetBufferPointer());
}
</code></pre>

<p>Is there somthing amiss?</p>

CC BY-SA 3.0
2017-04-12T07:05:10.973Z
If the second error message is accurate, you'd need to download the mentioned SDK layers and see if there is still a problem. If the second error message is not accurate then we'll need to know that before investigating.
trichoplax is on Codidact now
CC BY-SA 3.0
2017-04-13T15:37:00.133Z
I think you can download SDK layer in "Settings -> Apps and Features -> Manage optional features".
SurvivalMachine
<directx>
Invoking shader in DX
Madhu
# Invoking shader in DX

(Asked by: username_0 on 2017-04-11)

So I am new to the DX12 world. I am currently trying to tweek the nbody\_gravity DX12 sample, but appending or calling another Compute Shader which is to add 2 buffers to produce an output in a different buffer.

1. I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found"
2. When i printed the debug error it says the following: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.

I am invoking my shader after the default invocation to the nBodyGravity.hlsl is done:

```
ComPtr<ID3DBlob> computeShader;
ComPtr<ID3DBlob> computeShader_m;

#if defined(_DEBUG)
        // Enable better shader debugging with the graphics debugging tools.
        UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
#else
        UINT compileFlags = 0;
#endif

        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"NBodyGravityCS.hlsl").c_str(), nullptr, nullptr, "CSMain", "cs_5_0", compileFlags, 0, &computeShader, nullptr));

//extra call for my shader
ComPtr<ID3DBlob> error_ptr;
        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &computeShader_m, &error_ptr));

if (error_ptr)
{
    OutputDebugStringA((char *)error_ptr->GetBufferPointer());
}

```

Is there somthing amiss?

**Tags:** directx

> **Comments:**
> **username_1**: If the second error message is accurate, you'd need to download the mentioned SDK layers and see if there is still a problem. If the second error message is not accurate then we'll need to know that before investigating.  
> **username_2**: I think you can download SDK layer in "Settings -> Apps and Features -> Manage optional features".  

---

## 0 answers

