decrease d3d vertex buffer size

This commit is contained in:
degasus
2013-03-12 17:48:20 +01:00
parent 83fc5f4747
commit 2c84c32ddc
3 changed files with 9 additions and 9 deletions

View File

@ -2,6 +2,7 @@
#ifndef _VERTEXMANAGERBASE_H #ifndef _VERTEXMANAGERBASE_H
#define _VERTEXMANAGERBASE_H #define _VERTEXMANAGERBASE_H
#include "Common.h"
#include <vector> #include <vector>
class NativeVertexFormat; class NativeVertexFormat;
@ -10,17 +11,16 @@ class PointerWrap;
class VertexManager class VertexManager
{ {
private: private:
// What are the actual values? static const u32 SMALLEST_POSSIBLE_VERTEX = sizeof(float)*3; // 3 pos
static const u32 SMALLEST_POSSIBLE_VERTEX = 1; static const u32 LARGEST_POSSIBLE_VERTEX = sizeof(float)*45 + sizeof(u32)*2; // 3 pos, 3*3 normal, 2*u32 color, 8*4 tex, 1 posMat
static const u32 LARGEST_POSSIBLE_VERTEX = 188;
static const u32 MAX_PRIMITIVES_PER_COMMAND = (u16)-1; static const u32 MAX_PRIMITIVES_PER_COMMAND = (u16)-1;
public: public:
static const u32 MAXVBUFFERSIZE = MAX_PRIMITIVES_PER_COMMAND * LARGEST_POSSIBLE_VERTEX; static const u32 MAXVBUFFERSIZE = ROUND_UP_POW2 (MAX_PRIMITIVES_PER_COMMAND * LARGEST_POSSIBLE_VERTEX);
// We may convert triangle-fans to triangle-lists, almost 3x as many indices. // We may convert triangle-fans to triangle-lists, almost 3x as many indices.
static const u32 MAXIBUFFERSIZE = MAX_PRIMITIVES_PER_COMMAND * 3; static const u32 MAXIBUFFERSIZE = ROUND_UP_POW2 (MAX_PRIMITIVES_PER_COMMAND * 3);
VertexManager(); VertexManager();
// needs to be virtual for DX11's dtor // needs to be virtual for DX11's dtor

View File

@ -39,8 +39,8 @@ namespace DX11
{ {
// TODO: Find sensible values for these two // TODO: Find sensible values for these two
const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16 * sizeof(u16); const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * sizeof(u16) * 8;
const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16; const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE;
const UINT MAXVBUFFER_COUNT = 2; const UINT MAXVBUFFER_COUNT = 2;
void VertexManager::CreateDeviceObjects() void VertexManager::CreateDeviceObjects()

View File

@ -42,8 +42,8 @@ extern NativeVertexFormat *g_nativeVertexFmt;
namespace DX9 namespace DX9
{ {
//This are the initially requeted size for the buffers expresed in elements //This are the initially requeted size for the buffers expresed in elements
const u32 IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16; const u32 IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * sizeof(u16) * 8;
const u32 VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16; const u32 VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE;
const u32 MAXVBUFFER_COUNT = 2; const u32 MAXVBUFFER_COUNT = 2;
inline void DumpBadShaders() inline void DumpBadShaders()