CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/GPU/Software/RasterizerRectangle.h
Views: 1401
1
#pragma once
2
3
#include "TransformUnit.h" // for VertexData
4
5
// Contains fast-paths for rectangles. Mainly for use in DarkStalkers which requires software
6
// rendering to work correctly, but will benefit other games as well.
7
// It also handles a bypass for DarkStalkers to avoid first stretching the image to 480x272.
8
// This greatly improves image quality and speeds things up a lot. Not happy about the grossness
9
// of the hack but it's just a huge waste of CPU and image quality not to do it.
10
11
// The long term goal is to get rid of the specializations by jitting, but it still makes
12
// sense to specifically detect rectangles that do 1:1 texture mapping (like a sprite), because
13
// the JIT will then be able to eliminate UV interpolation.
14
15
class BinManager;
16
struct BinCoords;
17
18
namespace Rasterizer {
19
// Returns true if the normal path should be skipped.
20
bool RectangleFastPath(const VertexData &v0, const VertexData &v1, BinManager &binner);
21
void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &range, const RasterizerState &state);
22
23
bool DetectRectangleFromStrip(const RasterizerState &state, const ClipVertexData data[4], int *tlIndex, int *brIndex);
24
bool DetectRectangleFromFan(const RasterizerState &state, const ClipVertexData *data, int *tlIndex, int *brIndex);
25
bool DetectRectangleFromPair(const RasterizerState &state, const ClipVertexData data[6], int *tlIndex, int *brIndex);
26
bool DetectRectangleThroughModeSlices(const RasterizerState &state, const ClipVertexData data[4]);
27
}
28
29