A few glgsg fixes from tobspr

This commit is contained in:
rdb 2016-03-02 16:24:38 +01:00
parent d50a326ca7
commit 711c97ad6d
2 changed files with 10 additions and 5 deletions

View File

@ -169,7 +169,7 @@ static const string default_fshader =
"#version 130\n" "#version 130\n"
"in vec2 texcoord;\n" "in vec2 texcoord;\n"
"in vec4 color;\n" "in vec4 color;\n"
"out vec4 p3d_FragColor;" "out vec4 p3d_FragColor;\n"
"uniform sampler2D p3d_Texture0;\n" "uniform sampler2D p3d_Texture0;\n"
"uniform vec4 p3d_TexAlphaOnly;\n" "uniform vec4 p3d_TexAlphaOnly;\n"
#else #else
@ -2518,7 +2518,7 @@ reset() {
if (core_profile) { if (core_profile) {
// TODO: better detection mechanism? // TODO: better detection mechanism?
_supports_stencil = true; _supports_stencil = support_stencil;
} }
#ifdef SUPPORT_FIXED_FUNCTION #ifdef SUPPORT_FIXED_FUNCTION
else if (support_stencil) { else if (support_stencil) {
@ -2989,7 +2989,7 @@ clear(DrawableRegion *clearable) {
mask |= GL_DEPTH_BUFFER_BIT; mask |= GL_DEPTH_BUFFER_BIT;
} }
if (clearable->get_clear_stencil_active()) { if (_supports_stencil && clearable->get_clear_stencil_active()) {
glStencilMask(~0); glStencilMask(~0);
glClearStencil(clearable->get_clear_stencil()); glClearStencil(clearable->get_clear_stencil());
mask |= GL_STENCIL_BUFFER_BIT; mask |= GL_STENCIL_BUFFER_BIT;
@ -4817,6 +4817,7 @@ update_texture(TextureContext *tc, bool force) {
if (gtc->was_properties_modified()) { if (gtc->was_properties_modified()) {
specify_texture(gtc, tex->get_default_sampler()); specify_texture(gtc, tex->get_default_sampler());
} }
bool okflag = upload_texture(gtc, force, tex->uses_mipmaps()); bool okflag = upload_texture(gtc, force, tex->uses_mipmaps());
if (!okflag) { if (!okflag) {
GLCAT.error() GLCAT.error()
@ -6238,7 +6239,9 @@ do_issue_render_mode() {
} }
report_my_gl_errors(); report_my_gl_errors();
#ifdef SUPPORT_FIXED_FUNCTION
do_point_size(); do_point_size();
#endif
} }
/** /**
@ -12703,9 +12706,9 @@ extract_texture_image(PTA_uchar &image, size_t &page_size,
* Internally sets the point size parameters after any of the properties have * Internally sets the point size parameters after any of the properties have
* changed that might affect this. * changed that might affect this.
*/ */
#ifdef SUPPORT_FIXED_FUNCTION
void CLP(GraphicsStateGuardian):: void CLP(GraphicsStateGuardian)::
do_point_size() { do_point_size() {
#ifndef OPENGLES_2
if (!_point_perspective) { if (!_point_perspective) {
// Normal, constant-sized points. Here _point_size is a width in pixels. // Normal, constant-sized points. Here _point_size is a width in pixels.
static LVecBase3f constant(1.0f, 0.0f, 0.0f); static LVecBase3f constant(1.0f, 0.0f, 0.0f);
@ -12735,8 +12738,8 @@ do_point_size() {
} }
report_my_gl_errors(); report_my_gl_errors();
#endif
} }
#endif
/** /**
* Returns true if this particular GSG supports the specified Cg Shader * Returns true if this particular GSG supports the specified Cg Shader

View File

@ -567,7 +567,9 @@ protected:
Texture::ComponentType type, Texture::ComponentType type,
Texture::CompressionMode compression, int n); Texture::CompressionMode compression, int n);
#ifdef SUPPORT_FIXED_FUNCTION
void do_point_size(); void do_point_size();
#endif
enum AutoAntialiasMode { enum AutoAntialiasMode {
AA_poly, AA_poly,