|
@@ -77,6 +77,7 @@ PStatCollector CLP(GraphicsStateGuardian)::_load_display_list_pcollector("Draw:T
|
|
|
PStatCollector CLP(GraphicsStateGuardian)::_primitive_batches_display_list_pcollector("Primitive batches:Display lists");
|
|
PStatCollector CLP(GraphicsStateGuardian)::_primitive_batches_display_list_pcollector("Primitive batches:Display lists");
|
|
|
PStatCollector CLP(GraphicsStateGuardian)::_vertices_display_list_pcollector("Vertices:Display lists");
|
|
PStatCollector CLP(GraphicsStateGuardian)::_vertices_display_list_pcollector("Vertices:Display lists");
|
|
|
PStatCollector CLP(GraphicsStateGuardian)::_vertices_immediate_pcollector("Vertices:Immediate mode");
|
|
PStatCollector CLP(GraphicsStateGuardian)::_vertices_immediate_pcollector("Vertices:Immediate mode");
|
|
|
|
|
+PStatCollector CLP(GraphicsStateGuardian)::_compute_dispatch_pcollector("Draw:Compute dispatch");
|
|
|
|
|
|
|
|
#ifdef OPENGLES_2
|
|
#ifdef OPENGLES_2
|
|
|
PT(Shader) CLP(GraphicsStateGuardian)::_default_shader = NULL;
|
|
PT(Shader) CLP(GraphicsStateGuardian)::_default_shader = NULL;
|
|
@@ -480,9 +481,9 @@ reset() {
|
|
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- GLCAT.error() << "gl-debug enabled.\n";
|
|
|
|
|
|
|
+ GLCAT.debug() << "gl-debug enabled.\n";
|
|
|
} else {
|
|
} else {
|
|
|
- GLCAT.error() << "gl-debug enabled, but NOT supported.\n";
|
|
|
|
|
|
|
+ GLCAT.debug() << "gl-debug enabled, but NOT supported.\n";
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
GLCAT.debug() << "gl-debug NOT enabled.\n";
|
|
GLCAT.debug() << "gl-debug NOT enabled.\n";
|
|
@@ -1705,12 +1706,16 @@ reset() {
|
|
|
if (is_at_least_gl_version(4, 2) || has_extension("GL_ARB_shader_image_load_store")) {
|
|
if (is_at_least_gl_version(4, 2) || has_extension("GL_ARB_shader_image_load_store")) {
|
|
|
_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)
|
|
_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)
|
|
|
get_extension_func("glBindImageTexture");
|
|
get_extension_func("glBindImageTexture");
|
|
|
|
|
+ _glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)
|
|
|
|
|
+ get_extension_func("glMemoryBarrier");
|
|
|
|
|
|
|
|
glGetIntegerv(GL_MAX_IMAGE_UNITS, &_max_image_units);
|
|
glGetIntegerv(GL_MAX_IMAGE_UNITS, &_max_image_units);
|
|
|
|
|
|
|
|
} else if (has_extension("GL_EXT_shader_image_load_store")) {
|
|
} else if (has_extension("GL_EXT_shader_image_load_store")) {
|
|
|
_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)
|
|
_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)
|
|
|
get_extension_func("glBindImageTextureEXT");
|
|
get_extension_func("glBindImageTextureEXT");
|
|
|
|
|
+ _glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)
|
|
|
|
|
+ get_extension_func("glMemoryBarrierEXT");
|
|
|
|
|
|
|
|
glGetIntegerv(GL_MAX_IMAGE_UNITS_EXT, &_max_image_units);
|
|
glGetIntegerv(GL_MAX_IMAGE_UNITS_EXT, &_max_image_units);
|
|
|
}
|
|
}
|
|
@@ -1730,6 +1735,19 @@ reset() {
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#ifndef OPENGLES
|
|
|
|
|
+ _supports_get_program_binary = false;
|
|
|
|
|
+
|
|
|
|
|
+ if (is_at_least_gl_version(4, 1) || has_extension("GL_ARB_get_program_binary")) {
|
|
|
|
|
+ _glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)
|
|
|
|
|
+ get_extension_func("glGetProgramBinary");
|
|
|
|
|
+
|
|
|
|
|
+ if (_glGetProgramBinary != NULL) {
|
|
|
|
|
+ _supports_get_program_binary = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
report_my_gl_errors();
|
|
report_my_gl_errors();
|
|
|
|
|
|
|
|
if (support_stencil) {
|
|
if (support_stencil) {
|
|
@@ -4333,9 +4351,12 @@ end_occlusion_query() {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void CLP(GraphicsStateGuardian)::
|
|
void CLP(GraphicsStateGuardian)::
|
|
|
dispatch_compute(int num_groups_x, int num_groups_y, int num_groups_z) {
|
|
dispatch_compute(int num_groups_x, int num_groups_y, int num_groups_z) {
|
|
|
|
|
+ PStatTimer timer(_compute_dispatch_pcollector);
|
|
|
nassertv(_supports_compute_shaders);
|
|
nassertv(_supports_compute_shaders);
|
|
|
nassertv(_current_shader_context != NULL);
|
|
nassertv(_current_shader_context != NULL);
|
|
|
_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
|
|
_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
|
|
|
|
|
+
|
|
|
|
|
+ maybe_gl_finish();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -8987,6 +9008,11 @@ specify_texture(CLP(TextureContext) *gtc) {
|
|
|
glTexParameteri(target, GL_TEXTURE_MAG_FILTER,
|
|
glTexParameteri(target, GL_TEXTURE_MAG_FILTER,
|
|
|
get_texture_filter_type(magfilter, true));
|
|
get_texture_filter_type(magfilter, true));
|
|
|
|
|
|
|
|
|
|
+ if (!uses_mipmaps) {
|
|
|
|
|
+ // NVIDIA drivers complain if we don't do this.
|
|
|
|
|
+ glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Set anisotropic filtering.
|
|
// Set anisotropic filtering.
|
|
|
if (_supports_anisotropy) {
|
|
if (_supports_anisotropy) {
|
|
|
PN_stdfloat anisotropy = tex->get_effective_anisotropic_degree();
|
|
PN_stdfloat anisotropy = tex->get_effective_anisotropic_degree();
|