Commit eec431c7 by Geoff Lang

Enable point sprites in StateManagerGL.

Test it against multiple versions of the OpenGL renderer so make sure that both core and compatibility profile are tested. Fixes: * conformance/rendering/point-size.html * conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html * PointSpritesTest * particle_system sample BUG=angleproject:883 Change-Id: I31f1c3d9bee1d191b4d731afbaa2d6de1a5c9454 Reviewed-on: https://chromium-review.googlesource.com/287855Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 3cca86b5
...@@ -100,6 +100,20 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren ...@@ -100,6 +100,20 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mFramebuffers[GL_READ_FRAMEBUFFER] = 0; mFramebuffers[GL_READ_FRAMEBUFFER] = 0;
mFramebuffers[GL_DRAW_FRAMEBUFFER] = 0; mFramebuffers[GL_DRAW_FRAMEBUFFER] = 0;
// Initialize point sprite state for desktop GL
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
mFunctions->enable(GL_PROGRAM_POINT_SIZE);
// GL_POINT_SPRITE was deprecated in the core profile. Point rasterization is always
// performed
// as though POINT_SPRITE were enabled.
if ((mFunctions->profile & GL_CONTEXT_CORE_PROFILE_BIT) == 0)
{
mFunctions->enable(GL_POINT_SPRITE);
}
}
} }
void StateManagerGL::deleteProgram(GLuint program) void StateManagerGL::deleteProgram(GLuint program)
......
...@@ -429,6 +429,7 @@ ...@@ -429,6 +429,7 @@
#define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
#define GL_POINT_SPRITE 0x8861
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
#define GL_SAMPLER_1D 0x8B5D #define GL_SAMPLER_1D 0x8B5D
#define GL_SAMPLER_1D_SHADOW 0x8B61 #define GL_SAMPLER_1D_SHADOW 0x8B61
......
...@@ -226,8 +226,21 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM ...@@ -226,8 +226,21 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
caps->maxViewportWidth = QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 0); // GL 1.0 / ES 2.0 caps->maxViewportWidth = QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 0); // GL 1.0 / ES 2.0
caps->maxViewportHeight = QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 1); // GL 1.0 / ES 2.0 caps->maxViewportHeight = QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 1); // GL 1.0 / ES 2.0
caps->minAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0);
caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 1); if (functions->standard == STANDARD_GL_DESKTOP &&
(functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
{
// Desktop GL core profile deprecated the GL_ALIASED_POINT_SIZE_RANGE query. Use
// GL_POINT_SIZE_RANGE instead.
caps->minAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 0);
caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 1);
}
else
{
caps->minAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0);
caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 1);
}
caps->minAliasedLineWidth = QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 0); // GL 1.2 / ES 2.0 caps->minAliasedLineWidth = QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 0); // GL 1.2 / ES 2.0
caps->maxAliasedLineWidth = QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 1); // GL 1.2 / ES 2.0 caps->maxAliasedLineWidth = QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 1); // GL 1.2 / ES 2.0
......
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