#define ATOMIC_INCREMENT(counter) (OSAtomicIncrement32Barrier(&(counter)))
#define ATOMIC_DECREMENT(counter) (OSAtomicDecrement32Barrier(&(counter)))
#define ATOMIC_ADD(counter, val) ((void)OSAtomicAdd32Barrier((val), &(counter)))
+ #elif defined(__GNUC__) && defined(WIN32)
+ #define ALIGN(var) var __attribute__((__aligned__(16)))
+ #define ATOMIC(var) var __attribute__((__aligned__(32)))
+ #define MEMORY_BARRIER (_mm_sfence())
+ //(__sync_synchronize())
+ #define ATOMIC_COUNTER volatile LONG
+ // this LONG * cast serves to fix an issue with broken mingw
+ // packages on Ubuntu; these only declare the function to take
+ // a LONG *, causing a compile error here. This seems to be
+ // error- and warn-free on platforms that DO declare
+ // InterlockedIncrement correctly, like mingw on Windows.
+ #define ATOMIC_INCREMENT(counter) (InterlockedIncrement((LONG *) &(counter)))
+ #define ATOMIC_DECREMENT(counter) (InterlockedDecrement((LONG *) &(counter)))
+ #define ATOMIC_ADD(counter, val) ((void)InterlockedExchangeAdd((LONG *) &(counter), (val)))
#elif defined(__GNUC__)
#define ALIGN(var) var __attribute__((__aligned__(16)))
#define ATOMIC(var) var __attribute__((__aligned__(32)))
#ifdef SSE_POSSIBLE
#include <emmintrin.h>
-#if defined(__GNUC__) && (__GNUC < 4 || __GNUC_MINOR__ < 6)
+#if defined(__GNUC__) && (__GNUC < 4 || __GNUC_MINOR__ < 6) && !defined(__clang__)
#define _mm_cvtss_f32(val) (__builtin_ia32_vec_ext_v4sf ((__v4sf)(val), 0))
#endif
int depthtest;
int depthfunc;
int scissortest;
- int alphatest;
- int alphafunc;
- float alphavalue;
int viewport[4];
int scissor[4];
float depthrange[2];
command->mode = mode;
}
-DEFCOMMAND(15, AlphaTest, int enable;)
-static void DPSOFTRAST_Interpret_AlphaTest(DPSOFTRAST_State_Thread *thread, DPSOFTRAST_Command_AlphaTest *command)
-{
- thread->alphatest = command->enable;
-}
-void DPSOFTRAST_AlphaTest(int enable)
-{
- DPSOFTRAST_Command_AlphaTest *command = DPSOFTRAST_ALLOCATECOMMAND(AlphaTest);
- command->enable = enable;
-}
-
-DEFCOMMAND(16, AlphaFunc, int func; float ref;)
-static void DPSOFTRAST_Interpret_AlphaFunc(DPSOFTRAST_State_Thread *thread, DPSOFTRAST_Command_AlphaFunc *command)
-{
- thread->alphafunc = command->func;
- thread->alphavalue = command->ref;
-}
-void DPSOFTRAST_AlphaFunc(int func, float ref)
-{
- DPSOFTRAST_Command_AlphaFunc *command = DPSOFTRAST_ALLOCATECOMMAND(AlphaFunc);
- command->func = func;
- command->ref = ref;
-}
-
void DPSOFTRAST_Color4f(float r, float g, float b, float a)
{
dpsoftrast.color[0] = r;
pixel += (span->y * dpsoftrast.fb_width + span->x) * 4;
pixeli += span->y * dpsoftrast.fb_width + span->x;
// handle alphatest now (this affects depth writes too)
- if (thread->alphatest)
+ if (thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL)
for (x = startx;x < endx;x++)
if (in4ub[x*4+3] < 128)
pixelmask[x] = false;
#endif
}
-static void DPSOFTRAST_Texture2D(DPSOFTRAST_Texture *texture, int mip, float x, float y, float c[4])
- // warning: this is SLOW, only use if the optimized per-span functions won't do
- // FIXME does this function need flipping of the color order?
-{
- const unsigned char * RESTRICT pixelbase;
- const unsigned char * RESTRICT pixel[4];
- int tciwrapmask[2];
- tciwrapmask[0] = texture->mipmap[mip][2]-1;
- tciwrapmask[1] = texture->mipmap[mip][3]-1;
- pixelbase = (unsigned char *)texture->bytes + texture->mipmap[mip][0];
- if(texture->filter & DPSOFTRAST_TEXTURE_FILTER_LINEAR)
- {
- if (texture->flags & DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE)
- {
- unsigned int tc[2] = { x * (texture->mipmap[mip][2]<<12) - 2048, y * (texture->mipmap[mip][3]<<12) - 2048};
- unsigned int frac[2] = { tc[0]&0xFFF, tc[1]&0xFFF };
- unsigned int ifrac[2] = { 0x1000 - frac[0], 0x1000 - frac[1] };
- unsigned int lerp[4] = { ifrac[0]*ifrac[1], frac[0]*ifrac[1], ifrac[0]*frac[1], frac[0]*frac[1] };
- int tci[2] = { tc[0]>>12, tc[1]>>12 };
- int tci1[2] = { tci[0] + 1, tci[1] + 1 };
- tci[0] = tci[0] >= 0 ? (tci[0] <= texture->mipmap[mip][2]-1 ? tci[0] : texture->mipmap[mip][2]-1) : 0;
- tci[1] = tci[1] >= 0 ? (tci[1] <= texture->mipmap[mip][3]-1 ? tci[1] : texture->mipmap[mip][3]-1) : 0;
- tci1[0] = tci1[0] >= 0 ? (tci1[0] <= texture->mipmap[mip][2]-1 ? tci1[0] : texture->mipmap[mip][2]-1) : 0;
- tci1[1] = tci1[1] >= 0 ? (tci1[1] <= texture->mipmap[mip][3]-1 ? tci1[1] : texture->mipmap[mip][3]-1) : 0;
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[1] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci1[0]);
- pixel[2] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[3] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci1[0]);
- c[0] = (pixel[0][0]*lerp[0]+pixel[1][0]*lerp[1]+pixel[2][0]*lerp[2]+pixel[3][0]*lerp[3]) * (1.0f / 0xFF00000);
- c[1] = (pixel[0][1]*lerp[0]+pixel[1][1]*lerp[1]+pixel[2][1]*lerp[2]+pixel[3][1]*lerp[3]) * (1.0f / 0xFF00000);
- c[2] = (pixel[0][2]*lerp[0]+pixel[1][2]*lerp[1]+pixel[2][2]*lerp[2]+pixel[3][2]*lerp[3]) * (1.0f / 0xFF00000);
- c[3] = (pixel[0][3]*lerp[0]+pixel[1][3]*lerp[1]+pixel[2][3]*lerp[2]+pixel[3][3]*lerp[3]) * (1.0f / 0xFF00000);
- }
- else
- {
- unsigned int tc[2] = { x * (texture->mipmap[mip][2]<<12) - 2048, y * (texture->mipmap[mip][3]<<12) - 2048};
- unsigned int frac[2] = { tc[0]&0xFFF, tc[1]&0xFFF };
- unsigned int ifrac[2] = { 0x1000 - frac[0], 0x1000 - frac[1] };
- unsigned int lerp[4] = { ifrac[0]*ifrac[1], frac[0]*ifrac[1], ifrac[0]*frac[1], frac[0]*frac[1] };
- int tci[2] = { tc[0]>>12, tc[1]>>12 };
- int tci1[2] = { tci[0] + 1, tci[1] + 1 };
- tci[0] &= tciwrapmask[0];
- tci[1] &= tciwrapmask[1];
- tci1[0] &= tciwrapmask[0];
- tci1[1] &= tciwrapmask[1];
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[1] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci1[0]);
- pixel[2] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[3] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci1[0]);
- c[0] = (pixel[0][0]*lerp[0]+pixel[1][0]*lerp[1]+pixel[2][0]*lerp[2]+pixel[3][0]*lerp[3]) * (1.0f / 0xFF00000);
- c[1] = (pixel[0][1]*lerp[0]+pixel[1][1]*lerp[1]+pixel[2][1]*lerp[2]+pixel[3][1]*lerp[3]) * (1.0f / 0xFF00000);
- c[2] = (pixel[0][2]*lerp[0]+pixel[1][2]*lerp[1]+pixel[2][2]*lerp[2]+pixel[3][2]*lerp[3]) * (1.0f / 0xFF00000);
- c[3] = (pixel[0][3]*lerp[0]+pixel[1][3]*lerp[1]+pixel[2][3]*lerp[2]+pixel[3][3]*lerp[3]) * (1.0f / 0xFF00000);
- }
- }
- else
- {
- if (texture->flags & DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE)
- {
- int tci[2] = { x * texture->mipmap[mip][2], y * texture->mipmap[mip][3] };
- tci[0] = tci[0] >= 0 ? (tci[0] <= texture->mipmap[mip][2]-1 ? tci[0] : texture->mipmap[mip][2]-1) : 0;
- tci[1] = tci[1] >= 0 ? (tci[1] <= texture->mipmap[mip][3]-1 ? tci[1] : texture->mipmap[mip][3]-1) : 0;
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- c[0] = pixel[0][0] * (1.0f / 255.0f);
- c[1] = pixel[0][1] * (1.0f / 255.0f);
- c[2] = pixel[0][2] * (1.0f / 255.0f);
- c[3] = pixel[0][3] * (1.0f / 255.0f);
- }
- else
- {
- int tci[2] = { x * texture->mipmap[mip][2], y * texture->mipmap[mip][3] };
- tci[0] &= tciwrapmask[0];
- tci[1] &= tciwrapmask[1];
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- c[0] = pixel[0][0] * (1.0f / 255.0f);
- c[1] = pixel[0][1] * (1.0f / 255.0f);
- c[2] = pixel[0][2] * (1.0f / 255.0f);
- c[3] = pixel[0][3] * (1.0f / 255.0f);
- }
- }
-}
-
static void DPSOFTRAST_Texture2DBGRA8(DPSOFTRAST_Texture *texture, int mip, float x, float y, unsigned char c[4])
// warning: this is SLOW, only use if the optimized per-span functions won't do
{
const unsigned char * RESTRICT pixelbase;
const unsigned char * RESTRICT pixel[4];
- int tciwrapmask[2];
- tciwrapmask[0] = texture->mipmap[mip][2]-1;
- tciwrapmask[1] = texture->mipmap[mip][3]-1;
+ int width = texture->mipmap[mip][2], height = texture->mipmap[mip][3];
+ int wrapmask[2] = { width-1, height-1 };
pixelbase = (unsigned char *)texture->bytes + texture->mipmap[mip][0];
if(texture->filter & DPSOFTRAST_TEXTURE_FILTER_LINEAR)
{
+ unsigned int tc[2] = { x * (width<<12) - 2048, y * (height<<12) - 2048};
+ unsigned int frac[2] = { tc[0]&0xFFF, tc[1]&0xFFF };
+ unsigned int ifrac[2] = { 0x1000 - frac[0], 0x1000 - frac[1] };
+ unsigned int lerp[4] = { ifrac[0]*ifrac[1], frac[0]*ifrac[1], ifrac[0]*frac[1], frac[0]*frac[1] };
+ int tci[2] = { tc[0]>>12, tc[1]>>12 };
+ int tci1[2] = { tci[0] + 1, tci[1] + 1 };
if (texture->flags & DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE)
{
- unsigned int tc[2] = { x * (texture->mipmap[mip][2]<<12) - 2048, y * (texture->mipmap[mip][3]<<12) - 2048};
- unsigned int frac[2] = { tc[0]&0xFFF, tc[1]&0xFFF };
- unsigned int ifrac[2] = { 0x1000 - frac[0], 0x1000 - frac[1] };
- unsigned int lerp[4] = { ifrac[0]*ifrac[1], frac[0]*ifrac[1], ifrac[0]*frac[1], frac[0]*frac[1] };
- int tci[2] = { tc[0]>>12, tc[1]>>12 };
- int tci1[2] = { tci[0] + 1, tci[1] + 1 };
- tci[0] = tci[0] >= 0 ? (tci[0] <= texture->mipmap[mip][2]-1 ? tci[0] : texture->mipmap[mip][2]-1) : 0;
- tci[1] = tci[1] >= 0 ? (tci[1] <= texture->mipmap[mip][3]-1 ? tci[1] : texture->mipmap[mip][3]-1) : 0;
- tci1[0] = tci1[0] >= 0 ? (tci1[0] <= texture->mipmap[mip][2]-1 ? tci1[0] : texture->mipmap[mip][2]-1) : 0;
- tci1[1] = tci1[1] >= 0 ? (tci1[1] <= texture->mipmap[mip][3]-1 ? tci1[1] : texture->mipmap[mip][3]-1) : 0;
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[1] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci1[0]);
- pixel[2] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[3] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci1[0]);
- c[0] = (pixel[0][0]*lerp[0]+pixel[1][0]*lerp[1]+pixel[2][0]*lerp[2]+pixel[3][0]*lerp[3])>>24;
- c[1] = (pixel[0][1]*lerp[0]+pixel[1][1]*lerp[1]+pixel[2][1]*lerp[2]+pixel[3][1]*lerp[3])>>24;
- c[2] = (pixel[0][2]*lerp[0]+pixel[1][2]*lerp[1]+pixel[2][2]*lerp[2]+pixel[3][2]*lerp[3])>>24;
- c[3] = (pixel[0][3]*lerp[0]+pixel[1][3]*lerp[1]+pixel[2][3]*lerp[2]+pixel[3][3]*lerp[3])>>24;
+ tci[0] = tci[0] >= 0 ? (tci[0] <= wrapmask[0] ? tci[0] : wrapmask[0]) : 0;
+ tci[1] = tci[1] >= 0 ? (tci[1] <= wrapmask[1] ? tci[1] : wrapmask[1]) : 0;
+ tci1[0] = tci1[0] >= 0 ? (tci1[0] <= wrapmask[0] ? tci1[0] : wrapmask[0]) : 0;
+ tci1[1] = tci1[1] >= 0 ? (tci1[1] <= wrapmask[1] ? tci1[1] : wrapmask[1]) : 0;
}
else
{
- unsigned int tc[2] = { x * (texture->mipmap[mip][2]<<12) - 2048, y * (texture->mipmap[mip][3]<<12) - 2048};
- unsigned int frac[2] = { tc[0]&0xFFF, tc[1]&0xFFF };
- unsigned int ifrac[2] = { 0x1000 - frac[0], 0x1000 - frac[1] };
- unsigned int lerp[4] = { ifrac[0]*ifrac[1], frac[0]*ifrac[1], ifrac[0]*frac[1], frac[0]*frac[1] };
- int tci[2] = { tc[0]>>12, tc[1]>>12 };
- int tci1[2] = { tci[0] + 1, tci[1] + 1 };
- tci[0] &= tciwrapmask[0];
- tci[1] &= tciwrapmask[1];
- tci1[0] &= tciwrapmask[0];
- tci1[1] &= tciwrapmask[1];
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[1] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci1[0]);
- pixel[2] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci[0]);
- pixel[3] = pixelbase + 4 * (tci1[1]*texture->mipmap[mip][2]+tci1[0]);
- c[0] = (pixel[0][0]*lerp[0]+pixel[1][0]*lerp[1]+pixel[2][0]*lerp[2]+pixel[3][0]*lerp[3])>>24;
- c[1] = (pixel[0][1]*lerp[0]+pixel[1][1]*lerp[1]+pixel[2][1]*lerp[2]+pixel[3][1]*lerp[3])>>24;
- c[2] = (pixel[0][2]*lerp[0]+pixel[1][2]*lerp[1]+pixel[2][2]*lerp[2]+pixel[3][2]*lerp[3])>>24;
- c[3] = (pixel[0][3]*lerp[0]+pixel[1][3]*lerp[1]+pixel[2][3]*lerp[2]+pixel[3][3]*lerp[3])>>24;
+ tci[0] &= wrapmask[0];
+ tci[1] &= wrapmask[1];
+ tci1[0] &= wrapmask[0];
+ tci1[1] &= wrapmask[1];
}
+ pixel[0] = pixelbase + 4 * (tci[1]*width+tci[0]);
+ pixel[1] = pixelbase + 4 * (tci[1]*width+tci1[0]);
+ pixel[2] = pixelbase + 4 * (tci1[1]*width+tci[0]);
+ pixel[3] = pixelbase + 4 * (tci1[1]*width+tci1[0]);
+ c[0] = (pixel[0][0]*lerp[0]+pixel[1][0]*lerp[1]+pixel[2][0]*lerp[2]+pixel[3][0]*lerp[3])>>24;
+ c[1] = (pixel[0][1]*lerp[0]+pixel[1][1]*lerp[1]+pixel[2][1]*lerp[2]+pixel[3][1]*lerp[3])>>24;
+ c[2] = (pixel[0][2]*lerp[0]+pixel[1][2]*lerp[1]+pixel[2][2]*lerp[2]+pixel[3][2]*lerp[3])>>24;
+ c[3] = (pixel[0][3]*lerp[0]+pixel[1][3]*lerp[1]+pixel[2][3]*lerp[2]+pixel[3][3]*lerp[3])>>24;
}
else
{
+ int tci[2] = { x * width, y * height };
if (texture->flags & DPSOFTRAST_TEXTURE_FLAG_CLAMPTOEDGE)
{
- int tci[2] = { x * texture->mipmap[mip][2], y * texture->mipmap[mip][3] };
- tci[0] = tci[0] >= 0 ? (tci[0] <= texture->mipmap[mip][2]-1 ? tci[0] : texture->mipmap[mip][2]-1) : 0;
- tci[1] = tci[1] >= 0 ? (tci[1] <= texture->mipmap[mip][3]-1 ? tci[1] : texture->mipmap[mip][3]-1) : 0;
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- c[0] = pixel[0][0];
- c[1] = pixel[0][1];
- c[2] = pixel[0][2];
- c[3] = pixel[0][3];
+ tci[0] = tci[0] >= 0 ? (tci[0] <= wrapmask[0] ? tci[0] : wrapmask[0]) : 0;
+ tci[1] = tci[1] >= 0 ? (tci[1] <= wrapmask[1] ? tci[1] : wrapmask[1]) : 0;
}
else
{
- int tci[2] = { x * texture->mipmap[mip][2], y * texture->mipmap[mip][3] };
- tci[0] &= tciwrapmask[0];
- tci[1] &= tciwrapmask[1];
- pixel[0] = pixelbase + 4 * (tci[1]*texture->mipmap[mip][2]+tci[0]);
- c[0] = pixel[0][0];
- c[1] = pixel[0][1];
- c[2] = pixel[0][2];
- c[3] = pixel[0][3];
+ tci[0] &= wrapmask[0];
+ tci[1] &= wrapmask[1];
}
+ pixel[0] = pixelbase + 4 * (tci[1]*width+tci[0]);
+ c[0] = pixel[0][0];
+ c[1] = pixel[0][1];
+ c[2] = pixel[0][2];
+ c[3] = pixel[0][3];
}
}
unsigned char buffer_FragColorbgra8[DPSOFTRAST_DRAW_MAXSPANLENGTH*4];
DPSOFTRAST_Draw_Span_Begin(thread, triangle, span, buffer_z);
DPSOFTRAST_Draw_Span_Texture2DVaryingBGRA8(thread, triangle, span, buffer_texture_colorbgra8, GL20TU_COLOR, 2, buffer_z);
- if (thread->alphatest || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
+ if ((thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL) || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
pixel = buffer_FragColorbgra8;
Color_Ambientm = _mm_shuffle_epi32(_mm_cvtps_epi32(_mm_mul_ps(_mm_load_ps(&thread->uniform4f[DPSOFTRAST_UNIFORM_Color_Ambient*4]), _mm_set1_ps(256.0f))), _MM_SHUFFLE(3, 0, 1, 2));
Color_Ambientm = _mm_and_si128(Color_Ambientm, _mm_setr_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0));
int arrayindex = DPSOFTRAST_ARRAY_COLOR;
DPSOFTRAST_Draw_Span_Begin(thread, triangle, span, buffer_z);
DPSOFTRAST_Draw_Span_Texture2DVaryingBGRA8(thread, triangle, span, buffer_texture_colorbgra8, GL20TU_COLOR, 2, buffer_z);
- if (thread->alphatest || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
+ if ((thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL) || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
pixel = buffer_FragColorbgra8;
Color_Ambientm = _mm_shuffle_epi32(_mm_cvtps_epi32(_mm_mul_ps(_mm_load_ps(&thread->uniform4f[DPSOFTRAST_UNIFORM_Color_Ambient*4]), _mm_set1_ps(256.0f))), _MM_SHUFFLE(3, 0, 1, 2));
Color_Ambientm = _mm_and_si128(Color_Ambientm, _mm_setr_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0));
DPSOFTRAST_Draw_Span_Begin(thread, triangle, span, buffer_z);
DPSOFTRAST_Draw_Span_Texture2DVaryingBGRA8(thread, triangle, span, buffer_texture_colorbgra8, GL20TU_COLOR, DPSOFTRAST_ARRAY_TEXCOORD0, buffer_z);
DPSOFTRAST_Draw_Span_Texture2DVaryingBGRA8(thread, triangle, span, buffer_texture_lightmapbgra8, GL20TU_LIGHTMAP, DPSOFTRAST_ARRAY_TEXCOORD4, buffer_z);
- if (thread->alphatest || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
+ if ((thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL) || thread->fb_blendmode != DPSOFTRAST_BLENDMODE_OPAQUE)
pixel = buffer_FragColorbgra8;
Color_Ambientm = _mm_shuffle_epi32(_mm_cvtps_epi32(_mm_mul_ps(_mm_load_ps(&thread->uniform4f[DPSOFTRAST_UNIFORM_Color_Ambient*4]), _mm_set1_ps(256.0f))), _MM_SHUFFLE(3, 0, 1, 2));
Color_Ambientm = _mm_and_si128(Color_Ambientm, _mm_setr_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0));
float EyeVectorslope[4];
// uniforms
- float ScreenScaleRefractReflect[2];
- float ScreenCenterRefractReflect[2];
- float DistortScaleRefractReflect[2];
+ float ScreenScaleRefractReflect[4];
+ float ScreenCenterRefractReflect[4];
+ float DistortScaleRefractReflect[4];
float RefractColor[4];
float ReflectColor[4];
float ReflectFactor;
INTERPCOMMAND(DepthRange)
INTERPCOMMAND(PolygonOffset)
INTERPCOMMAND(CullFace)
- INTERPCOMMAND(AlphaTest)
- INTERPCOMMAND(AlphaFunc)
INTERPCOMMAND(SetTexture)
INTERPCOMMAND(SetShader)
INTERPCOMMAND(Uniform4f)
thread->depthtest = true;
thread->depthfunc = GL_LEQUAL;
thread->scissortest = false;
- thread->alphatest = false;
- thread->alphafunc = GL_GREATER;
- thread->alphavalue = 0.5f;
thread->viewport[0] = 0;
thread->viewport[1] = 0;
thread->viewport[2] = dpsoftrast.fb_width;