Terrain component causes exception by default in D3D11

Minor issues with the Ogre API that can be trivial to fix
Post Reply
User avatar
Cygon
Halfling
Posts: 70
Joined: Thu Nov 07, 2002 9:36 pm
Location: Germany
x 5
Contact:

Terrain component causes exception by default in D3D11

Post by Cygon »

When I add a terrain to my Ogre game, it immediately throws an exception because D3D11 generates the following warning:
ID3D11Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: 'POSITION'/0 and component(s) of the type 'float32'. However, the matching entry in the Input Layout declaration, element[0], specifies mismatched format: 'R16G16_SINT'. This is not an error, since behavior is well defined: The element format determines what data conversion algorithm gets applied before it shows up in a shader register. Independently, the shader input signature defines how the shader will interpret the data that has been placed in its input registers, with no change in the bits stored. It is valid for the application to reinterpret data as a different type once it is in the vertex shader, so this warning is issued just in case reinterpretation was not intended by the author.
I found some code I'd put somewhere on a scale between crazy and sloppy that assigns error levels to exceptions, uses a global "ExceptionsErrorLevel" variable -- which is cleared as a side effect of an instance-specific operator->() overload -- that again is compared against an option value named "Information Queue Exceptions Bottom Level" which is set to "No information queue exceptions" in release mode and to "Info (exception on any message)" in debug mode, where above warning causes the exception.

I was able to work around the issue by adding the following code snippet after I created the render system:

Code: Select all

this->ogreContext->Root->getRenderSystem()->getConfigOptions()[
  "Information Queue Exceptions Bottom Level"
].currentValue = "No information queue exceptions";
But there are two things this brought up:
1. The terrain component will not work in debug mode by default
2. The error checking and handling code in the Direct3D 11 render system is borderline insane :mrgreen:
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100
Contact:

Re: Terrain component causes exception by default in D3D11

Post by Wolfmanfx »

We should check this out after the GSOC code is merged back which should finish in a couple of weeks.
Post Reply