Commit b2b498e7 by Nicolas Capens

Fix support for BGRA formats in the texture environment.

Bug 21766174 Change-Id: If2fbb543303db27a2a2bd13e1a75cb7f7310d6eb Reviewed-on: https://swiftshader-review.googlesource.com/3478Reviewed-by: 's avatarGreg Hartman <ghartman@google.com> Tested-by: 's avatarGreg Hartman <ghartman@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent a818c453
......@@ -1883,6 +1883,7 @@ void Context::applyTextures()
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
case GL_BGRA_EXT:
// Cv = Cs, Av = As
device->setStageOperation(unit, sw::TextureStage::STAGE_SELECTARG1);
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG1);
......@@ -1905,6 +1906,7 @@ void Context::applyTextures()
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
case GL_BGRA_EXT:
// Cv = CpCs, Av = ApAs
device->setStageOperation(unit, sw::TextureStage::STAGE_MODULATE);
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_MODULATE);
......@@ -1927,6 +1929,7 @@ void Context::applyTextures()
device->setStageOperation(unit, sw::TextureStage::STAGE_SELECTARG1);
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
case GL_RGBA:
case GL_BGRA_EXT:
// Cv = Cp(1 ? As) + CsAs, Av = Ap
device->setStageOperation(unit, sw::TextureStage::STAGE_BLENDTEXTUREALPHA); // Alpha * (Arg1 - Arg2) + Arg2
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
......@@ -1949,6 +1952,7 @@ void Context::applyTextures()
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
case GL_BGRA_EXT:
// Cv = Cp(1 ? Cs) + CcCs, Av = ApAs
device->setStageOperation(unit, sw::TextureStage::STAGE_LERP); // Arg3 * (Arg1 - Arg2) + Arg2
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_MODULATE);
......@@ -1971,6 +1975,7 @@ void Context::applyTextures()
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_SELECTARG2);
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
case GL_BGRA_EXT:
// Cv = Cp + Cs, Av = ApAs
device->setStageOperation(unit, sw::TextureStage::STAGE_ADD);
device->setStageOperationAlpha(unit, sw::TextureStage::STAGE_MODULATE);
......
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