mirror of
https://github.com/TASEmulators/desmume
synced 2025-10-06 00:32:43 +02:00
Compare commits
3 Commits
22a833b52e
...
266301a13a
Author | SHA1 | Date | |
---|---|---|---|
|
266301a13a | ||
|
e6500f2010 | ||
|
b23b8e7e6c |
@@ -2,7 +2,7 @@
|
||||
Copyright (C) 2006 yopyop
|
||||
Copyright (C) 2006-2007 Theo Berkau
|
||||
Copyright (C) 2007 shash
|
||||
Copyright (C) 2009-2023 DeSmuME team
|
||||
Copyright (C) 2009-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -102,7 +102,7 @@ enum DisplayCaptureSize
|
||||
DisplayCaptureSize_128x128 = 0,
|
||||
DisplayCaptureSize_256x64 = 1,
|
||||
DisplayCaptureSize_256x128 = 2,
|
||||
DisplayCaptureSize_256x192 = 3,
|
||||
DisplayCaptureSize_256x192 = 3
|
||||
};
|
||||
|
||||
typedef union
|
||||
@@ -1464,7 +1464,7 @@ protected:
|
||||
itemsForPriority_t _itemsForPriority[NB_PRIORITIES];
|
||||
|
||||
struct MosaicColor {
|
||||
CACHE_ALIGN u16 bg[4][GPU_FRAMEBUFFER_NATIVE_WIDTH + sizeof(u32)]; // Pad this buffer a little bit to avoid buffer overruns with vectorized gather instructions.
|
||||
CACHE_ALIGN u16 bg[4][GPU_FRAMEBUFFER_NATIVE_WIDTH + 64]; // Pad this buffer a little bit to avoid buffer overruns with vectorized gather instructions.
|
||||
struct Obj {
|
||||
u16 color;
|
||||
u8 alpha;
|
||||
@@ -1843,6 +1843,8 @@ public:
|
||||
class GPUEventHandler
|
||||
{
|
||||
public:
|
||||
virtual ~GPUEventHandler() {};
|
||||
|
||||
virtual void DidFrameBegin(const size_t line, const bool isFrameSkipRequested, const size_t pageCount, u8 &selectedBufferIndexInOut) = 0;
|
||||
virtual void DidFrameEnd(bool isFrameSkipped, const NDSDisplayInfo &latestDisplayInfo) = 0;
|
||||
virtual void DidRender3DBegin() = 0;
|
||||
@@ -1859,6 +1861,8 @@ public:
|
||||
class GPUEventHandlerDefault : public GPUEventHandler
|
||||
{
|
||||
public:
|
||||
virtual ~GPUEventHandlerDefault() {};
|
||||
|
||||
virtual void DidFrameBegin(const size_t line, const bool isFrameSkipRequested, const size_t pageCount, u8 &selectedBufferIndexInOut);
|
||||
virtual void DidFrameEnd(bool isFrameSkipped, const NDSDisplayInfo &latestDisplayInfo) {};
|
||||
virtual void DidRender3DBegin() {};
|
||||
|
@@ -2462,25 +2462,25 @@ void GPUEngineBase::_MosaicLine(GPUEngineCompositorInfo &compInfo)
|
||||
_mm256_blendv_epi8(_mm256_and_si256(dstColor16[1], _mm256_set1_epi16(0x7FFF)), _mm256_set1_epi16(0xFFFF), idxMask16[1])
|
||||
};
|
||||
|
||||
const v256u16 mosaicSetColorMask8 = _mm256_permute4x64_epi64( _mm256_cmpeq_epi16(_mm256_loadu_si256((v256u8 *)(compInfo.renderState.mosaicWidthBG->begin + x)), _mm256_setzero_si256()), 0xD8 );
|
||||
const v256u16 mosaicSetColorMask8 = _mm256_permute4x64_epi64( _mm256_cmpeq_epi16(_mm256_load_si256((v256u8 *)(compInfo.renderState.mosaicWidthBG->begin + x)), _mm256_setzero_si256()), 0xD8 );
|
||||
const v256u16 mosaicSetColorMask16[2] = {
|
||||
_mm256_unpacklo_epi8(mosaicSetColorMask8, mosaicSetColorMask8),
|
||||
_mm256_unpackhi_epi8(mosaicSetColorMask8, mosaicSetColorMask8)
|
||||
};
|
||||
|
||||
__m256i mosaicColorOut[2];
|
||||
mosaicColorOut[0] = _mm256_blendv_epi8(mosaicColor16[0], _mm256_loadu_si256((v256u16 *)(mosaicColorBG + x) + 0), mosaicSetColorMask16[0]);
|
||||
mosaicColorOut[1] = _mm256_blendv_epi8(mosaicColor16[1], _mm256_loadu_si256((v256u16 *)(mosaicColorBG + x) + 1), mosaicSetColorMask16[1]);
|
||||
mosaicColorOut[0] = _mm256_blendv_epi8(mosaicColor16[0], _mm256_load_si256((v256u16 *)(mosaicColorBG + x) + 0), mosaicSetColorMask16[0]);
|
||||
mosaicColorOut[1] = _mm256_blendv_epi8(mosaicColor16[1], _mm256_load_si256((v256u16 *)(mosaicColorBG + x) + 1), mosaicSetColorMask16[1]);
|
||||
|
||||
_mm256_storeu_si256((v256u16 *)(mosaicColorBG + x) + 0, mosaicColorOut[0]);
|
||||
_mm256_storeu_si256((v256u16 *)(mosaicColorBG + x) + 1, mosaicColorOut[1]);
|
||||
_mm256_store_si256((v256u16 *)(mosaicColorBG + x) + 0, mosaicColorOut[0]);
|
||||
_mm256_store_si256((v256u16 *)(mosaicColorBG + x) + 1, mosaicColorOut[1]);
|
||||
}
|
||||
|
||||
const v256u32 outColor32idx[4] = {
|
||||
_mm256_loadu_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 0),
|
||||
_mm256_loadu_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 1),
|
||||
_mm256_loadu_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 2),
|
||||
_mm256_loadu_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 3)
|
||||
_mm256_load_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 0),
|
||||
_mm256_load_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 1),
|
||||
_mm256_load_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 2),
|
||||
_mm256_load_si256((v256u32 *)(compInfo.renderState.mosaicWidthBG->trunc32 + x) + 3)
|
||||
};
|
||||
|
||||
const v256u16 outColor32[4] = {
|
||||
|
@@ -2641,14 +2641,14 @@ void GPUEngineBase::_MosaicLine(GPUEngineCompositorInfo &compInfo)
|
||||
_mm_blendv_epi8(_mm_and_si128(dstColor16[1], _mm_set1_epi16(0x7FFF)), _mm_set1_epi16(0xFFFF), idxMask16[1])
|
||||
};
|
||||
|
||||
const v128u16 mosaicSetColorMask8 = _mm_cmpeq_epi16( _mm_loadu_si128((v128u8 *)(compInfo.renderState.mosaicWidthBG->begin + x)), _mm_setzero_si128() );
|
||||
const v128u16 mosaicSetColorMask8 = _mm_cmpeq_epi16( _mm_load_si128((v128u8 *)(compInfo.renderState.mosaicWidthBG->begin + x)), _mm_setzero_si128() );
|
||||
const v128u16 mosaicSetColorMask16[2] = {
|
||||
_mm_unpacklo_epi8(mosaicSetColorMask8, mosaicSetColorMask8),
|
||||
_mm_unpackhi_epi8(mosaicSetColorMask8, mosaicSetColorMask8)
|
||||
};
|
||||
|
||||
_mm_storeu_si128( (v128u16 *)(mosaicColorBG + x) + 0, _mm_blendv_epi8(mosaicColor16[0], _mm_loadu_si128((v128u16 *)(mosaicColorBG + x) + 0), mosaicSetColorMask16[0]) );
|
||||
_mm_storeu_si128( (v128u16 *)(mosaicColorBG + x) + 1, _mm_blendv_epi8(mosaicColor16[1], _mm_loadu_si128((v128u16 *)(mosaicColorBG + x) + 1), mosaicSetColorMask16[1]) );
|
||||
_mm_store_si128( (v128u16 *)(mosaicColorBG + x) + 0, _mm_blendv_epi8(mosaicColor16[0], _mm_load_si128((v128u16 *)(mosaicColorBG + x) + 0), mosaicSetColorMask16[0]) );
|
||||
_mm_store_si128( (v128u16 *)(mosaicColorBG + x) + 1, _mm_blendv_epi8(mosaicColor16[1], _mm_load_si128((v128u16 *)(mosaicColorBG + x) + 1), mosaicSetColorMask16[1]) );
|
||||
}
|
||||
|
||||
const v128u16 outColor16[2] = {
|
||||
|
@@ -149,9 +149,9 @@
|
||||
// }
|
||||
//}
|
||||
|
||||
static void hq2x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, unsigned count)
|
||||
static void hq2x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, size_t count)
|
||||
{
|
||||
for (unsigned i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -407,9 +407,9 @@ static void hq2x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *s
|
||||
// }
|
||||
//}
|
||||
|
||||
static void hq2xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, unsigned count)
|
||||
static void hq2xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, size_t count)
|
||||
{
|
||||
for (unsigned i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -460,7 +460,7 @@ static void hq2xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *
|
||||
|
||||
brightArray[j] = bright;
|
||||
}
|
||||
int diffBright = ((maxBright - minBright) * 7) >> 4;
|
||||
u32 diffBright = ((u32)(maxBright - minBright) * 7) >> 4;
|
||||
if(diffBright > 7)
|
||||
{
|
||||
const int centerBright = brightArray[4];
|
||||
|
@@ -39,9 +39,9 @@
|
||||
* This effect is a rewritten implementation of the hq3x effect made by Maxim Stepin
|
||||
*/
|
||||
|
||||
void hq3x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, int count)
|
||||
void hq3x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, size_t count)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -125,9 +125,9 @@ void hq3x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst
|
||||
}
|
||||
}
|
||||
|
||||
void hq3xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, int count)
|
||||
void hq3xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, size_t count)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -178,7 +178,7 @@ void hq3xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict ds
|
||||
|
||||
brightArray[j] = bright;
|
||||
}
|
||||
unsigned int diffBright = ((maxBright - minBright) * 7) >> 4;
|
||||
u32 diffBright = ((u32)(maxBright - minBright) * 7) >> 4;
|
||||
if(diffBright > 7)
|
||||
{
|
||||
const int centerBright = brightArray[4];
|
||||
|
@@ -41,9 +41,9 @@
|
||||
|
||||
void hq4x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, u32 *__restrict dst3,
|
||||
const u32 *src0, const u32 *src1, const u32 *src2,
|
||||
unsigned count, unsigned flag)
|
||||
size_t count, unsigned flag)
|
||||
{
|
||||
for (unsigned i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -130,9 +130,9 @@ void hq4x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst
|
||||
|
||||
void hq4xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, u32 *__restrict dst3,
|
||||
const u32 *src0, const u32 *src1, const u32 *src2,
|
||||
unsigned count, unsigned flag)
|
||||
size_t count, unsigned flag)
|
||||
{
|
||||
for (unsigned i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
@@ -183,7 +183,7 @@ void hq4xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict ds
|
||||
|
||||
brightArray[j] = bright;
|
||||
}
|
||||
unsigned int diffBright = ((maxBright - minBright) * 7) >> 4;
|
||||
u32 diffBright = ((u32)(maxBright - minBright) * 7) >> 4;
|
||||
if(diffBright > 7)
|
||||
{
|
||||
const int centerBright = brightArray[4];
|
||||
|
@@ -270,13 +270,11 @@
|
||||
// }
|
||||
//}
|
||||
|
||||
static void lq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count)
|
||||
static void lq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, size_t count)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for(i=0;i<count;++i) {
|
||||
unsigned char mask;
|
||||
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
|
||||
c[1] = src0[0];
|
||||
@@ -303,8 +301,6 @@ static void lq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1,
|
||||
c[8] = c[7];
|
||||
}
|
||||
|
||||
mask = 0;
|
||||
|
||||
if (c[0] != c[4])
|
||||
mask |= 1 << 0;
|
||||
if (c[1] != c[4])
|
||||
@@ -380,14 +376,12 @@ static void lq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1,
|
||||
}
|
||||
}
|
||||
|
||||
static void lq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count)
|
||||
static void lq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, size_t count)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for(i=0;i<count;++i) {
|
||||
unsigned char mask = 0;
|
||||
|
||||
u32 c[9];
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
u8 mask = 0;
|
||||
u32 c[9];
|
||||
|
||||
c[1] = src0[0];
|
||||
c[4] = src1[0];
|
||||
@@ -429,7 +423,7 @@ static void lq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1,
|
||||
|
||||
brightArray[j] = bright;
|
||||
}
|
||||
int diffBright = (maxBright - minBright) >> 4;
|
||||
u32 diffBright = (u32)(maxBright - minBright) >> 4;
|
||||
if(diffBright > 1)
|
||||
{
|
||||
const int centerBright = brightArray[4];
|
||||
|
@@ -306,7 +306,7 @@ bool VideoFilter::SetSourceSize(const size_t width, const size_t height)
|
||||
}
|
||||
memset(newPixBuffer, 0, width * (height + 8) * sizeof(uint32_t));
|
||||
|
||||
if (this->__vfSrcSurface.Surface == NULL || this->__vfSrcSurface.Width != width || this->__vfSrcSurface.Height != height)
|
||||
if ( (this->__vfSrcSurface.Surface == NULL) || ((size_t)this->__vfSrcSurface.Width != width) || ((size_t)this->__vfSrcSurface.Height != height) )
|
||||
{
|
||||
sizeChanged = true;
|
||||
}
|
||||
|
@@ -468,7 +468,7 @@ void MacOGLDisplayPresenter::Init()
|
||||
GLint profileVersion = 0;
|
||||
CGLDescribePixelFormat(this->_pixelFormat, 0, kCGLPFAOpenGLProfile, &profileVersion);
|
||||
|
||||
if (profileVersion == kCGLOGLPVersion_3_2_Core)
|
||||
if ( (profileVersion == kCGLOGLPVersion_3_2_Core) || (profileVersion == 0x4100) )
|
||||
{
|
||||
this->_contextInfo = new OGLContextInfo_3_2;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2024 DeSmuME team
|
||||
Copyright (C) 2009-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -880,7 +880,7 @@ FORCEINLINE void RasterizerUnit<RENDERER>::_drawscanline(const POLYGON_ATTR poly
|
||||
|
||||
//CONSIDER: in case some other math is wrong (shouldve been clipped OK), we might go out of bounds here.
|
||||
//better check the Y value.
|
||||
if ( (pLeft.y < 0) || (pLeft.y >= framebufferHeight) )
|
||||
if ( (pLeft.y < 0) || (pLeft.y >= (s32)framebufferHeight) )
|
||||
{
|
||||
const float gpuScalingFactorHeight = (float)framebufferHeight / (float)GPU_FRAMEBUFFER_NATIVE_HEIGHT;
|
||||
printf("rasterizer rendering at y=%d! oops! (x%.1f)\n", pLeft.y, gpuScalingFactorHeight);
|
||||
@@ -924,7 +924,7 @@ FORCEINLINE void RasterizerUnit<RENDERER>::_drawscanline(const POLYGON_ATTR poly
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (x+rasterWidth > framebufferWidth)
|
||||
if (x+rasterWidth > (s32)framebufferWidth)
|
||||
{
|
||||
if (RENDERER && !USELINEHACK)
|
||||
{
|
||||
@@ -1036,7 +1036,7 @@ void RasterizerUnit<RENDERER>::_runscanlines(const POLYGON_ATTR polyAttr, const
|
||||
bool first = true;
|
||||
|
||||
//HACK: special handling for horizontal line poly
|
||||
if ( USELINEHACK && (left.height == 0) && (right.height == 0) && (left.y < framebufferHeight) && (left.y >= 0) )
|
||||
if ( USELINEHACK && (left.height == 0) && (right.height == 0) && (left.y < (s32)framebufferHeight) && (left.y >= 0) )
|
||||
{
|
||||
const bool draw = ( !SLI || ((left.y >= this->_SLI_startLine) && (left.y < this->_SLI_endLine)) );
|
||||
if (draw)
|
||||
@@ -1265,11 +1265,11 @@ void RasterizerUnit<RENDERER>::_shape_engine(const POLYGON_ATTR polyAttr, const
|
||||
}
|
||||
|
||||
template<bool RENDERER>
|
||||
void RasterizerUnit<RENDERER>::SetSLI(u32 startLine, u32 endLine, bool debug)
|
||||
void RasterizerUnit<RENDERER>::SetSLI(const size_t startLine, const size_t endLine, bool debug)
|
||||
{
|
||||
this->_debug_thisPoly = debug;
|
||||
this->_SLI_startLine = startLine;
|
||||
this->_SLI_endLine = endLine;
|
||||
this->_SLI_startLine = (s32)startLine;
|
||||
this->_SLI_endLine = (s32)endLine;
|
||||
}
|
||||
|
||||
template<bool RENDERER>
|
||||
@@ -1340,22 +1340,22 @@ FORCEINLINE void RasterizerUnit<RENDERER>::Render()
|
||||
{
|
||||
if (useLineHack)
|
||||
{
|
||||
this->_shape_engine<SLI, true, true, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, true, true, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->_shape_engine<SLI, true, true, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, true, true, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (useLineHack)
|
||||
{
|
||||
this->_shape_engine<SLI, true, false, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, true, false, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->_shape_engine<SLI, true, false, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, true, false, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1365,22 +1365,22 @@ FORCEINLINE void RasterizerUnit<RENDERER>::Render()
|
||||
{
|
||||
if (useLineHack)
|
||||
{
|
||||
this->_shape_engine<SLI, false, true, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, false, true, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->_shape_engine<SLI, false, true, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, false, true, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (useLineHack)
|
||||
{
|
||||
this->_shape_engine<SLI, false, false, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, false, false, true>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->_shape_engine<SLI, false, false, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, vertCount);
|
||||
this->_shape_engine<SLI, false, false, false>(polyAttr, isPolyTranslucent, dstColor, dstWidth, dstHeight, (int)vertCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1770,7 +1770,7 @@ SoftRasterizerRenderer::SoftRasterizerRenderer()
|
||||
_enableLineHack = CommonSettings.GFX3D_LineHack;
|
||||
_enableFragmentSamplingHack = CommonSettings.GFX3D_TXTHack;
|
||||
|
||||
_HACK_viewer_rasterizerUnit.SetSLI(0, (u32)_framebufferHeight, false);
|
||||
_HACK_viewer_rasterizerUnit.SetSLI(0, _framebufferHeight, false);
|
||||
|
||||
const size_t coreCount = CommonSettings.num_cores;
|
||||
_threadCount = coreCount;
|
||||
@@ -1801,7 +1801,7 @@ SoftRasterizerRenderer::SoftRasterizerRenderer()
|
||||
_threadClearParam[0].startPixel = 0;
|
||||
_threadClearParam[0].endPixel = _framebufferPixCount;
|
||||
|
||||
_rasterizerUnit[0].SetSLI((u32)_threadPostprocessParam[0].startLine, (u32)_threadPostprocessParam[0].endLine, false);
|
||||
_rasterizerUnit[0].SetSLI(_threadPostprocessParam[0].startLine, _threadPostprocessParam[0].endLine, false);
|
||||
_rasterizerUnit[0].SetRenderer(this);
|
||||
}
|
||||
else
|
||||
@@ -1827,7 +1827,7 @@ SoftRasterizerRenderer::SoftRasterizerRenderer()
|
||||
_threadClearParam[i].startPixel = i * _customPixelsPerThread;
|
||||
_threadClearParam[i].endPixel = (i < _threadCount - 1) ? (i + 1) * _customPixelsPerThread : _framebufferPixCount;
|
||||
|
||||
_rasterizerUnit[i].SetSLI((u32)_threadPostprocessParam[i].startLine, (u32)_threadPostprocessParam[i].endLine, false);
|
||||
_rasterizerUnit[i].SetSLI(_threadPostprocessParam[i].startLine, _threadPostprocessParam[i].endLine, false);
|
||||
_rasterizerUnit[i].SetRenderer(this);
|
||||
|
||||
char name[16];
|
||||
@@ -2473,7 +2473,7 @@ Render3DError SoftRasterizerRenderer::SetFramebufferSize(size_t w, size_t h)
|
||||
this->_threadClearParam[0].startPixel = 0;
|
||||
this->_threadClearParam[0].endPixel = pixCount;
|
||||
|
||||
this->_rasterizerUnit[0].SetSLI((u32)this->_threadPostprocessParam[0].startLine, (u32)this->_threadPostprocessParam[0].endLine, false);
|
||||
this->_rasterizerUnit[0].SetSLI(this->_threadPostprocessParam[0].startLine, this->_threadPostprocessParam[0].endLine, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2488,7 +2488,7 @@ Render3DError SoftRasterizerRenderer::SetFramebufferSize(size_t w, size_t h)
|
||||
this->_threadClearParam[i].startPixel = i * this->_customPixelsPerThread;
|
||||
this->_threadClearParam[i].endPixel = (i < this->_threadCount - 1) ? (i + 1) * this->_customPixelsPerThread : pixCount;
|
||||
|
||||
this->_rasterizerUnit[i].SetSLI((u32)this->_threadPostprocessParam[i].startLine, (u32)this->_threadPostprocessParam[i].endLine, false);
|
||||
this->_rasterizerUnit[i].SetSLI(this->_threadPostprocessParam[i].startLine, this->_threadPostprocessParam[i].endLine, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2023 DeSmuME team
|
||||
Copyright (C) 2009-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -116,8 +116,8 @@ class RasterizerUnit
|
||||
{
|
||||
protected:
|
||||
bool _debug_thisPoly;
|
||||
u32 _SLI_startLine;
|
||||
u32 _SLI_endLine;
|
||||
s32 _SLI_startLine;
|
||||
s32 _SLI_endLine;
|
||||
|
||||
SoftRasterizerRenderer *_softRender;
|
||||
SoftRasterizerTexture *_currentTexture;
|
||||
@@ -139,7 +139,7 @@ protected:
|
||||
template<bool SLI, bool ISFRONTFACING, bool ISSHADOWPOLYGON, bool USELINEHACK> void _shape_engine(const POLYGON_ATTR polyAttr, const bool isPolyTranslucent, Color4u8 *dstColor, const size_t framebufferWidth, const size_t framebufferHeight, int type);
|
||||
|
||||
public:
|
||||
void SetSLI(u32 startLine, u32 endLine, bool debug);
|
||||
void SetSLI(const size_t startLine, const size_t endLine, bool debug);
|
||||
void SetRenderer(SoftRasterizerRenderer *theRenderer);
|
||||
template<bool SLI, bool USELINEHACK> FORCEINLINE void Render();
|
||||
};
|
||||
|
@@ -886,7 +886,7 @@ Render3DError Render3D_SIMD<SIMDBYTES>::SetFramebufferSize(size_t w, size_t h)
|
||||
return RENDER3DERROR_NOERR;
|
||||
}
|
||||
|
||||
this->_framebufferSIMDPixCount = (SIMDBYTES > 0) ? this->_framebufferPixCount - (this->_framebufferPixCount % SIMDBYTES) : _framebufferPixCount;
|
||||
this->_framebufferSIMDPixCount = (SIMDBYTES > 0) ? this->_framebufferPixCount - (this->_framebufferPixCount % SIMDBYTES) : this->_framebufferPixCount;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (C) 2006-2007 shash
|
||||
Copyright (C) 2007-2024 DeSmuME team
|
||||
Copyright (C) 2007-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
static void* operator new(size_t size);
|
||||
static void operator delete(void *p);
|
||||
Render3D();
|
||||
~Render3D();
|
||||
virtual ~Render3D();
|
||||
|
||||
const Render3DDeviceInfo& GetDeviceInfo();
|
||||
RendererID GetRenderID();
|
||||
@@ -332,6 +332,7 @@ class Render3D_SIMD : public Render3D
|
||||
{
|
||||
public:
|
||||
Render3D_SIMD();
|
||||
virtual ~Render3D_SIMD() {}
|
||||
|
||||
virtual Render3DError SetFramebufferSize(size_t w, size_t h);
|
||||
};
|
||||
@@ -341,6 +342,7 @@ public:
|
||||
class Render3D_AVX2 : public Render3D_SIMD<32>
|
||||
{
|
||||
public:
|
||||
virtual ~Render3D_AVX2() {}
|
||||
virtual void _ClearImageBaseLoop(const u16 *__restrict inColor16, const u16 *__restrict inDepth16, u16 *__restrict outColor16, u32 *__restrict outDepth24, u8 *__restrict outFog);
|
||||
};
|
||||
|
||||
@@ -349,6 +351,7 @@ public:
|
||||
class Render3D_SSE2 : public Render3D_SIMD<16>
|
||||
{
|
||||
public:
|
||||
virtual ~Render3D_SSE2() {}
|
||||
virtual void _ClearImageBaseLoop(const u16 *__restrict inColor16, const u16 *__restrict inDepth16, u16 *__restrict outColor16, u32 *__restrict outDepth24, u8 *__restrict outFog);
|
||||
};
|
||||
|
||||
@@ -357,6 +360,7 @@ public:
|
||||
class Render3D_NEON : public Render3D_SIMD<16>
|
||||
{
|
||||
public:
|
||||
virtual ~Render3D_NEON() {}
|
||||
virtual void _ClearImageBaseLoop(const u16 *__restrict inColor16, const u16 *__restrict inDepth16, u16 *__restrict outColor16, u32 *__restrict outDepth24, u8 *__restrict outFog);
|
||||
};
|
||||
|
||||
@@ -365,6 +369,7 @@ public:
|
||||
class Render3D_AltiVec : public Render3D_SIMD<16>
|
||||
{
|
||||
public:
|
||||
virtual ~Render3D_AltiVec() {}
|
||||
virtual void _ClearImageBaseLoop(const u16 *__restrict inColor16, const u16 *__restrict inDepth16, u16 *__restrict outColor16, u32 *__restrict outDepth24, u8 *__restrict outFog);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user