0
\$\begingroup\$

My question is basically why VS2012 tells me that there is no mesh available for the Input Assembler stage because if I click on the DeviceContext next to the Draw call in the Grahics Event List the Input layout is set correctly, the vertex buffers, too, the index buffer is NULL as I do not call DrawIndexed and the primitive topology is set correctly. My background color is drawn using g_pImmediateContext->ClearRenderTargetView( g_pRenderTargetView, Colors::MidnightBlue );. Only the mesh does not appear. What did I miss? If you need any code just ask. I'm just not sure which part might be helpful as it seems everything is set correctly and I want to avoid flooding this question with irrelevant code snippets.

If anything maybe this file which can be opened using VS2012 may help, it is the Graphics Experiment.vsglog file.

EDIT: Here is my InputLayout struct:

struct VERTEXPOSITIONCOLOR
{
    DirectX::XMFLOAT3   position;
    DirectX::XMFLOAT4   color;

    static D3D11_INPUT_ELEMENT_DESC* GetVertexLayout()
    {
        static D3D11_INPUT_ELEMENT_DESC layout[] =
        {
            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT,
                0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
            { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT,
                0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        };
        return layout;
    }

    static UINT GetNumElements(){ return 2; }
};
\$\endgroup\$
  • \$\begingroup\$ Have you called IASetVertexBuffers on your vertex buffer prior to the draw call. \$\endgroup\$ – Syntac_ Jan 12 '14 at 0:19
  • \$\begingroup\$ Yes, I have. (Just checked again). And as I mentioned above the vertex buffers are set correctly in the debugging window. It would be NULL like the IndexBuffer if I had not called IASetVertexBuffers. \$\endgroup\$ – NOhs Jan 12 '14 at 0:24
  • \$\begingroup\$ In the graphics pipeline in VS can you see the mesh in the input assembler stage? \$\endgroup\$ – Syntac_ Jan 12 '14 at 1:28
  • \$\begingroup\$ No. Only the text "No mesh avaiable for stage" is displayed. \$\endgroup\$ – NOhs Jan 12 '14 at 1:37
  • \$\begingroup\$ Have you enabled the D3D debug layer? Any interesting warning messages showing up? \$\endgroup\$ – Nathan Reed Jan 12 '14 at 6:14
0
\$\begingroup\$

From looking at your vslog it would appear you have the first and second parameter in your draw call mixed up as it says Draw(0, 3).

The first parameter is the vertex count and the second parameter is the start offset. http://msdn.microsoft.com/en-us/library/windows/desktop/ff476407(v=vs.85).aspx

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.