Don't rely on (potentially) unsupported vertex attribute types.

TRAC #11391 Checks for optional vertex declaration formats and falls back to FLOAT1-4 if more direct formats are not supporte Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Andrew Lewycky git-svn-id: https://angleproject.googlecode.com/svn/trunk@330 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent a3bbfd43
...@@ -51,6 +51,30 @@ class Dx9BackEnd : public BufferBackEnd ...@@ -51,6 +51,30 @@ class Dx9BackEnd : public BufferBackEnd
StreamFrequency mStreamFrequency[MAX_VERTEX_ATTRIBS+1]; StreamFrequency mStreamFrequency[MAX_VERTEX_ATTRIBS+1];
struct TranslationInfo
{
FormatConverter formatConverter;
D3DDECLTYPE d3dDeclType;
};
enum { NUM_GL_VERTEX_ATTRIB_TYPES = 6 };
TranslationInfo mAttributeTypes[NUM_GL_VERTEX_ATTRIB_TYPES][2][4]; // [GL types as enumerated by typeIndex()][normalized][size-1]
struct TranslationDescription
{
DWORD capsFlag;
TranslationInfo preferredConversion;
TranslationInfo fallbackConversion;
};
// This table is used to generate mAttributeTypes.
static const TranslationDescription mPossibleTranslations[NUM_GL_VERTEX_ATTRIB_TYPES][2][4]; // [GL types as enumerated by typeIndex()][normalized][size-1]
void checkVertexCaps(DWORD declTypes);
unsigned int typeIndex(GLenum type) const;
class Dx9VertexBuffer : public TranslatedVertexBuffer class Dx9VertexBuffer : public TranslatedVertexBuffer
{ {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment