Commit e1bb74e7 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: Ib7625cb12faeac21016a9ff551aa650ba24e789f Reviewed-on: https://chromium-review.googlesource.com/277692Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 54480961
......@@ -100,6 +100,20 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mFramebuffers[GL_READ_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)
......
......@@ -429,6 +429,7 @@
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
#define GL_POINT_SPRITE 0x8861
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
#define GL_SAMPLER_1D 0x8B5D
#define GL_SAMPLER_1D_SHADOW 0x8B61
......
......@@ -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->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->maxAliasedLineWidth = QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 1); // GL 1.2 / ES 2.0
......
......@@ -431,4 +431,12 @@ TEST_P(PointSpritesTest, PointSizeDeclaredButUnused)
// We test on D3D11 9_3 because the existing D3D11 PointSprite implementation
// uses Geometry Shaders which are not supported for 9_3.
// D3D9 and D3D11 are also tested to ensure no regressions.
ANGLE_INSTANTIATE_TEST(PointSpritesTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3());
ANGLE_INSTANTIATE_TEST(PointSpritesTest,
ES2_D3D9(),
ES2_D3D11(),
ES2_D3D11_FL9_3(),
ES2_OPENGL(),
ES3_OPENGL(),
ES2_OPENGL(3, 1),
ES2_OPENGL(3, 2),
ES2_OPENGL(3, 3));
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