Commit b8cec702 by Nicolas Capens

Fix attribute size queries.

Bug 26794307 Change-Id: I66a440221435e63574c5da4204a9d2b00ece73f4 Reviewed-on: https://swiftshader-review.googlesource.com/4604Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 6abe1cbc
...@@ -1374,6 +1374,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) ...@@ -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_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_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_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_TYPE: *params = mState.vertexAttribute[sw::Position].mType; break;
case GL_VERTEX_ARRAY_STRIDE: *params = mState.vertexAttribute[sw::Position].mStride; 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; 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) ...@@ -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_TYPE: *params = mState.vertexAttribute[sw::Color0].mType; break;
case GL_COLOR_ARRAY_STRIDE: *params = mState.vertexAttribute[sw::Color0].mStride; 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_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_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_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; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: *params = mState.vertexAttribute[sw::TexCoord0 + mState.activeSampler].mBoundBuffer.name(); break;
......
...@@ -143,7 +143,7 @@ struct Light ...@@ -143,7 +143,7 @@ struct Light
class VertexAttribute class VertexAttribute
{ {
public: 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[0] = 0.0f;
mCurrentValue[1] = 0.0f; mCurrentValue[1] = 0.0f;
...@@ -355,7 +355,7 @@ public: ...@@ -355,7 +355,7 @@ public:
void setLightAttenuationQuadratic(int index, float quadratic); void setLightAttenuationQuadratic(int index, float quadratic);
void setSpotLightExponent(int index, float exponent); void setSpotLightExponent(int index, float exponent);
void setSpotLightCutoff(int index, float cutoff); void setSpotLightCutoff(int index, float cutoff);
void setGlobalAmbient(float red, float green, float blue, float alpha); void setGlobalAmbient(float red, float green, float blue, float alpha);
void setMaterialAmbient(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); void setMaterialDiffuse(float red, float green, float blue, float alpha);
......
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