NativeVertexFormat: swap unsigned / signed formats to match GX order
This commit is contained in:
parent
72cc6431e5
commit
02d1d8e6a0
|
@ -36,16 +36,16 @@ DXGI_FORMAT VarToD3D(VarType t, int size)
|
|||
{
|
||||
DXGI_FORMAT retval = DXGI_FORMAT_UNKNOWN;
|
||||
static const DXGI_FORMAT lookup1[5] = {
|
||||
DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R32_FLOAT
|
||||
DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R32_FLOAT
|
||||
};
|
||||
static const DXGI_FORMAT lookup2[5] = {
|
||||
DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R32G32_FLOAT
|
||||
DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R32G32_FLOAT
|
||||
};
|
||||
static const DXGI_FORMAT lookup3[5] = {
|
||||
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R32G32B32_FLOAT
|
||||
};
|
||||
static const DXGI_FORMAT lookup4[5] = {
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R32G32B32A32_FLOAT
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R32G32B32A32_FLOAT
|
||||
};
|
||||
|
||||
switch (size)
|
||||
|
|
|
@ -37,7 +37,7 @@ GLVertexFormat::~GLVertexFormat()
|
|||
inline GLuint VarToGL(VarType t)
|
||||
{
|
||||
static const GLuint lookup[5] = {
|
||||
GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT
|
||||
GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_FLOAT
|
||||
};
|
||||
return lookup[t];
|
||||
}
|
||||
|
|
|
@ -65,11 +65,11 @@ typedef void (LOADERDECL *TPipelineFunction)();
|
|||
|
||||
enum VarType
|
||||
{
|
||||
VAR_BYTE,
|
||||
VAR_UNSIGNED_BYTE,
|
||||
VAR_SHORT,
|
||||
VAR_UNSIGNED_SHORT,
|
||||
VAR_FLOAT,
|
||||
VAR_UNSIGNED_BYTE, // GX_U8 = 0
|
||||
VAR_BYTE, // GX_S8 = 1
|
||||
VAR_UNSIGNED_SHORT, // GX_U16 = 2
|
||||
VAR_SHORT, // GX_S16 = 3
|
||||
VAR_FLOAT, // GX_F32 = 4
|
||||
};
|
||||
|
||||
struct PortableVertexDeclaration
|
||||
|
|
Loading…
Reference in New Issue