Bug 1170855 - Part B: READ_BUFFER requires emulation for default FB. r=jgilbert

WebGL internals use framebuffers to implement the default
framebuffer. This means that we can't just return the result from
glGetIntegerv(GL_READ_BUFFER, ...)
This commit is contained in:
Dan Glastonbury 2015-06-09 10:40:56 +10:00
parent a469847ff6
commit 03a6165d30

View File

@ -38,8 +38,17 @@ WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
}
/* GLenum */
case LOCAL_GL_READ_BUFFER: {
if (mBoundReadFramebuffer) {
GLint val = LOCAL_GL_NONE;
gl->fGetIntegerv(pname, &val);
return JS::Int32Value(val);
}
return JS::Int32Value(LOCAL_GL_BACK);
}
case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT:
case LOCAL_GL_READ_BUFFER:
/* fall through */
/* GLint */