Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualcollie

Posted 08 February 2013 - 12:51 PM

Thanks for the reply.

I set it directly after the vertexLayoutDesc declaration.

 

const D3D11_INPUT_ELEMENT_DESC vertexLayoutDesc[] =
{
// Vertex buffer slot 0.
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // vertexPosition
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // textureCoordinates
{ "TEXCOORD", 1, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // vertexNumber

// Vertex buffer slot 1.
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitColour

// Vertex buffer slot 2.
{ "TEXCOORD", 2, DXGI_FORMAT_R32_FLOAT, 2, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitWidth

// Vertex buffer slot 3.
{ "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 3, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitOffset
};

  hr = device->CreateInputLayout(
    vertexLayoutDesc,
    ARRAYSIZE(vertexLayoutDesc),
    vertexShaderBytecode,
    vertexShaderBytecodeLength,
    &_inputLayout);

  deviceContext->IASetInputLayout(_inputLayout);

#1collie

Posted 08 February 2013 - 12:50 PM

Thanks for the reply.

I set it directly after the vertexLayoutDesc declaration.

 

const D3D11_INPUT_ELEMENT_DESC vertexLayoutDesc[] =
{
// Vertex buffer slot 0.
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // vertexPosition
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // textureCoordinates
{ "TEXCOORD", 1, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_VERTEX_DATA, 0 }, // vertexNumber

// Vertex buffer slot 1.
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitColour

// Vertex buffer slot 2.
{ "TEXCOORD", 2, DXGI_FORMAT_R32_FLOAT, 2, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitWidth

// Vertex buffer slot 3.
{ "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 3, D3D11_APPEND_ALIGNED_ELEMENT,
D3D11_INPUT_PER_INSTANCE_DATA, 1 }, // bitOffset
};

  hr = device->CreateInputLayout(
    vertexLayoutDesc,
    ARRAYSIZE(vertexLayoutDesc),
    vertexShaderBytecode,
    vertexShaderBytecodeLength,
    &_inputLayout);

  deviceContext->IASetInputLayout(_inputLayout);


PARTNERS