Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
decrease d3d vertex buffer size
  • Loading branch information
degasus committed Mar 12, 2013
1 parent 83fc5f4 commit 2c84c32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Source/Core/VideoCommon/Src/VertexManagerBase.h
Expand Up @@ -2,6 +2,7 @@
#ifndef _VERTEXMANAGERBASE_H
#define _VERTEXMANAGERBASE_H

#include "Common.h"
#include <vector>

class NativeVertexFormat;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/Plugins/Plugin_VideoDX11/Src/VertexManager.cpp
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit 2c84c32

Please sign in to comment.