decrease d3d vertex buffer size
This commit is contained in:
parent
83fc5f4747
commit
2c84c32ddc
|
@ -2,6 +2,7 @@
|
|||
#ifndef _VERTEXMANAGERBASE_H
|
||||
#define _VERTEXMANAGERBASE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include <vector>
|
||||
|
||||
class NativeVertexFormat;
|
||||
|
@ -10,17 +11,16 @@ class PointerWrap;
|
|||
class VertexManager
|
||||
{
|
||||
private:
|
||||
// What are the actual values?
|
||||
static const u32 SMALLEST_POSSIBLE_VERTEX = 1;
|
||||
static const u32 LARGEST_POSSIBLE_VERTEX = 188;
|
||||
static const u32 SMALLEST_POSSIBLE_VERTEX = sizeof(float)*3; // 3 pos
|
||||
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 MAX_PRIMITIVES_PER_COMMAND = (u16)-1;
|
||||
|
||||
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.
|
||||
static const u32 MAXIBUFFERSIZE = MAX_PRIMITIVES_PER_COMMAND * 3;
|
||||
static const u32 MAXIBUFFERSIZE = ROUND_UP_POW2 (MAX_PRIMITIVES_PER_COMMAND * 3);
|
||||
|
||||
VertexManager();
|
||||
// needs to be virtual for DX11's dtor
|
||||
|
|
|
@ -39,8 +39,8 @@ namespace DX11
|
|||
{
|
||||
|
||||
// TODO: Find sensible values for these two
|
||||
const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16 * sizeof(u16);
|
||||
const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16;
|
||||
const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * sizeof(u16) * 8;
|
||||
const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE;
|
||||
const UINT MAXVBUFFER_COUNT = 2;
|
||||
|
||||
void VertexManager::CreateDeviceObjects()
|
||||
|
|
|
@ -42,8 +42,8 @@ extern NativeVertexFormat *g_nativeVertexFmt;
|
|||
namespace DX9
|
||||
{
|
||||
//This are the initially requeted size for the buffers expresed in elements
|
||||
const u32 IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16;
|
||||
const u32 VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16;
|
||||
const u32 IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * sizeof(u16) * 8;
|
||||
const u32 VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE;
|
||||
const u32 MAXVBUFFER_COUNT = 2;
|
||||
|
||||
inline void DumpBadShaders()
|
||||
|
|
Loading…
Reference in New Issue