d = depth;
size = 0;
mipmaps = 0;
- w = width;
- h = height;
- d = depth;
for (;;)
{
s = w * h * d * sides * 4;
command->texture = texture;
dpsoftrast.texbound[unitnum] = texture;
- ATOMIC_ADD(texture->binds, dpsoftrast.numthreads);
+ if (texture)
+ ATOMIC_ADD(texture->binds, dpsoftrast.numthreads);
}
void DPSOFTRAST_SetVertexPointer(const float *vertex3f, size_t stride)
int subx;
const unsigned int * RESTRICT ini = (const unsigned int *)in4ub;
unsigned char * RESTRICT pixelmask = span->pixelmask;
- unsigned char * RESTRICT pixel = (unsigned char *)dpsoftrast.fb_colorpixels[0];
unsigned int * RESTRICT pixeli = (unsigned int *)dpsoftrast.fb_colorpixels[0];
- if (!pixel)
+ if (!pixeli)
return;
- 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->shader_permutation & SHADERPERMUTATION_ALPHAKILL)
}
else
DPSOFTRAST_Draw_Span_VaryingBGRA8(triangle, span, buffer_FragColorbgra8, 1, buffer_z);
+ if(thread->shader_permutation & SHADERPERMUTATION_ALPHAKILL)
+ {
+ int x;
+ for (x = span->startx;x < span->endx;x++)
+ buffer_FragColorbgra8[x*4+3] = buffer_FragColorbgra8[x*4+3] * thread->uniform4f[DPSOFTRAST_UNIFORM_Alpha*4+0];
+ }
DPSOFTRAST_Draw_Span_FinishBGRA8(thread, triangle, span, buffer_FragColorbgra8);
}
{
for (x = startx;x < endx;x++)
{
- z = buffer_z[x];
+ // z = buffer_z[x];
diffusetex[0] = buffer_texture_colorbgra8[x*4+0];
diffusetex[1] = buffer_texture_colorbgra8[x*4+1];
diffusetex[2] = buffer_texture_colorbgra8[x*4+2];
static void DPSOFTRAST_PixelShader_Water(DPSOFTRAST_State_Thread *thread, const DPSOFTRAST_State_Triangle * RESTRICT triangle, const DPSOFTRAST_State_Span * RESTRICT span)
{
float buffer_z[DPSOFTRAST_DRAW_MAXSPANLENGTH];
- float z;
+ // float z;
int x, startx = span->startx, endx = span->endx;
// texture reads
unsigned char c2[4];
float Fresnel;
- z = buffer_z[x];
+ // z = buffer_z[x];
// " vec4 ScreenScaleRefractReflectIW = ScreenScaleRefractReflect * (1.0 / ModelViewProjectionPosition.w);\n"
iw = 1.0f / (ModelViewProjectionPositiondata[3] + ModelViewProjectionPositionslope[3]*x); // / z
int depthslope;
unsigned int d;
unsigned char *pixelmask;
- DPSOFTRAST_State_Triangle *triangle;
- triangle = &thread->triangles[span->triangle];
depthpixel = dpsoftrast.fb_depthpixels + span->y * dpsoftrast.fb_width + span->x;
startx = span->startx;
endx = span->endx;