Commit c0aa94dc by Nicolas Capens

Implement GL_PERSPECTIVE_CORRECTION_HINT.

Bug 21278131 Change-Id: I370d9498778ac23c70cdb521aedaf4600bacca15 Reviewed-on: https://swiftshader-review.googlesource.com/3193Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent daf48869
......@@ -83,6 +83,7 @@ Context::Context(const egl::Config *config, const Context *shareContext)
mState.dither = true;
mState.shadeModel = GL_SMOOTH;
mState.generateMipmapHint = GL_DONT_CARE;
mState.perspectiveCorrectionHint = GL_DONT_CARE;
mState.lineWidth = 1.0f;
......@@ -651,6 +652,11 @@ void Context::setGenerateMipmapHint(GLenum hint)
mState.generateMipmapHint = hint;
}
void Context::setPerspectiveCorrectionHint(GLenum hint)
{
mState.perspectiveCorrectionHint = hint;
}
void Context::setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height)
{
mState.viewportX = x;
......@@ -1052,6 +1058,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_PACK_ALIGNMENT: *params = mState.packAlignment; break;
case GL_UNPACK_ALIGNMENT: *params = mState.unpackAlignment; break;
case GL_GENERATE_MIPMAP_HINT: *params = mState.generateMipmapHint; break;
case GL_PERSPECTIVE_CORRECTION_HINT: *params = mState.perspectiveCorrectionHint; break;
case GL_ACTIVE_TEXTURE: *params = (mState.activeSampler + GL_TEXTURE0); break;
case GL_STENCIL_FUNC: *params = mState.stencilFunc; break;
case GL_STENCIL_REF: *params = mState.stencilRef; break;
......
......@@ -221,6 +221,7 @@ struct State
GLfloat lineWidth;
GLenum generateMipmapHint;
GLenum perspectiveCorrectionHint;
GLint viewportX;
GLint viewportY;
......@@ -336,6 +337,7 @@ public:
void setLineWidth(GLfloat width);
void setGenerateMipmapHint(GLenum hint);
void setPerspectiveCorrectionHint(GLenum hint);
void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height);
......
......@@ -2363,6 +2363,9 @@ void Hint(GLenum target, GLenum mode)
case GL_GENERATE_MIPMAP_HINT:
context->setGenerateMipmapHint(mode);
break;
case GL_PERSPECTIVE_CORRECTION_HINT:
context->setPerspectiveCorrectionHint(mode);
break;
default:
return error(GL_INVALID_ENUM);
}
......
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