The spec states that glViewport() silently clamps the viewport
width and height to GL_MAX_VIEWPORT_DIMS[0] and
GL_MAX_VIEWPORT_DIMS[1], respectively.
Bug b/
34078120
Change-Id: Ifeec0d6b601ce8a3825796fa551eea1f46150002
Reviewed-on: https://swiftshader-review.googlesource.com/8371
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
#include <EGL/eglext.h>
+#include <algorithm>
+
namespace es2
{
Context::Context(egl::Display *display, const Context *shareContext, EGLint clientVersion)
{
mState.viewportX = x;
mState.viewportY = y;
- mState.viewportWidth = width;
- mState.viewportHeight = height;
+ mState.viewportWidth = std::min<GLsizei>(width, IMPLEMENTATION_MAX_RENDERBUFFER_SIZE); // GL_MAX_VIEWPORT_DIMS[0]
+ mState.viewportHeight = std::min<GLsizei>(height, IMPLEMENTATION_MAX_RENDERBUFFER_SIZE); // GL_MAX_VIEWPORT_DIMS[1]
}
void Context::setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height)
#include "Shader/PixelShader.hpp"
#include "Shader/VertexShader.hpp"
+#include <algorithm>
#include <string>
#include <stdlib.h>
#include "utilities.h"
#include <string>
+#include <algorithm>
namespace es2
{