1
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – trichoplax Apr 12 '17 at 7:05
  • $\begingroup$ I think you can download SDK layer in "Settings -> Apps and Features -> Manage optional features". $\endgroup$ – SurvivalMachine Apr 13 '17 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.