2014-09-26 16:06:55 +00:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
#include "GPU/Common/GPUDebugInterface.h"
|
|
|
|
|
|
|
|
class VertexDecoder;
|
|
|
|
|
2015-01-29 13:12:24 +00:00
|
|
|
enum {
|
|
|
|
VERTEX_BUFFER_MAX = 65536,
|
2015-03-01 14:28:11 +00:00
|
|
|
DECODED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 64,
|
|
|
|
DECODED_INDEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 16,
|
2015-01-29 13:12:24 +00:00
|
|
|
SPLINE_BUFFER_SIZE = VERTEX_BUFFER_MAX * 20,
|
|
|
|
};
|
|
|
|
|
2014-09-26 16:06:55 +00:00
|
|
|
class DrawEngineCommon {
|
|
|
|
public:
|
|
|
|
virtual ~DrawEngineCommon();
|
|
|
|
|
|
|
|
bool TestBoundingBox(void* control_points, int vertexCount, u32 vertType);
|
|
|
|
|
|
|
|
// TODO: This can be shared once the decoder cache / etc. are.
|
|
|
|
virtual u32 NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inPtr, int lowerBound, int upperBound, u32 vertType) = 0;
|
|
|
|
|
|
|
|
bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices);
|
|
|
|
|
|
|
|
static u32 NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inPtr, VertexDecoder *dec, int lowerBound, int upperBound, u32 vertType);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Vertex collector buffers
|
|
|
|
u8 *decoded;
|
|
|
|
u16 *decIndex;
|
2015-01-29 13:12:24 +00:00
|
|
|
u8 *splineBuffer;
|
2015-03-01 14:28:11 +00:00
|
|
|
};
|