Commit 4ad2322a by Alexis Hetu Committed by Alexis Hétu

Removed SwiftShader's custom Blending enums

- Replaced BlendFactor with VkBlendFactor - Replaced BlendOperation with VkBlendOp Bug b/118386749 Change-Id: I25031c044af05b1922d031db9e82c52bb785def5 Reviewed-on: https://swiftshader-review.googlesource.com/c/22850Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d689d1c0
...@@ -93,42 +93,6 @@ namespace sw ...@@ -93,42 +93,6 @@ namespace sw
CULL_LAST = CULL_COUNTERCLOCKWISE CULL_LAST = CULL_COUNTERCLOCKWISE
}; };
enum BlendFactor ENUM_UNDERLYING_TYPE_UNSIGNED_INT
{
BLEND_ZERO,
BLEND_ONE,
BLEND_SOURCE,
BLEND_INVSOURCE,
BLEND_DEST,
BLEND_INVDEST,
BLEND_SOURCEALPHA,
BLEND_INVSOURCEALPHA,
BLEND_DESTALPHA,
BLEND_INVDESTALPHA,
BLEND_SRCALPHASAT,
BLEND_CONSTANT,
BLEND_INVCONSTANT,
BLEND_CONSTANTALPHA,
BLEND_INVCONSTANTALPHA,
BLEND_LAST = BLEND_INVCONSTANTALPHA
};
enum BlendOperation ENUM_UNDERLYING_TYPE_UNSIGNED_INT
{
BLENDOP_ADD,
BLENDOP_SUB,
BLENDOP_INVSUB,
BLENDOP_MIN,
BLENDOP_MAX,
BLENDOP_SOURCE, // Copy source
BLENDOP_DEST, // Copy dest
BLENDOP_NULL, // Nullify result
BLENDOP_LAST = BLENDOP_NULL
};
enum TransparencyAntialiasing ENUM_UNDERLYING_TYPE_UNSIGNED_INT enum TransparencyAntialiasing ENUM_UNDERLYING_TYPE_UNSIGNED_INT
{ {
TRANSPARENCY_NONE, TRANSPARENCY_NONE,
...@@ -156,14 +120,14 @@ namespace sw ...@@ -156,14 +120,14 @@ namespace sw
bool setDepthBufferEnable(bool depthBufferEnable); bool setDepthBufferEnable(bool depthBufferEnable);
bool setAlphaBlendEnable(bool alphaBlendEnable); bool setAlphaBlendEnable(bool alphaBlendEnable);
bool setSourceBlendFactor(BlendFactor sourceBlendFactor); bool setSourceBlendFactor(VkBlendFactor sourceBlendFactor);
bool setDestBlendFactor(BlendFactor destBlendFactor); bool setDestBlendFactor(VkBlendFactor destBlendFactor);
bool setBlendOperation(BlendOperation blendOperation); bool setBlendOperation(VkBlendOp blendOperation);
bool setSeparateAlphaBlendEnable(bool separateAlphaBlendEnable); bool setSeparateAlphaBlendEnable(bool separateAlphaBlendEnable);
bool setSourceBlendFactorAlpha(BlendFactor sourceBlendFactorAlpha); bool setSourceBlendFactorAlpha(VkBlendFactor sourceBlendFactorAlpha);
bool setDestBlendFactorAlpha(BlendFactor destBlendFactorAlpha); bool setDestBlendFactorAlpha(VkBlendFactor destBlendFactorAlpha);
bool setBlendOperationAlpha(BlendOperation blendOperationAlpha); bool setBlendOperationAlpha(VkBlendOp blendOperationAlpha);
bool setColorWriteMask(int index, int colorWriteMask); bool setColorWriteMask(int index, int colorWriteMask);
bool setWriteSRGB(bool sRGB); bool setWriteSRGB(bool sRGB);
...@@ -179,13 +143,13 @@ namespace sw ...@@ -179,13 +143,13 @@ namespace sw
bool perspectiveActive(); bool perspectiveActive();
bool alphaBlendActive(); bool alphaBlendActive();
BlendFactor sourceBlendFactor(); VkBlendFactor sourceBlendFactor();
BlendFactor destBlendFactor(); VkBlendFactor destBlendFactor();
BlendOperation blendOperation(); VkBlendOp blendOperation();
BlendFactor sourceBlendFactorAlpha(); VkBlendFactor sourceBlendFactorAlpha();
BlendFactor destBlendFactorAlpha(); VkBlendFactor destBlendFactorAlpha();
BlendOperation blendOperationAlpha(); VkBlendOp blendOperationAlpha();
VkLogicOp colorLogicOp(); VkLogicOp colorLogicOp();
...@@ -261,14 +225,14 @@ namespace sw ...@@ -261,14 +225,14 @@ namespace sw
bool depthWriteEnable; bool depthWriteEnable;
bool alphaBlendEnable; bool alphaBlendEnable;
BlendFactor sourceBlendFactorState; VkBlendFactor sourceBlendFactorState;
BlendFactor destBlendFactorState; VkBlendFactor destBlendFactorState;
BlendOperation blendOperationState; VkBlendOp blendOperationState;
bool separateAlphaBlendEnable; bool separateAlphaBlendEnable;
BlendFactor sourceBlendFactorStateAlpha; VkBlendFactor sourceBlendFactorStateAlpha;
BlendFactor destBlendFactorStateAlpha; VkBlendFactor destBlendFactorStateAlpha;
BlendOperation blendOperationStateAlpha; VkBlendOp blendOperationStateAlpha;
float lineWidth; float lineWidth;
......
...@@ -560,17 +560,17 @@ namespace sw ...@@ -560,17 +560,17 @@ namespace sw
context->setAlphaBlendEnable(alphaBlendEnable); context->setAlphaBlendEnable(alphaBlendEnable);
} }
void PixelProcessor::setSourceBlendFactor(BlendFactor sourceBlendFactor) void PixelProcessor::setSourceBlendFactor(VkBlendFactor sourceBlendFactor)
{ {
context->setSourceBlendFactor(sourceBlendFactor); context->setSourceBlendFactor(sourceBlendFactor);
} }
void PixelProcessor::setDestBlendFactor(BlendFactor destBlendFactor) void PixelProcessor::setDestBlendFactor(VkBlendFactor destBlendFactor)
{ {
context->setDestBlendFactor(destBlendFactor); context->setDestBlendFactor(destBlendFactor);
} }
void PixelProcessor::setBlendOperation(BlendOperation blendOperation) void PixelProcessor::setBlendOperation(VkBlendOp blendOperation)
{ {
context->setBlendOperation(blendOperation); context->setBlendOperation(blendOperation);
} }
...@@ -580,17 +580,17 @@ namespace sw ...@@ -580,17 +580,17 @@ namespace sw
context->setSeparateAlphaBlendEnable(separateAlphaBlendEnable); context->setSeparateAlphaBlendEnable(separateAlphaBlendEnable);
} }
void PixelProcessor::setSourceBlendFactorAlpha(BlendFactor sourceBlendFactorAlpha) void PixelProcessor::setSourceBlendFactorAlpha(VkBlendFactor sourceBlendFactorAlpha)
{ {
context->setSourceBlendFactorAlpha(sourceBlendFactorAlpha); context->setSourceBlendFactorAlpha(sourceBlendFactorAlpha);
} }
void PixelProcessor::setDestBlendFactorAlpha(BlendFactor destBlendFactorAlpha) void PixelProcessor::setDestBlendFactorAlpha(VkBlendFactor destBlendFactorAlpha)
{ {
context->setDestBlendFactorAlpha(destBlendFactorAlpha); context->setDestBlendFactorAlpha(destBlendFactorAlpha);
} }
void PixelProcessor::setBlendOperationAlpha(BlendOperation blendOperationAlpha) void PixelProcessor::setBlendOperationAlpha(VkBlendOp blendOperationAlpha)
{ {
context->setBlendOperationAlpha(blendOperationAlpha); context->setBlendOperationAlpha(blendOperationAlpha);
} }
......
...@@ -65,12 +65,12 @@ namespace sw ...@@ -65,12 +65,12 @@ namespace sw
bool depthClamp : 1; bool depthClamp : 1;
bool alphaBlendActive : 1; bool alphaBlendActive : 1;
BlendFactor sourceBlendFactor : BITS(BLEND_LAST); VkBlendFactor sourceBlendFactor : BITS(VK_BLEND_FACTOR_END_RANGE);
BlendFactor destBlendFactor : BITS(BLEND_LAST); VkBlendFactor destBlendFactor : BITS(VK_BLEND_FACTOR_END_RANGE);
BlendOperation blendOperation : BITS(BLENDOP_LAST); VkBlendOp blendOperation : BITS(VK_BLEND_OP_BLUE_EXT);
BlendFactor sourceBlendFactorAlpha : BITS(BLEND_LAST); VkBlendFactor sourceBlendFactorAlpha : BITS(VK_BLEND_FACTOR_END_RANGE);
BlendFactor destBlendFactorAlpha : BITS(BLEND_LAST); VkBlendFactor destBlendFactorAlpha : BITS(VK_BLEND_FACTOR_END_RANGE);
BlendOperation blendOperationAlpha : BITS(BLENDOP_LAST); VkBlendOp blendOperationAlpha : BITS(VK_BLEND_OP_BLUE_EXT);
unsigned int colorWriteMask : RENDERTARGETS * 4; // Four component bit masks unsigned int colorWriteMask : RENDERTARGETS * 4; // Four component bit masks
VkFormat targetFormat[RENDERTARGETS]; VkFormat targetFormat[RENDERTARGETS];
...@@ -239,14 +239,14 @@ namespace sw ...@@ -239,14 +239,14 @@ namespace sw
void setBlendConstant(const Color<float> &blendConstant); void setBlendConstant(const Color<float> &blendConstant);
void setAlphaBlendEnable(bool alphaBlendEnable); void setAlphaBlendEnable(bool alphaBlendEnable);
void setSourceBlendFactor(BlendFactor sourceBlendFactor); void setSourceBlendFactor(VkBlendFactor sourceBlendFactor);
void setDestBlendFactor(BlendFactor destBlendFactor); void setDestBlendFactor(VkBlendFactor destBlendFactor);
void setBlendOperation(BlendOperation blendOperation); void setBlendOperation(VkBlendOp blendOperation);
void setSeparateAlphaBlendEnable(bool separateAlphaBlendEnable); void setSeparateAlphaBlendEnable(bool separateAlphaBlendEnable);
void setSourceBlendFactorAlpha(BlendFactor sourceBlendFactorAlpha); void setSourceBlendFactorAlpha(VkBlendFactor sourceBlendFactorAlpha);
void setDestBlendFactorAlpha(BlendFactor destBlendFactorAlpha); void setDestBlendFactorAlpha(VkBlendFactor destBlendFactorAlpha);
void setBlendOperationAlpha(BlendOperation blendOperationAlpha); void setBlendOperationAlpha(VkBlendOp blendOperationAlpha);
void setAlphaReference(float alphaReference); void setAlphaReference(float alphaReference);
......
...@@ -72,11 +72,11 @@ namespace sw ...@@ -72,11 +72,11 @@ namespace sw
Bool depthTest(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask); Bool depthTest(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask);
// Raster operations // Raster operations
void blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive); void blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, VkBlendFactor blendFactorActive);
void blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive); void blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, VkBlendFactor blendFactorAlphaActive);
void readPixel(int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel); void readPixel(int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel);
void blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive); void blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, VkBlendFactor blendFactorActive);
void blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive); void blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, VkBlendFactor blendFactorAlphaActive);
void writeStencil(Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask); void writeStencil(Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask);
void writeDepth(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask); void writeDepth(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
......
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