mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Added a small workaround for a radeon driver bug.
This commit is contained in:
parent
52d2ba31fd
commit
f2920e40a3
@ -686,6 +686,8 @@ reset() {
|
|||||||
_shader_caps._active_fprofile = (int)cgGLGetLatestProfile(CG_GL_FRAGMENT);
|
_shader_caps._active_fprofile = (int)cgGLGetLatestProfile(CG_GL_FRAGMENT);
|
||||||
_shader_caps._ultimate_vprofile = (int)CG_PROFILE_VP40;
|
_shader_caps._ultimate_vprofile = (int)CG_PROFILE_VP40;
|
||||||
_shader_caps._ultimate_fprofile = (int)CG_PROFILE_FP40;
|
_shader_caps._ultimate_fprofile = (int)CG_PROFILE_FP40;
|
||||||
|
_glBindProgram = (PFNGLBINDPROGRAMARBPROC)
|
||||||
|
get_extension_func(GLPREFIX_QUOTED, "BindProgramARB");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3383,32 +3385,27 @@ do_issue_shader() {
|
|||||||
context = (CLP(ShaderContext) *)(expansion->prepare_now(get_prepared_objects(), this));
|
context = (CLP(ShaderContext) *)(expansion->prepare_now(get_prepared_objects(), this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context == 0 || (context && context -> valid ( ) == false)) {
|
if (context == 0 || (context -> valid ( ) == false)) {
|
||||||
if (_current_shader_context != 0) {
|
if (_current_shader_context != 0) {
|
||||||
_current_shader_context->unbind();
|
_current_shader_context->unbind();
|
||||||
_current_shader_expansion = 0;
|
_current_shader_expansion = 0;
|
||||||
_current_shader_context = 0;
|
_current_shader_context = 0;
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if (context != _current_shader_context) {
|
if (context != _current_shader_context) {
|
||||||
// Use a completely different shader than before.
|
// Use a completely different shader than before.
|
||||||
// Unbind old shader, bind the new one.
|
// Unbind old shader, bind the new one.
|
||||||
if (_current_shader_context != 0) {
|
if (_current_shader_context != 0) {
|
||||||
_current_shader_context->unbind();
|
_current_shader_context->unbind();
|
||||||
_current_shader_context = 0;
|
|
||||||
_current_shader_expansion = 0;
|
|
||||||
}
|
}
|
||||||
if (context != 0) {
|
|
||||||
context->bind(this);
|
context->bind(this);
|
||||||
_current_shader_expansion = expansion;
|
_current_shader_expansion = expansion;
|
||||||
_current_shader_context = context;
|
_current_shader_context = context;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Use the same shader as before, but with new input arguments.
|
// Use the same shader as before, but with new input arguments.
|
||||||
context->issue_parameters(this, true);
|
context->issue_parameters(this, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
report_my_gl_errors();
|
report_my_gl_errors();
|
||||||
}
|
}
|
||||||
@ -6061,6 +6058,12 @@ update_standard_texture_bindings() {
|
|||||||
if (_supports_cube_map) {
|
if (_supports_cube_map) {
|
||||||
GLP(Disable)(GL_TEXTURE_CUBE_MAP);
|
GLP(Disable)(GL_TEXTURE_CUBE_MAP);
|
||||||
}
|
}
|
||||||
|
// This shouldn't be necessary, but a bug in the radeon
|
||||||
|
// driver makes it so.
|
||||||
|
glDisable(GL_TEXTURE_GEN_R);
|
||||||
|
glDisable(GL_TEXTURE_GEN_S);
|
||||||
|
glDisable(GL_TEXTURE_GEN_T);
|
||||||
|
glDisable(GL_TEXTURE_GEN_Q);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the count of texture stages for next time.
|
// Save the count of texture stages for next time.
|
||||||
@ -6088,6 +6091,12 @@ disable_standard_texture_bindings() {
|
|||||||
if (_supports_cube_map) {
|
if (_supports_cube_map) {
|
||||||
GLP(Disable)(GL_TEXTURE_CUBE_MAP);
|
GLP(Disable)(GL_TEXTURE_CUBE_MAP);
|
||||||
}
|
}
|
||||||
|
// This shouldn't be necessary, but a bug in the radeon
|
||||||
|
// driver makes it so.
|
||||||
|
glDisable(GL_TEXTURE_GEN_R);
|
||||||
|
glDisable(GL_TEXTURE_GEN_S);
|
||||||
|
glDisable(GL_TEXTURE_GEN_T);
|
||||||
|
glDisable(GL_TEXTURE_GEN_Q);
|
||||||
}
|
}
|
||||||
|
|
||||||
_num_active_texture_stages = 0;
|
_num_active_texture_stages = 0;
|
||||||
|
@ -66,6 +66,7 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, const GLfloat
|
|||||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||||
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||||
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
|
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
|
||||||
|
typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
|
||||||
typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
||||||
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||||
typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
|
typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
|
||||||
@ -442,6 +443,7 @@ public:
|
|||||||
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC _glFramebufferRenderbuffer;
|
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC _glFramebufferRenderbuffer;
|
||||||
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC _glGetFramebufferAttachmentParameteriv;
|
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC _glGetFramebufferAttachmentParameteriv;
|
||||||
PFNGLGENERATEMIPMAPEXTPROC _glGenerateMipmap;
|
PFNGLGENERATEMIPMAPEXTPROC _glGenerateMipmap;
|
||||||
|
PFNGLBINDPROGRAMARBPROC _glBindProgram;
|
||||||
|
|
||||||
PFNGLDRAWBUFFERSPROC _glDrawBuffers;
|
PFNGLDRAWBUFFERSPROC _glDrawBuffers;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user