2019-10-28 09:33:30 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "TransformUnit.h" // for VertexData
|
|
|
|
|
|
|
|
// Contains fast-paths for rectangles. Mainly for use in DarkStalkers which requires software
|
|
|
|
// rendering to work correctly, but will benefit other games as well.
|
|
|
|
// It also handles a bypass for DarkStalkers to avoid first stretching the image to 480x272.
|
|
|
|
// This greatly improves image quality and speeds things up a lot. Not happy about the grossness
|
|
|
|
// of the hack but it's just a huge waste of CPU and image quality not to do it.
|
|
|
|
|
|
|
|
// The long term goal is to get rid of the specializations by jitting, but it still makes
|
|
|
|
// sense to specifically detect rectangles that do 1:1 texture mapping (like a sprite), because
|
|
|
|
// the JIT will then be able to eliminate UV interpolation.
|
|
|
|
|
2022-01-13 09:26:59 -08:00
|
|
|
class BinManager;
|
2022-01-13 19:07:41 -08:00
|
|
|
struct BinCoords;
|
2022-01-13 09:26:59 -08:00
|
|
|
|
2019-10-28 09:33:30 +01:00
|
|
|
namespace Rasterizer {
|
|
|
|
// Returns true if the normal path should be skipped.
|
2022-01-13 09:26:59 -08:00
|
|
|
bool RectangleFastPath(const VertexData &v0, const VertexData &v1, BinManager &binner);
|
2022-01-13 19:07:41 -08:00
|
|
|
void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &range, const RasterizerState &state);
|
2019-10-28 09:33:30 +01:00
|
|
|
|
|
|
|
bool DetectRectangleFromThroughModeStrip(const VertexData data[4]);
|
2021-11-14 10:24:54 -08:00
|
|
|
bool DetectRectangleFromThroughModeFan(const VertexData *data, int c, int *tlIndex, int *brIndex);
|
2021-11-14 12:17:41 -08:00
|
|
|
bool DetectRectangleSlices(const VertexData data[4]);
|
2019-10-28 09:33:30 +01:00
|
|
|
}
|