Commit d55a0953 by Nicolas Capens

Renamed boolean state variables and setters.

Change-Id: Ied1be6434a356ec7315df9d728dc424961f44fd0 Reviewed-on: https://swiftshader-review.googlesource.com/3770Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 48621bd2
......@@ -415,12 +415,12 @@ struct State
GLclampf depthClearValue;
int stencilClearValue;
bool cullFace;
bool cullFaceEnabled;
GLenum cullMode;
GLenum frontFace;
bool depthTest;
bool depthTestEnabled;
GLenum depthFunc;
bool blend;
bool blendEnabled;
GLenum sourceBlendRGB;
GLenum destBlendRGB;
GLenum sourceBlendAlpha;
......@@ -428,7 +428,7 @@ struct State
GLenum blendEquationRGB;
GLenum blendEquationAlpha;
Color blendColor;
bool stencilTest;
bool stencilTestEnabled;
GLenum stencilFunc;
GLint stencilRef;
GLuint stencilMask;
......@@ -443,16 +443,16 @@ struct State
GLenum stencilBackPassDepthFail;
GLenum stencilBackPassDepthPass;
GLuint stencilBackWritemask;
bool polygonOffsetFill;
bool polygonOffsetFillEnabled;
GLfloat polygonOffsetFactor;
GLfloat polygonOffsetUnits;
bool sampleAlphaToCoverage;
bool sampleCoverage;
bool sampleAlphaToCoverageEnabled;
bool sampleCoverageEnabled;
GLclampf sampleCoverageValue;
bool sampleCoverageInvert;
bool scissorTest;
bool dither;
bool colorLogicOp;
bool scissorTestEnabled;
bool ditherEnabled;
bool colorLogicOpEnabled;
GLenum logicalOperation;
GLfloat lineWidth;
......@@ -510,23 +510,23 @@ public:
void setClearDepth(float depth);
void setClearStencil(int stencil);
void setCullFace(bool enabled);
void setCullFaceEnabled(bool enabled);
bool isCullFaceEnabled() const;
void setCullMode(GLenum mode);
void setFrontFace(GLenum front);
void setDepthTest(bool enabled);
void setDepthTestEnabled(bool enabled);
bool isDepthTestEnabled() const;
void setDepthFunc(GLenum depthFunc);
void setDepthRange(float zNear, float zFar);
void setBlend(bool enabled);
void setBlendEnabled(bool enabled);
bool isBlendEnabled() const;
void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);
void setBlendColor(float red, float green, float blue, float alpha);
void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation);
void setStencilTest(bool enabled);
void setStencilTestEnabled(bool enabled);
bool isStencilTestEnabled() const;
void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask);
void setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask);
......@@ -535,17 +535,17 @@ public:
void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass);
void setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass);
void setPolygonOffsetFill(bool enabled);
void setPolygonOffsetFillEnabled(bool enabled);
bool isPolygonOffsetFillEnabled() const;
void setPolygonOffsetParams(GLfloat factor, GLfloat units);
void setSampleAlphaToCoverage(bool enabled);
void setSampleAlphaToCoverageEnabled(bool enabled);
bool isSampleAlphaToCoverageEnabled() const;
void setSampleCoverage(bool enabled);
void setSampleCoverageEnabled(bool enabled);
bool isSampleCoverageEnabled() const;
void setSampleCoverageParams(GLclampf value, bool invert);
void setDither(bool enabled);
void setDitherEnabled(bool enabled);
bool isDitherEnabled() const;
void setLineWidth(GLfloat width);
......@@ -555,7 +555,7 @@ public:
void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
void setScissorTest(bool enabled);
void setScissorTestEnabled(bool enabled);
bool isScissorTestEnabled() const;
void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height);
......@@ -572,7 +572,7 @@ public:
GLuint getArrayBufferName() const;
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled);
const VertexAttribute &getVertexAttribState(unsigned int attribNum);
void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type,
bool normalized, GLsizei stride, const void *pointer);
......@@ -687,14 +687,14 @@ public:
void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
void ortho(double left, double right, double bottom, double top, double zNear, double zFar); // FIXME: GLdouble
void setLighting(bool enabled);
void setFog(bool enabled);
void setAlphaTest(bool enabled);
void setLightingEnabled(bool enabled);
void setFogEnabled(bool enabled);
void setAlphaTestEnabled(bool enabled);
void alphaFunc(GLenum func, GLclampf ref);
void setTexture2D(bool enabled);
void setTexture2DEnabled(bool enabled);
void setShadeModel(GLenum mode);
void setLight(int index, bool enable);
void setNormalizeNormals(bool enable);
void setLightEnabled(int index, bool enable);
void setNormalizeNormalsEnabled(bool enable);
GLuint genLists(GLsizei range);
void newList(GLuint list, GLenum mode);
......@@ -716,10 +716,10 @@ public:
void position(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void end();
void setColorMaterial(bool enable);
void setColorMaterialEnabled(bool enable);
void setColorMaterialMode(GLenum mode);
void setColorLogicOpEnable(bool colorLogicOpEnabled);
void setColorLogicOpEnabled(bool colorLogicOpEnabled);
bool isColorLogicOpEnabled();
void setLogicalOperation(GLenum logicalOperation);
......
......@@ -120,7 +120,7 @@ struct Attenuation
struct Light
{
bool enable;
bool enabled;
Color ambient;
Color diffuse;
Color specular;
......@@ -207,19 +207,19 @@ struct State
GLclampf depthClearValue;
int stencilClearValue;
bool cullFace;
bool cullFaceEnabled;
GLenum cullMode;
GLenum frontFace;
bool depthTest;
bool depthTestEnabled;
GLenum depthFunc;
bool blend;
bool blendEnabled;
GLenum sourceBlendRGB;
GLenum destBlendRGB;
GLenum sourceBlendAlpha;
GLenum destBlendAlpha;
GLenum blendEquationRGB;
GLenum blendEquationAlpha;
bool stencilTest;
bool stencilTestEnabled;
GLenum stencilFunc;
GLint stencilRef;
GLuint stencilMask;
......@@ -227,17 +227,17 @@ struct State
GLenum stencilPassDepthFail;
GLenum stencilPassDepthPass;
GLuint stencilWritemask;
bool polygonOffsetFill;
bool polygonOffsetFillEnabled;
GLfloat polygonOffsetFactor;
GLfloat polygonOffsetUnits;
bool sampleAlphaToCoverage;
bool sampleCoverage;
bool sampleAlphaToCoverageEnabled;
bool sampleCoverageEnabled;
GLclampf sampleCoverageValue;
bool sampleCoverageInvert;
bool scissorTest;
bool dither;
bool scissorTestEnabled;
bool ditherEnabled;
GLenum shadeModel;
bool colorLogicOp;
bool colorLogicOpEnabled;
GLenum logicalOperation;
GLfloat lineWidth;
......@@ -293,46 +293,46 @@ public:
void setClearDepth(float depth);
void setClearStencil(int stencil);
void setCullFace(bool enabled);
void setCullFaceEnabled(bool enabled);
bool isCullFaceEnabled() const;
void setCullMode(GLenum mode);
void setFrontFace(GLenum front);
void setDepthTest(bool enabled);
void setDepthTestEnabled(bool enabled);
bool isDepthTestEnabled() const;
void setDepthFunc(GLenum depthFunc);
void setDepthRange(float zNear, float zFar);
void setAlphaTest(bool enabled);
void setAlphaTestEnabled(bool enabled);
bool isAlphaTestEnabled() const;
void setAlphaFunc(GLenum alphaFunc, GLclampf reference);
void setBlend(bool enabled);
void setBlendEnabled(bool enabled);
bool isBlendEnabled() const;
void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);
void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation);
void setStencilTest(bool enabled);
void setStencilTestEnabled(bool enabled);
bool isStencilTestEnabled() const;
void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask);
void setStencilWritemask(GLuint stencilWritemask);
void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass);
void setPolygonOffsetFill(bool enabled);
void setPolygonOffsetFillEnabled(bool enabled);
bool isPolygonOffsetFillEnabled() const;
void setPolygonOffsetParams(GLfloat factor, GLfloat units);
void setSampleAlphaToCoverage(bool enabled);
void setSampleAlphaToCoverageEnabled(bool enabled);
bool isSampleAlphaToCoverageEnabled() const;
void setSampleCoverage(bool enabled);
void setSampleCoverageEnabled(bool enabled);
bool isSampleCoverageEnabled() const;
void setSampleCoverageParams(GLclampf value, bool invert);
void setShadeModel(GLenum mode);
void setDither(bool enabled);
void setDitherEnabled(bool enabled);
bool isDitherEnabled() const;
void setLighting(bool enabled);
void setLight(int index, bool enable);
void setLightingEnabled(bool enabled);
void setLightEnabled(int index, bool enable);
void setLightAmbient(int index, float r, float g, float b, float a);
void setLightDiffuse(int index, float r, float g, float b, float a);
void setLightSpecular(int index, float r, float g, float b, float a);
......@@ -349,7 +349,7 @@ public:
void setMaterialEmission(float red, float green, float blue, float alpha);
void setMaterialShininess(float shininess);
void setFog(bool enabled);
void setFogEnabled(bool enabled);
void setFogMode(GLenum mode);
void setFogDensity(float fogDensity);
void setFogStart(float fogStart);
......@@ -386,7 +386,7 @@ public:
void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
void setScissorTest(bool enabled);
void setScissorTestEnabled(bool enabled);
bool isScissorTestEnabled() const;
void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height);
......@@ -400,7 +400,7 @@ public:
GLuint getArrayBufferName() const;
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled);
const VertexAttribute &getVertexAttribState(unsigned int attribNum);
void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type,
bool normalized, GLsizei stride, const void *pointer);
......@@ -501,7 +501,7 @@ public:
void ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
void setClipPlane(int index, const float plane[4]);
void setClipPlaneEnable(int index, bool enable);
void setClipPlaneEnabled(int index, bool enable);
bool isClipPlaneEnabled(int index) const;
private:
......@@ -534,7 +534,7 @@ private:
VertexDataManager *mVertexDataManager;
IndexDataManager *mIndexDataManager;
bool lighting;
bool lightingEnabled;
Light light[MAX_LIGHTS];
Color globalAmbient;
Color materialAmbient;
......@@ -578,7 +578,7 @@ private:
int clipFlags;
bool alphaTest;
bool alphaTestEnabled;
GLenum alphaTestFunc;
float alphaTestRef;
......
......@@ -140,7 +140,7 @@ struct Color
// Helper structure describing a single vertex attribute
class VertexAttribute
{
public:
public:
VertexAttribute() : mType(GL_FLOAT), mSize(0), mNormalized(false), mStride(0), mDivisor(0), mPointer(NULL), mArrayEnabled(false)
{
mCurrentValue[0].f = 0.0f;
......@@ -245,6 +245,7 @@ class VertexAttribute
gl::BindingPointer<Buffer> mBoundBuffer; // Captured when glVertexAttribPointer is called.
bool mArrayEnabled; // From glEnable/DisableVertexAttribArray
private:
union ValueUnion
{
......@@ -254,6 +255,7 @@ private:
GLint i;
GLuint ui;
};
ValueUnion mCurrentValue[4]; // From glVertexAttrib
ValueUnion::Type mCurrentValueType;
};
......@@ -267,12 +269,12 @@ struct State
GLclampf depthClearValue;
int stencilClearValue;
bool cullFace;
bool cullFaceEnabled;
GLenum cullMode;
GLenum frontFace;
bool depthTest;
bool depthTestEnabled;
GLenum depthFunc;
bool blend;
bool blendEnabled;
GLenum sourceBlendRGB;
GLenum destBlendRGB;
GLenum sourceBlendAlpha;
......@@ -280,7 +282,7 @@ struct State
GLenum blendEquationRGB;
GLenum blendEquationAlpha;
Color blendColor;
bool stencilTest;
bool stencilTestEnabled;
GLenum stencilFunc;
GLint stencilRef;
GLuint stencilMask;
......@@ -295,18 +297,18 @@ struct State
GLenum stencilBackPassDepthFail;
GLenum stencilBackPassDepthPass;
GLuint stencilBackWritemask;
bool polygonOffsetFill;
bool polygonOffsetFillEnabled;
GLfloat polygonOffsetFactor;
GLfloat polygonOffsetUnits;
bool sampleAlphaToCoverage;
bool sampleCoverage;
bool sampleAlphaToCoverageEnabled;
bool sampleCoverageEnabled;
GLclampf sampleCoverageValue;
bool sampleCoverageInvert;
bool scissorTest;
bool dither;
bool primitiveRestartFixedIndex;
bool rasterizerDiscard;
bool colorLogicOp;
bool scissorTestEnabled;
bool ditherEnabled;
bool primitiveRestartFixedIndexEnabled;
bool rasterizerDiscardEnabled;
bool colorLogicOpEnabled;
GLenum logicalOperation;
GLfloat lineWidth;
......@@ -377,23 +379,23 @@ public:
void setClearDepth(float depth);
void setClearStencil(int stencil);
void setCullFace(bool enabled);
void setCullFaceEnabled(bool enabled);
bool isCullFaceEnabled() const;
void setCullMode(GLenum mode);
void setFrontFace(GLenum front);
void setDepthTest(bool enabled);
void setDepthTestEnabled(bool enabled);
bool isDepthTestEnabled() const;
void setDepthFunc(GLenum depthFunc);
void setDepthRange(float zNear, float zFar);
void setBlend(bool enabled);
void setBlendEnabled(bool enabled);
bool isBlendEnabled() const;
void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);
void setBlendColor(float red, float green, float blue, float alpha);
void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation);
void setStencilTest(bool enabled);
void setStencilTestEnabled(bool enabled);
bool isStencilTestEnabled() const;
void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask);
void setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask);
......@@ -402,23 +404,23 @@ public:
void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass);
void setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass);
void setPolygonOffsetFill(bool enabled);
void setPolygonOffsetFillEnabled(bool enabled);
bool isPolygonOffsetFillEnabled() const;
void setPolygonOffsetParams(GLfloat factor, GLfloat units);
void setSampleAlphaToCoverage(bool enabled);
void setSampleAlphaToCoverageEnabled(bool enabled);
bool isSampleAlphaToCoverageEnabled() const;
void setSampleCoverage(bool enabled);
void setSampleCoverageEnabled(bool enabled);
bool isSampleCoverageEnabled() const;
void setSampleCoverageParams(GLclampf value, bool invert);
void setDither(bool enabled);
void setDitherEnabled(bool enabled);
bool isDitherEnabled() const;
void setPrimitiveRestartFixedIndex(bool enabled);
void setPrimitiveRestartFixedIndexEnabled(bool enabled);
bool isPrimitiveRestartFixedIndexEnabled() const;
void setRasterizerDiscard(bool enabled);
void setRasterizerDiscardEnabled(bool enabled);
bool isRasterizerDiscardEnabled() const;
void setLineWidth(GLfloat width);
......@@ -428,7 +430,7 @@ public:
void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
void setScissorTest(bool enabled);
void setScissorTestEnabled(bool enabled);
bool isScissorTestEnabled() const;
void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height);
......@@ -451,7 +453,7 @@ public:
GLuint getArrayBufferName() const;
GLuint getElementArrayBufferName() const;
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled);
void setVertexAttribDivisor(unsigned int attribNum, GLuint divisor);
const VertexAttribute &getVertexAttribState(unsigned int attribNum) const;
void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type,
......
......@@ -1713,17 +1713,17 @@ void Disable(GLenum cap)
{
switch(cap)
{
case GL_CULL_FACE: context->setCullFace(false); break;
case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(false); break;
case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(false); break;
case GL_SAMPLE_COVERAGE: context->setSampleCoverage(false); break;
case GL_SCISSOR_TEST: context->setScissorTest(false); break;
case GL_STENCIL_TEST: context->setStencilTest(false); break;
case GL_DEPTH_TEST: context->setDepthTest(false); break;
case GL_BLEND: context->setBlend(false); break;
case GL_DITHER: context->setDither(false); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(false); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(false); break;
case GL_CULL_FACE: context->setCullFaceEnabled(false); break;
case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(false); break;
case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(false); break;
case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(false); break;
case GL_SCISSOR_TEST: context->setScissorTestEnabled(false); break;
case GL_STENCIL_TEST: context->setStencilTestEnabled(false); break;
case GL_DEPTH_TEST: context->setDepthTestEnabled(false); break;
case GL_BLEND: context->setBlendEnabled(false); break;
case GL_DITHER: context->setDitherEnabled(false); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndexEnabled(false); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscardEnabled(false); break;
default:
return error(GL_INVALID_ENUM);
}
......@@ -1743,7 +1743,7 @@ void DisableVertexAttribArray(GLuint index)
if(context)
{
context->setEnableVertexAttribArray(index, false);
context->setVertexAttribArrayEnabled(index, false);
}
}
......@@ -2058,17 +2058,17 @@ void Enable(GLenum cap)
{
switch(cap)
{
case GL_CULL_FACE: context->setCullFace(true); break;
case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(true); break;
case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(true); break;
case GL_SAMPLE_COVERAGE: context->setSampleCoverage(true); break;
case GL_SCISSOR_TEST: context->setScissorTest(true); break;
case GL_STENCIL_TEST: context->setStencilTest(true); break;
case GL_DEPTH_TEST: context->setDepthTest(true); break;
case GL_BLEND: context->setBlend(true); break;
case GL_DITHER: context->setDither(true); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(true); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(true); break;
case GL_CULL_FACE: context->setCullFaceEnabled(true); break;
case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(true); break;
case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(true); break;
case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(true); break;
case GL_SCISSOR_TEST: context->setScissorTestEnabled(true); break;
case GL_STENCIL_TEST: context->setStencilTestEnabled(true); break;
case GL_DEPTH_TEST: context->setDepthTestEnabled(true); break;
case GL_BLEND: context->setBlendEnabled(true); break;
case GL_DITHER: context->setDitherEnabled(true); break;
case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndexEnabled(true); break;
case GL_RASTERIZER_DISCARD: context->setRasterizerDiscardEnabled(true); break;
default:
return error(GL_INVALID_ENUM);
}
......@@ -2088,7 +2088,7 @@ void EnableVertexAttribArray(GLuint index)
if(context)
{
context->setEnableVertexAttribArray(index, true);
context->setVertexAttribArrayEnabled(index, true);
}
}
......
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