Results 1 to 2 of 2

Thread: clCreateFromD3D11BufferNV ret CL_INVALID_D3D11_RESOURCE_NV for IndirectBuffer

  1. #1

    clCreateFromD3D11BufferNV ret CL_INVALID_D3D11_RESOURCE_NV for IndirectBuffer

    Hi All,

    I try to use OpenCL for updating indirect ID3D11buffer, but during calling clCreateFromD3D11BufferNV, i got error CL_INVALID_D3D11_RESOURCE_NV.

    simple code:
    Code :
    D3D11_BUFFER_DESC bufDesc;
    bufDesc.ByteWidth = sizeof(D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS); // 20 bytes
    bufDesc.Usage = D3D11_USAGE_DEFAULT;
    bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
    bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_SHADER_RESOURCE;
    bufDesc.MiscFlags = D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS; // Indirect Buffer
    bufDesc.StructureByteStride = 0;
    ID3D11Buffer* pVertexBufPtr = NULL;[url][/url]
    HRESULT hr = hrStatus = pD3D11Device->CreateBuffer(&bufDesc, NULL, &pVertexBufPtr); // pVertexBufPtr - OK
    cl_int ret = 0;
    // CL_INVALID_D3D11_RESOURCE_NV
    cl_mem clBuffer = clCreateFromD3D11BufferNV(context, CL_MEM_WRITE_ONLY, pVertexBufPtr, &ret);

    It working fine on any AMD/Intel GPU with OpenCL 1.2 and Direct3D11 with D3D_FEATURE_LEVEL_11_X.

    i attached simpe project with executable file.
    https://www.dropbox.com/s/6g9gr1b0o1...eD3D11.7z?dl=0

    It happens for example on nVidia GTX 760, nVidia 610

    Also, i submitted this issue on nVidia forum: clCreateFromD3D11BufferNV returns CL_INVALID_D3D11_RESOURCE_NV for buffer with D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS

    What do i do wrong ?

  2. #2
    Hi! I have additional Information from Direct3D11 Debug Runtime:

    D3D11 ERROR: ID3D11Device::CreateBuffer: Buffers for DrawIndirect can not be created with D3D11_RESOURCE_MISC_SHARED or D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. [ STATE_CREATION ERROR #68: CREATEBUFFER_INVALIDMISCFLAGS]
    Exception thrown at 0x73C7DDC2 in SimpleDX11.exe: Microsoft C++ exception: _com_error at memory location 0x001EEA8C.
    D3D11 ERROR: ID3D11Device::CreateBuffer: CreateBuffer returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #69: CREATEBUFFER_INVALIDARG_RETURN]

    The new link for simple project

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean