Add flag enabling vertex shader control over point size

This commit is contained in:
rdb 2015-10-17 12:11:11 +02:00
parent ebd1fd8462
commit aca077916d
3 changed files with 22 additions and 0 deletions

View File

@ -374,6 +374,10 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) :
_white_texture = 0;
#ifndef OPENGLES
_shader_point_size = false;
#endif
#ifdef HAVE_CG
_cg_context = 0;
#endif
@ -6016,6 +6020,19 @@ do_issue_shader() {
}
}
#ifndef OPENGLES
// Is the point size provided by the shader or by OpenGL?
bool shader_point_size = _target_shader->get_flag(ShaderAttrib::F_shader_point_size);
if (shader_point_size != _shader_point_size) {
if (shader_point_size) {
glEnable(GL_PROGRAM_POINT_SIZE);
} else {
glDisable(GL_PROGRAM_POINT_SIZE);
}
_shader_point_size = shader_point_size;
}
#endif
report_my_gl_errors();
}
#endif // !OPENGLES_1

View File

@ -608,6 +608,10 @@ protected:
ShaderContext *_texture_binding_shader_context;
static PT(Shader) _default_shader;
#ifndef OPENGLES
bool _shader_point_size;
#endif
#endif
#ifdef HAVE_CG

View File

@ -49,6 +49,7 @@ PUBLISHED:
F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel.
F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL
F_hardware_skinning = 2, // Shader needs pre-animated vertices
F_shader_point_size = 3, // Shader provides point size, not RenderModeAttrib
};
INLINE bool has_shader() const;