Commit a9beed30 by Alexis Hetu Committed by Alexis Hétu

Fixed using GL_SAMPLE_ALPHA_TO_COVERAGE

A few things were failing when trying to use GL_SAMPLE_ALPHA_TO_COVERAGE: - The alpha test should not be skipped when GL_SAMPLE_ALPHA_TO_COVERAGE is set, otherwise no computation is performed. - The alpha reference value was wrong (the alpha-to-coverage ramp is centered around it) Change-Id: Ib9849868d267ca49fb3f0112192af8f207d34307 Reviewed-on: https://swiftshader-review.googlesource.com/8308Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 2e363b0b
...@@ -52,7 +52,7 @@ namespace es2 ...@@ -52,7 +52,7 @@ namespace es2
setDestBlendFactor(BLEND_ZERO); setDestBlendFactor(BLEND_ZERO);
setCullMode(CULL_COUNTERCLOCKWISE); setCullMode(CULL_COUNTERCLOCKWISE);
setDepthCompare(DEPTH_LESSEQUAL); setDepthCompare(DEPTH_LESSEQUAL);
setAlphaReference(0.0f); setAlphaReference(127.5f);
setAlphaCompare(ALPHA_ALWAYS); setAlphaCompare(ALPHA_ALWAYS);
setAlphaBlendEnable(false); setAlphaBlendEnable(false);
setFogEnable(false); setFogEnable(false);
......
...@@ -515,6 +515,7 @@ namespace sw ...@@ -515,6 +515,7 @@ namespace sw
bool Context::alphaTestActive() bool Context::alphaTestActive()
{ {
if(transparencyAntialiasing != TRANSPARENCY_NONE) return true;
if(!alphaTestEnable) return false; if(!alphaTestEnable) return false;
if(alphaCompareMode == ALPHA_ALWAYS) return false; if(alphaCompareMode == ALPHA_ALWAYS) return false;
if(alphaReference == 0.0f && alphaCompareMode == ALPHA_GREATEREQUAL) return false; if(alphaReference == 0.0f && alphaCompareMode == ALPHA_GREATEREQUAL) return false;
......
...@@ -122,7 +122,7 @@ namespace sw ...@@ -122,7 +122,7 @@ namespace sw
bool alphaTestActive() const bool alphaTestActive() const
{ {
return alphaCompareMode != ALPHA_ALWAYS; return (alphaCompareMode != ALPHA_ALWAYS) || (transparencyAntialiasing != TRANSPARENCY_NONE);
} }
bool pixelFogActive() const bool pixelFogActive() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment