mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-26 15:50:00 -06:00
wip - rewrite 3 - scheduler edition
This commit is contained in:
@ -453,10 +453,10 @@ private:
|
||||
};
|
||||
|
||||
RendererPolygon PolygonList[2048];
|
||||
bool DoTimings(GPU3D& gpu3d, s32 cycles, bool odd);
|
||||
bool DoTimings(s32 cycles, bool odd);
|
||||
bool CheckTimings(s32 cycles, bool odd);
|
||||
u32 DoTimingsPixels(GPU3D& gpu3d, s32 pixels, bool odd);
|
||||
bool DoTimingsSlopes(GPU3D& gpu3d, RendererPolygon* rp, s32 y, bool odd);
|
||||
u32 DoTimingsPixels(s32 pixels, bool odd);
|
||||
bool DoTimingsSlopes(RendererPolygon* rp, s32 y, bool odd);
|
||||
void TextureLookup(const GPU& gpu, u32 texparam, u32 texpal, s16 s, s16 t, u16* color, u8* alpha) const;
|
||||
u32 RenderPixel(const GPU& gpu, const Polygon* polygon, u8 vr, u8 vg, u8 vb, s16 s, s16 t) const;
|
||||
void PlotTranslucentPixel(const GPU3D& gpu3d, u32 pixeladdr, u32 color, u32 z, u32 polyattr, u32 shadow);
|
||||
@ -465,21 +465,31 @@ private:
|
||||
void SetupPolygon(RendererPolygon* rp, Polygon* polygon) const;
|
||||
void Step(RendererPolygon* rp);
|
||||
void CheckSlope(RendererPolygon* rp, s32 y);
|
||||
bool RenderShadowMaskScanline(GPU3D& gpu3d, RendererPolygon* rp, s32 y, bool odd);
|
||||
bool RenderPolygonScanline(GPU& gpu, RendererPolygon* rp, s32 y, bool odd);
|
||||
bool RenderScanline(GPU& gpu, s32 y, int npolys, bool odd);
|
||||
bool RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon* rp, s32 y, bool odd);
|
||||
bool RenderPolygonScanline(const GPU& gpu, RendererPolygon* rp, s32 y, bool odd);
|
||||
bool RenderScanline(const GPU& gpu, s32 y, int npolys, bool odd);
|
||||
u32 CalculateFogDensity(const GPU3D& gpu3d, u32 pixeladdr) const;
|
||||
void ScanlineFinalPass(const GPU3D& gpu3d, s32 y, u8 rdbufferoffset, bool odd, s32 uhohzone);
|
||||
void ClearBuffers(const GPU& gpu);
|
||||
void RenderPolygons(GPU& gpu, bool threaded, Polygon** polygons, int npolys);
|
||||
template <bool threaded> void RenderPolygons(GPU& gpu, Polygon** polygons, int npolys);
|
||||
voi PushScanline(s32 y, s32 pixelstodraw);
|
||||
|
||||
void RenderThreadFunc(GPU& gpu);
|
||||
|
||||
// counters for scanline rasterization timings
|
||||
s32 RasterTiming = 0;
|
||||
//s32 RasterTimingCounterPrev = 0;
|
||||
s32 RasterTimingOdd = 0;
|
||||
s32 RasterTimingEven = 0;
|
||||
s32 ScanlineTimeout;
|
||||
s32 RasterTiming;
|
||||
s32 RasterTimingOdd;
|
||||
s32 RasterTimingEven;
|
||||
|
||||
enum
|
||||
{
|
||||
RenderStart = 0,
|
||||
ScanlineRead,
|
||||
RenderFinalP2,
|
||||
RenderFinal,
|
||||
RasterEvents_MAX,
|
||||
};
|
||||
|
||||
// buffer dimensions are 258x194 to add a offscreen 1px border
|
||||
// which simplifies edge marking tests
|
||||
@ -488,17 +498,18 @@ private:
|
||||
// offscreen in that border
|
||||
|
||||
static constexpr int ScanlineWidth = 256;
|
||||
static constexpr int NumScanlines = 192;
|
||||
static constexpr int NumScanlinesIntBuf = 192;
|
||||
static constexpr int NumScanlinesRD = 48;
|
||||
static constexpr int NumScanlinesFinal = 192;
|
||||
static constexpr int BufferSize = ScanlineWidth * NumScanlinesIntBuf;
|
||||
static constexpr int RDBufferSize = ScanlineWidth * NumScanlinesRD;
|
||||
static constexpr int BufferSize = ScanlineWidth * NumScanlines;
|
||||
static constexpr int FirstPixelOffset = 0;
|
||||
static constexpr int FinalBufferSize = ScanlineWidth * NumScanlinesFinal;
|
||||
|
||||
u32 ColorBuffer[BufferSize * 2];
|
||||
u32 DepthBuffer[BufferSize * 2];
|
||||
u32 AttrBuffer[BufferSize * 2];
|
||||
u32 RDBuffer[RDBufferSize];
|
||||
u32 FinalBuffer[BufferSize];
|
||||
u32 RDBuffer[RDBufferSize]; // is this buffer ever initialized by hw before writing to it? what is its initial value? can you transfer 3d framebuffer data between games?
|
||||
u32 FinalBuffer[FinalBufferSize];
|
||||
|
||||
// attribute buffer:
|
||||
// bit0-3: edge flags (left/right/top/bottom)
|
||||
|
Reference in New Issue
Block a user