Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-05-19 15:15:49 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-05-19 15:15:49 +0300
commit2383667a2e67aeb645792b52ad508c2fd2178202 (patch)
tree342e28eda77f010cdf9f42f13963e65990a5a4c9 /source/blender/gpu/intern
parent3527739002407ac9b1698beb1cde58b0077e3b78 (diff)
Remove reference to WITH_LEGACY_OPENGL
We only keep this as a way to get GPU_stubs to run, in case we want to do a throughout cleanup in the codebase and want code using legacy calls to fail to build.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c62
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c6
-rw-r--r--source/blender/gpu/intern/gpu_texture.c16
3 files changed, 1 insertions, 83 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 6e3c5f395dc..3abced40202 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -415,18 +415,12 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
{
if (alphablend == GPU_BLEND_SOLID) {
glDisable(GL_BLEND);
-#ifdef WITH_LEGACY_OPENGL
- glDisable(GL_ALPHA_TEST);
-#endif
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
else if (alphablend == GPU_BLEND_ADD) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
-#ifdef WITH_LEGACY_OPENGL
- glDisable(GL_ALPHA_TEST);
-#endif
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
}
else if (ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
@@ -439,30 +433,12 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
/* if U.glalphaclip == 1.0, some cards go bonkers...
* turn off alpha test in this case */
-#ifdef WITH_LEGACY_OPENGL
- /* added after 2.45 to clip alpha */
- if (U.glalphaclip == 1.0f) {
- glDisable(GL_ALPHA_TEST);
- }
- else {
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, U.glalphaclip);
- }
-#endif
}
else if (alphablend == GPU_BLEND_CLIP) {
glDisable(GL_BLEND);
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
-#ifdef WITH_LEGACY_OPENGL
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, 0.5f);
-#endif
}
else if (alphablend == GPU_BLEND_ALPHA_TO_COVERAGE) {
-#ifdef WITH_LEGACY_OPENGL
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, U.glalphaclip);
-#endif
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
}
}
@@ -2249,11 +2225,6 @@ void GPU_state_init(void)
glDisable(GL_COLOR_LOGIC_OP);
glDisable(GL_STENCIL_TEST);
-#ifdef WITH_LEGACY_OPENGL
- glDisable(GL_ALPHA_TEST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-#endif
-
glDepthRange(0.0, 1.0);
glFrontFace(GL_CCW);
@@ -2265,22 +2236,12 @@ void GPU_state_init(void)
void GPU_enable_program_point_size(void)
{
-#if defined(__APPLE__) && defined(WITH_LEGACY_OPENGL)
- /* TODO: remove this when we switch to core profile */
- glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
-#else
glEnable(GL_PROGRAM_POINT_SIZE);
-#endif
}
void GPU_disable_program_point_size(void)
{
-#if defined(__APPLE__) && defined(WITH_LEGACY_OPENGL)
- /* TODO: remove this when we switch to core profile */
- glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
-#else
glDisable(GL_PROGRAM_POINT_SIZE);
-#endif
}
#ifdef WITH_OPENSUBDIV
@@ -2478,11 +2439,6 @@ typedef struct {
unsigned int is_scissor_test : 1;
unsigned int is_stencil_test : 1;
-#ifdef WITH_LEGACY_OPENGL
- unsigned int is_alpha_test : 1;
- bool is_light[8];
-#endif
-
bool is_clip_plane[6];
/* GL_DEPTH_BUFFER_BIT */
@@ -2539,15 +2495,6 @@ void gpuPushAttrib(eGPUAttribMask mask)
Attrib.is_cull_face = glIsEnabled(GL_CULL_FACE);
Attrib.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
Attrib.is_dither = glIsEnabled(GL_DITHER);
-
-#ifdef WITH_LEGACY_OPENGL
- Attrib.is_alpha_test = glIsEnabled(GL_ALPHA_TEST);
-
- for (int i = 0; i < 8; i++) {
- Attrib.is_light[i] = glIsEnabled(GL_LIGHT0 + i);
- }
-#endif
-
Attrib.is_line_smooth = glIsEnabled(GL_LINE_SMOOTH);
Attrib.is_color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
Attrib.is_multisample = glIsEnabled(GL_MULTISAMPLE);
@@ -2610,15 +2557,6 @@ void gpuPopAttrib()
restore_mask(GL_CULL_FACE, Attrib.is_cull_face);
restore_mask(GL_DEPTH_TEST, Attrib.is_depth_test);
restore_mask(GL_DITHER, Attrib.is_dither);
-
-#ifdef WITH_LEGACY_OPENGL
- restore_mask(GL_ALPHA_TEST, Attrib.is_alpha_test);
-
- for (int i = 0; i < 8; i++) {
- restore_mask(GL_LIGHT0 + i, Attrib.is_light[i]);
- }
-#endif
-
restore_mask(GL_LINE_SMOOTH, Attrib.is_line_smooth);
restore_mask(GL_COLOR_LOGIC_OP, Attrib.is_color_logic_op);
restore_mask(GL_MULTISAMPLE, Attrib.is_multisample);
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 502cfeb6f02..326f3bed391 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -152,11 +152,6 @@ void gpu_extensions_init(void)
glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &GG.maxubobinds);
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &GG.maxubosize);
-#ifdef WITH_LEGACY_OPENGL
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
-#else
#ifndef NDEBUG
GLint ret;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
@@ -169,7 +164,6 @@ void gpu_extensions_init(void)
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &r);
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, &g);
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, &b);
-#endif
GG.colordepth = r + g + b; /* Assumes same depth for RGB. */
if (GLEW_VERSION_3_2 || GLEW_ARB_texture_multisample) {
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 12b0fb4c0e2..538ed93b0bf 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -428,9 +428,6 @@ static GPUTexture *GPU_texture_create_nD(
glTexParameteri(tex->target_base, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
-#ifdef WITH_LEGACY_OPENGL
- glTexParameteri(tex->target_base, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
-#endif
}
else {
glTexParameteri(tex->target_base, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -509,9 +506,6 @@ static GPUTexture *GPU_texture_cube_create(
glTexParameteri(tex->target_base, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
-#ifdef WITH_LEGACY_OPENGL
- glTexParameteri(tex->target_base, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
-#endif
}
else {
glTexParameteri(tex->target_base, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -564,7 +558,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int textarget
GPU_print_error_debug("Blender Texture Not Loaded");
}
else {
- GLint w, h, border;
+ GLint w, h;
GLenum gettarget;
@@ -576,16 +570,8 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int textarget
glBindTexture(textarget, tex->bindcode);
glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_HEIGHT, &h);
-#ifdef WITH_LEGACY_OPENGL
- glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_BORDER, &border);
-
- tex->w = w - border;
- tex->h = h - border;
-#else
tex->w = w;
tex->h = h;
- UNUSED_VARS(border);
-#endif
}
glBindTexture(textarget, 0);