Merge pull request #2054 from jpark37/opengl-version

libobs-opengl: Require OpenGL 3.3 instead of 3.2
This commit is contained in:
Jim authored and GitHub committed 2019-10-12 16:40:18 -07:00
commit 0f541aa285
4 files changed
+43 -43

No files matched your search

+1 -1
View File
@@ -692,7 +692,7 @@ static bool gl_shader_buildstring(struct gl_shader_parser *glsp)
return false;
}
dstr_copy(&glsp->gl_string, "#version 150\n\n");
dstr_copy(&glsp->gl_string, "#version 330\n\n");
dstr_cat(&glsp->gl_string, "const bool obs_glsl_compile = true;\n\n");
gl_write_params(glsp);
gl_write_inputs(glsp, main_func);
+15 -17
View File
@@ -130,23 +130,15 @@ static void gl_enable_debug() {}
static bool gl_init_extensions(struct gs_device *device)
{
if (!GLAD_GL_VERSION_2_1) {
blog(LOG_ERROR, "obs-studio requires OpenGL version 2.1 or "
"higher.");
if (!GLAD_GL_VERSION_3_3) {
blog(LOG_ERROR,
"obs-studio requires OpenGL version 3.3 or higher.");
return false;
}
gl_enable_debug();
if (!GLAD_GL_VERSION_3_0 && !GLAD_GL_ARB_framebuffer_object) {
blog(LOG_ERROR, "OpenGL extension ARB_framebuffer_object "
"is required.");
return false;
}
if (GLAD_GL_VERSION_3_2 || GLAD_GL_ARB_seamless_cube_map) {
gl_enable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
}
gl_enable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
if (GLAD_GL_VERSION_4_3 || GLAD_GL_ARB_copy_image)
device->copy_type = COPY_TYPE_ARB;
@@ -182,8 +174,11 @@ void convert_sampler_info(struct gs_sampler_state *sampler,
sampler->max_anisotropy = info->max_anisotropy;
max_anisotropy_max = 1;
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy_max);
gl_success("glGetIntegerv(GL_MAX_TEXTURE_ANISOTROPY_MAX)");
if (GLAD_GL_EXT_texture_filter_anisotropic) {
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
&max_anisotropy_max);
gl_success("glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)");
}
if (1 <= sampler->max_anisotropy &&
sampler->max_anisotropy <= max_anisotropy_max)
@@ -475,9 +470,12 @@ static bool load_texture_sampler(gs_texture_t *tex, gs_samplerstate_t *ss)
success = false;
if (!gl_tex_param_i(tex->gl_target, GL_TEXTURE_WRAP_R, ss->address_w))
success = false;
if (!gl_tex_param_i(tex->gl_target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
ss->max_anisotropy))
success = false;
if (GLAD_GL_EXT_texture_filter_anisotropic) {
if (!gl_tex_param_i(tex->gl_target,
GL_TEXTURE_MAX_ANISOTROPY_EXT,
ss->max_anisotropy))
success = false;
}
apply_swizzle(tex);
+26 -24
View File
@@ -154,35 +154,37 @@ static inline HGLRC gl_init_basic_context(HDC hdc)
return hglrc;
}
static const int attribs[] = {
#ifdef _DEBUG
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
#endif
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, 0, 0};
static inline HGLRC gl_init_context(HDC hdc)
{
static const int attribs[] = {
#ifdef _DEBUG
if (GLAD_WGL_ARB_create_context) {
HGLRC hglrc = wglCreateContextAttribsARB(hdc, 0, attribs);
if (!hglrc) {
blog(LOG_ERROR,
"wglCreateContextAttribsARB failed, "
"%lu",
GetLastError());
return NULL;
}
if (!wgl_make_current(hdc, hglrc)) {
wglDeleteContext(hglrc);
return NULL;
}
return hglrc;
}
WGL_CONTEXT_FLAGS_ARB,
WGL_CONTEXT_DEBUG_BIT_ARB,
#endif
WGL_CONTEXT_PROFILE_MASK_ARB,
WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
WGL_CONTEXT_MAJOR_VERSION_ARB,
3,
WGL_CONTEXT_MINOR_VERSION_ARB,
3,
0,
0};
return gl_init_basic_context(hdc);
HGLRC hglrc = wglCreateContextAttribsARB(hdc, 0, attribs);
if (!hglrc) {
blog(LOG_ERROR,
"wglCreateContextAttribsARB failed, "
"%lu",
GetLastError());
return NULL;
}
if (!wgl_make_current(hdc, hglrc)) {
wglDeleteContext(hglrc);
return NULL;
}
return hglrc;
}
static bool gl_dummy_context_init(struct dummy_context *dummy)
+1 -1
View File
@@ -50,7 +50,7 @@ static const int ctx_attribs[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB,
3,
GLX_CONTEXT_MINOR_VERSION_ARB,
2,
3,
None,
};