From b8cec7020725fecca77503514f54034c0efb8439 Mon Sep 17 00:00:00 2001 From: Nicolas Capens Date: Thu, 28 Jan 2016 10:33:54 -0500 Subject: [PATCH] Fix attribute size queries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 26794307 Change-Id: I66a440221435e63574c5da4204a9d2b00ece73f4 Reviewed-on: https://swiftshader-review.googlesource.com/4604 Reviewed-by: Alexis Hétu Reviewed-by: Nicolas Capens Tested-by: Nicolas Capens --- src/OpenGL/libGLES_CM/Context.cpp | 2 ++ src/OpenGL/libGLES_CM/Context.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/OpenGL/libGLES_CM/Context.cpp b/src/OpenGL/libGLES_CM/Context.cpp index f7340df9f..8215077da 100644 --- a/src/OpenGL/libGLES_CM/Context.cpp +++ b/src/OpenGL/libGLES_CM/Context.cpp @@ -1374,6 +1374,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) case GL_POINT_SIZE_ARRAY_TYPE_OES: *params = mState.vertexAttribute[sw::PointSize].mType; break; case GL_POINT_SIZE_ARRAY_STRIDE_OES: *params = mState.vertexAttribute[sw::PointSize].mStride; break; case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: *params = mState.vertexAttribute[sw::PointSize].mBoundBuffer.name(); break; + case GL_VERTEX_ARRAY_SIZE: *params = mState.vertexAttribute[sw::Position].mSize; break; case GL_VERTEX_ARRAY_TYPE: *params = mState.vertexAttribute[sw::Position].mType; break; case GL_VERTEX_ARRAY_STRIDE: *params = mState.vertexAttribute[sw::Position].mStride; break; case GL_VERTEX_ARRAY_BUFFER_BINDING: *params = mState.vertexAttribute[sw::Position].mBoundBuffer.name(); break; @@ -1383,6 +1384,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) case GL_COLOR_ARRAY_TYPE: *params = mState.vertexAttribute[sw::Color0].mType; break; case GL_COLOR_ARRAY_STRIDE: *params = mState.vertexAttribute[sw::Color0].mStride; break; case GL_COLOR_ARRAY_BUFFER_BINDING: *params = mState.vertexAttribute[sw::Color0].mBoundBuffer.name(); break; + case GL_TEXTURE_COORD_ARRAY_SIZE: *params = mState.vertexAttribute[sw::TexCoord0 + mState.activeSampler].mSize; break; case GL_TEXTURE_COORD_ARRAY_TYPE: *params = mState.vertexAttribute[sw::TexCoord0 + mState.activeSampler].mType; break; case GL_TEXTURE_COORD_ARRAY_STRIDE: *params = mState.vertexAttribute[sw::TexCoord0 + mState.activeSampler].mStride; break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: *params = mState.vertexAttribute[sw::TexCoord0 + mState.activeSampler].mBoundBuffer.name(); break; diff --git a/src/OpenGL/libGLES_CM/Context.h b/src/OpenGL/libGLES_CM/Context.h index b41ecb483..9fe810bf2 100644 --- a/src/OpenGL/libGLES_CM/Context.h +++ b/src/OpenGL/libGLES_CM/Context.h @@ -143,7 +143,7 @@ struct Light class VertexAttribute { public: - VertexAttribute() : mType(GL_FLOAT), mSize(0), mNormalized(false), mStride(0), mPointer(NULL), mArrayEnabled(false) + VertexAttribute() : mType(GL_FLOAT), mSize(4), mNormalized(false), mStride(0), mPointer(NULL), mArrayEnabled(false) { mCurrentValue[0] = 0.0f; mCurrentValue[1] = 0.0f; @@ -355,7 +355,7 @@ public: void setLightAttenuationQuadratic(int index, float quadratic); void setSpotLightExponent(int index, float exponent); void setSpotLightCutoff(int index, float cutoff); - + void setGlobalAmbient(float red, float green, float blue, float alpha); void setMaterialAmbient(float red, float green, float blue, float alpha); void setMaterialDiffuse(float red, float green, float blue, float alpha); -- 2.11.0