GPU: Use max vertex count based on buffer size

This commit is contained in:
Connor McLaughlin
2019-09-15 01:18:58 +10:00
parent a58b687352
commit 1bb794dd39
3 changed files with 10 additions and 11 deletions

View File

@ -11,8 +11,6 @@ public:
virtual ~GPU_HW();
protected:
static constexpr u32 MAX_BATCH_VERTEX_COUNT = 1024;
struct HWVertex
{
s32 x;
@ -28,6 +26,9 @@ protected:
static constexpr u16 EncodeTexcoord(u8 x, u8 y) { return ZeroExtend16(x) | (ZeroExtend16(y) << 8); }
};
static constexpr u32 VERTEX_BUFFER_SIZE = 1 * 1024 * 1024;
static constexpr u32 MAX_BATCH_VERTEX_COUNT = VERTEX_BUFFER_SIZE / sizeof(HWVertex);
static constexpr std::tuple<float, float, float, float> RGBA8ToFloat(u32 rgba)
{
return std::make_tuple(static_cast<float>(rgba & UINT32_C(0xFF)) * (1.0f / 255.0f),