VOGL_CHECK_GL_ERROR;
m_max_vertex_attribs = vogl_get_gl_integer(GL_MAX_VERTEX_ATTRIBS);
- m_max_texture_coords = vogl_get_gl_integer(GL_MAX_TEXTURE_COORDS);
- m_max_texture_units = vogl_get_gl_integer(GL_MAX_TEXTURE_UNITS);
+ VOGL_CHECK_GL_ERROR;
+
+ m_max_texture_coords = is_core_profile() ? 0 : vogl_get_gl_integer(GL_MAX_TEXTURE_COORDS);
+ VOGL_CHECK_GL_ERROR;
+
+ m_max_texture_units = is_core_profile() ? 0 : vogl_get_gl_integer(GL_MAX_TEXTURE_UNITS);
+ VOGL_CHECK_GL_ERROR;
+
m_max_texture_image_units = vogl_get_gl_integer(GL_MAX_TEXTURE_IMAGE_UNITS);
+ VOGL_CHECK_GL_ERROR;
+
m_max_combined_texture_coords = vogl_get_gl_integer(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ VOGL_CHECK_GL_ERROR;
+
m_max_draw_buffers = (get_version() >= VOGL_GL_VERSION_2_0) ? vogl_get_gl_integer(GL_MAX_DRAW_BUFFERS) : 0;
+ VOGL_CHECK_GL_ERROR;
+
m_max_lights = is_core_profile() ? 0 : vogl_get_gl_integer(GL_MAX_LIGHTS);
+ VOGL_CHECK_GL_ERROR;
+
m_max_uniform_buffer_bindings = vogl_get_gl_integer(GL_MAX_UNIFORM_BUFFER_BINDINGS);
- m_max_transform_feedback_separate_attribs = (get_version() >= VOGL_GL_VERSION_3_0) ? vogl_get_gl_integer(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS) : 0;
+ VOGL_CHECK_GL_ERROR;
+ m_max_transform_feedback_separate_attribs = (get_version() >= VOGL_GL_VERSION_3_0) ? vogl_get_gl_integer(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS) : 0;
VOGL_CHECK_GL_ERROR;
if (!is_core_profile() && supports_extension("GL_ARB_vertex_program") && GL_ENTRYPOINT(glGetProgramivARB))
{
return m_max_vertex_attribs;
}
+
+ // compat only - will be 0 in core
uint get_max_texture_coords() const
{
return m_max_texture_coords;
}
+ // compat only - will be 0 in core
uint get_max_texture_units() const
{
return m_max_texture_units;
m_can_use_glGetPointerv = (GL_ENTRYPOINT(glGetPointerv) != NULL) && !context_info.is_core_profile();
m_max_texture_units = 0;
- GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_TEXTURE_UNITS, &m_max_texture_units);
-
m_max_texture_coords = 0;
- GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_TEXTURE_COORDS, &m_max_texture_coords);
+
+ if (!context_info.is_core_profile())
+ {
+ GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_TEXTURE_UNITS, &m_max_texture_units);
+ GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_TEXTURE_COORDS, &m_max_texture_coords);
+ }
m_max_combined_texture_coords = 0;
GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &m_max_combined_texture_coords);
m_max_vertex_attribs = 0;
GL_ENTRYPOINT(glGetIntegerv)(GL_MAX_VERTEX_ATTRIBS, &m_max_vertex_attribs);
+
+ VOGL_CHECK_GL_ERROR;
}
bool m_can_use_glGetBooleani_v;
#endif
GLint prev_client_active_texture = 0;
- GL_ENTRYPOINT(glGetIntegerv)(GL_CLIENT_ACTIVE_TEXTURE, &prev_client_active_texture);
+ if (!context_info.is_core_profile())
+ {
+ GL_ENTRYPOINT(glGetIntegerv)(GL_CLIENT_ACTIVE_TEXTURE, &prev_client_active_texture);
+ }
GLint prev_active_texture = 0;
GL_ENTRYPOINT(glGetIntegerv)(GL_ACTIVE_TEXTURE, &prev_active_texture);
GLenum image_fmt = pInternal_tex_fmt->m_optimum_get_image_fmt;
GLenum image_type = pInternal_tex_fmt->m_optimum_get_image_type;
+#if 0
+ // OK, I can't retrive the default framebuffer's depth/stencil buffer on AMD - all I get is INVALID_OPERATION. Crap. This works fine on NV though.
+ // This workaround didn't work.
+ if (internal_fmt == GL_DEPTH_STENCIL)
+ {
+ if (GL_ENTRYPOINT(glGetInternalformativ) && context_info.supports_extension("GL_ARB_internalformat_query"))
+ {
+ GL_ENTRYPOINT(glGetInternalformativ)(GL_TEXTURE_2D, internal_fmt, GL_GET_TEXTURE_IMAGE_FORMAT, sizeof(image_fmt), (GLint *)&image_fmt);
+ VOGL_CHECK_GL_ERROR;
+
+ GL_ENTRYPOINT(glGetInternalformativ)(GL_TEXTURE_2D, internal_fmt, GL_GET_TEXTURE_IMAGE_TYPE, sizeof(image_type), (GLint *)&image_type);
+ VOGL_CHECK_GL_ERROR;
+ }
+ }
+#endif
+
uint num_faces = 1;
GLenum ktx_image_fmt = GL_NONE, ktx_image_type = GL_NONE;
{
VOGL_ASSERT(!size_in_bytes);
- size_t size_in_bytes64 = vogl_get_image_size(pInternal_tex_fmt->m_optimum_get_image_fmt, pInternal_tex_fmt->m_optimum_get_image_type, level_width, level_height, level_depth);
+ size_t size_in_bytes64 = vogl_get_image_size(image_fmt, image_type, level_width, level_height, level_depth);
if (!size_in_bytes64)
{
vogl_error_printf("%s: Failed computing image size of face %u level %u, texture %" PRIu64 " target %s\n", VOGL_METHOD_NAME, face, level, (uint64_t)handle, g_gl_enums.find_gl_name(m_target));
}
else
{
- GL_ENTRYPOINT(glGetTexImage)(get_target, level, pInternal_tex_fmt->m_optimum_get_image_fmt, pInternal_tex_fmt->m_optimum_get_image_type, temp_img.get_ptr());
+ GL_ENTRYPOINT(glGetTexImage)(get_target, level, image_fmt, image_type, temp_img.get_ptr());
}
if (vogl_check_gl_error())
if ((get_num_faces() == 6) && ((m_header.m_pixelDepth) || (!m_header.m_pixelHeight)))
return false;
+#if 0
if (m_header.m_numberOfMipmapLevels)
{
const uint max_mipmap_dimension = 1U << (m_header.m_numberOfMipmapLevels - 1U);
if (max_mipmap_dimension > (VOGL_MAX(VOGL_MAX(m_header.m_pixelWidth, m_header.m_pixelHeight), m_header.m_pixelDepth)))
return false;
}
+#endif
return true;
}
{
return m_context_info.get_max_texture_coords();
}
+
+ // compat only - will be 0 in core
inline GLuint get_max_texture_units() const
{
return m_context_info.get_max_texture_units();