From 02d1d8e6a04f0536b6dff014e1223605f8b661ac Mon Sep 17 00:00:00 2001 From: degasus Date: Fri, 24 Jan 2014 14:18:55 +0100 Subject: [PATCH] NativeVertexFormat: swap unsigned / signed formats to match GX order --- Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 6 +++--- Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp | 2 +- Source/Core/VideoCommon/NativeVertexFormat.h | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp index 4c6332dedd..bd6ef40dc6 100644 --- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp @@ -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) diff --git a/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp index c0112c4e9e..b23836ac90 100644 --- a/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp @@ -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]; } diff --git a/Source/Core/VideoCommon/NativeVertexFormat.h b/Source/Core/VideoCommon/NativeVertexFormat.h index b4e83ed8a6..dcae4d81bd 100644 --- a/Source/Core/VideoCommon/NativeVertexFormat.h +++ b/Source/Core/VideoCommon/NativeVertexFormat.h @@ -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