Commit 681ef0ce authored by Libretro-Admin's avatar Libretro-Admin
Browse files

(windows/Linux) GL 3.0 core profile context is used now

parent efbc461c
......@@ -8,6 +8,7 @@ NO_EXCEPTIONS := 0
NO_NVMEM := 0
NO_VERIFY := 1
HAVE_GENERIC_JIT := 1
HAVE_GL3 := 0
FORCE_GLES := 0
STATIC_LINKING:= 0
......@@ -111,7 +112,9 @@ ifneq (,$(findstring Haiku,$(shell uname -s)))
else
LIBS += -lrt
endif
ifneq ($(HAVE_OIT), 1)
HAVE_GL3 = 1
endif
fpic = -fPIC
ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64))
......@@ -378,6 +381,9 @@ else ifeq ($(platform), emscripten)
# Windows
else
ifneq ($(HAVE_OIT), 1)
HAVE_GL3 = 1
endif
EXT ?= dll
HAVE_GENERIC_JIT = 0
TARGET := $(TARGET_NAME)_libretro.$(EXT)
......@@ -418,7 +424,6 @@ ifeq ($(ARM_FLOAT_ABI_HARD),1)
CFLAGS += -DARM_HARDFP
endif
ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64))
HOST_CPU_FLAGS = -DHOST_CPU=$(HOST_CPU_X64)
endif
......@@ -473,6 +478,15 @@ endif
CORE_DEFINES += -DRELEASE
endif
ifeq ($(HAVE_GL3), 1)
HAVE_CORE = 1
CORE_DEFINES += -DHAVE_GL3
endif
ifeq ($(HAVE_CORE), 1)
CORE_DEFINES += -DCORE
endif
RZDCY_CFLAGS += $(CFLAGS) -c $(OPTFLAGS) -frename-registers -ffast-math -ftree-vectorize -fomit-frame-pointer
ifeq ($(WITH_DYNAREC), arm)
......@@ -511,7 +525,7 @@ CORE_DEFINES += -funroll-loops
endif
ifeq ($(HAVE_OIT), 1)
CORE_DEFINES += -DHAVE_OIT
CORE_DEFINES += -DHAVE_OIT -DHAVE_GL4
endif
ifeq ($(HAVE_GL), 1)
......@@ -522,10 +536,6 @@ ifeq ($(HAVE_GL), 1)
endif
endif
ifeq ($(HAVE_CORE), 1)
CORE_DEFINES += -DCORE
endif
ifeq ($(DEBUG), 1)
HAVE_GENERIC_JIT = 0
endif
......
......@@ -2818,8 +2818,13 @@ static bool glsm_state_ctx_init(void *data)
#else
#ifdef CORE
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE;
#ifdef HAVE_GL3
hw_render.version_major = 3;
hw_render.version_minor = 0;
#else
hw_render.version_major = 4;
hw_render.version_minor = 3;
#endif
#else
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
#endif
......
......@@ -666,6 +666,10 @@ void SetMVS_Mode(ModifierVolumeMode mv_mode, ISP_Modvol ispc)
void SetupMainVBO(void)
{
#if !defined(GLES) && defined(HAVE_GL3)
glBindVertexArray(gl.vbo.vao);
#endif
glBindBuffer(GL_ARRAY_BUFFER, gl.vbo.geometry);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gl.vbo.idxs);
......@@ -685,6 +689,10 @@ void SetupMainVBO(void)
static void SetupModvolVBO(void)
{
#if !defined(GLES) && defined(HAVE_GL3)
glBindVertexArray(gl.vbo.vao);
#endif
glBindBuffer(GL_ARRAY_BUFFER, gl.vbo.modvols);
//setup vertex buffers attrib pointers
......
......@@ -447,6 +447,10 @@ static void gl_term(void)
glDeleteBuffers(1, &gl.vbo.idxs);
glDeleteBuffers(1, &gl.vbo.idxs2);
#if !defined(GLES) && defined(HAVE_GL3)
glDeleteVertexArrays(1, &gl.vbo.vao);
#endif
memset(gl.program_table,0,sizeof(gl.program_table));
}
......@@ -464,6 +468,13 @@ static bool gl_create_resources(void)
PipelineShader* dshader = 0;
u32 compile = 0;
#if !defined(GLES) && defined(HAVE_GL3)
//create vao
//This is really not "proper", vaos are supposed to be defined once
//i keep updating the same one to make the es2 code work in 3.1 context
glGenVertexArrays(1, &gl.vbo.vao);
#endif
/* create VBOs */
glGenBuffers(1, &gl.vbo.geometry);
glGenBuffers(1, &gl.vbo.modvols);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment