]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - dpsoftrast.c
dpsoftrast: SHADERMODE_GENERIC SHADERPERMUTATION_ALPHAKILL too
[xonotic/darkplaces.git] / dpsoftrast.c
index b57129c1c9d1fac110198bc5d5e48444e9baa475..4967ef0eb7214422093812fcc5714571fdf153af 100644 (file)
@@ -3263,6 +3263,12 @@ static void DPSOFTRAST_PixelShader_Generic(DPSOFTRAST_State_Thread *thread, cons
        }
        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);
 }