recent change to D3D11RS looks broken

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
lunkhound
Gremlin
Posts: 169
Joined: Sun Apr 29, 2012 1:03 am
Location: Santa Monica, California
x 17

recent change to D3D11RS looks broken

Post by lunkhound »

This change is breaking my code with an exception in getD3DVertexDeclaration.
https://bitbucket.org/sinbad/ogre/commi ... nt-1510991

Code: Select all

D3D11_INPUT_ELEMENT_DESC * D3D11VertexDeclaration::getD3DVertexDeclaration(D3D11HLSLProgram* boundVertexProgram, VertexBufferBinding* binding)
    {
        // Create D3D elements
        size_t iNumElements = boundVertexProgram->getNumInputs();

        if (mD3delems.find(boundVertexProgram) == mD3delems.end())
        {
            D3D11_INPUT_ELEMENT_DESC*  D3delems = new D3D11_INPUT_ELEMENT_DESC[iNumElements];
            ZeroMemory(D3delems, sizeof(D3D11_INPUT_ELEMENT_DESC) * iNumElements);

            unsigned int idx;
            for (idx = 0; idx < iNumElements; ++idx)
            {
                D3D11_SIGNATURE_PARAMETER_DESC inputDesc = boundVertexProgram->getInputParamDesc(idx);
                VertexElementList::const_iterator i, iend;
                iend = mElementList.end();
                bool found = false;
                for (i = mElementList.begin(); i != iend; ++i)
                {
                    LPCSTR semanticName         = D3D11Mappings::get(i->getSemantic());
                    UINT semanticIndex          = i->getIndex();
                    if(
                        strcmp(semanticName, inputDesc.SemanticName) == 0
                        && semanticIndex == inputDesc.SemanticIndex
                      )
                    {
                        found = true;
                        break;
                    }
                }

                /* this code was deleted
                if ( !found )
                {
                    // find by pos
                    i = mElementList.begin();
                    for ( unsigned int count = 0; count < idx && i != iend; count++, ++i )
                    {
                    }
                    if ( i != iend )
                    {
                        found = true;
                    }
                }
                */

                if(!found)
                {
                    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set D3D11 vertex declaration" , 
                                                "D3D11VertexDeclaration::getILayoutByShader");
                }
...
Problem seems to be that D3D11Mappings::get(VES_POSITION) returns "POSITION" which doesn't match "SV_Position" as used in my HLSL 4.0 shaders. Anyone else seeing this?

Post Reply