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
path: root/intern
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-05-22 00:06:42 +0300
committerMike Erwin <significant.bit@gmail.com>2017-05-22 00:06:42 +0300
commit3f6f02e4336455bd70df7b604bea57ce75d1d87c (patch)
treef36927aa2db96081d2c2e69db0c23cc776bb084e /intern
parent90a1d491800cf1021d158973813265e9da71dbdd (diff)
Gawain: drop support for APPLE_flush_buffer_range
Modern GL's glMapBufferRange works the same on all platforms. Part of T49012
Diffstat (limited to 'intern')
-rw-r--r--intern/gawain/gawain/common.h6
-rw-r--r--intern/gawain/src/immediate.c19
2 files changed, 2 insertions, 23 deletions
diff --git a/intern/gawain/gawain/common.h b/intern/gawain/gawain/common.h
index 1c8153e750e..e21b241160d 100644
--- a/intern/gawain/gawain/common.h
+++ b/intern/gawain/gawain/common.h
@@ -25,9 +25,3 @@
#if TRUST_NO_ONE
#include <assert.h>
#endif
-
-#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT)
- #define APPLE_LEGACY 1
-#else
- #define APPLE_LEGACY 0
-#endif
diff --git a/intern/gawain/src/immediate.c b/intern/gawain/src/immediate.c
index ae691c71a72..7c3b0e11e92 100644
--- a/intern/gawain/src/immediate.c
+++ b/intern/gawain/src/immediate.c
@@ -69,11 +69,6 @@ void immInit(void)
glBindBuffer(GL_ARRAY_BUFFER, imm.vbo_id);
glBufferData(GL_ARRAY_BUFFER, IMM_BUFFER_SIZE, NULL, GL_DYNAMIC_DRAW);
-#if APPLE_LEGACY
- glBufferParameteriAPPLE(GL_ARRAY_BUFFER, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE);
- glBufferParameteriAPPLE(GL_ARRAY_BUFFER, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
-#endif
-
imm.prim_type = PRIM_NONE;
imm.strict_vertex_ct = true;
@@ -208,7 +203,7 @@ void immBegin(PrimitiveType prim_type, unsigned vertex_ct)
else
{
// orphan this buffer & start with a fresh one
-#if 1 || APPLE_LEGACY
+#if 1
// this method works on all platforms, old & new
glBufferData(GL_ARRAY_BUFFER, IMM_BUFFER_SIZE, NULL, GL_DYNAMIC_DRAW);
#else
@@ -235,12 +230,8 @@ void immBegin(PrimitiveType prim_type, unsigned vertex_ct)
// printf("mapping %u to %u\n", imm.buffer_offset, imm.buffer_offset + bytes_needed - 1);
-#if APPLE_LEGACY
- imm.buffer_data = (GLubyte*)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY) + imm.buffer_offset;
-#else
imm.buffer_data = glMapBufferRange(GL_ARRAY_BUFFER, imm.buffer_offset, bytes_needed,
GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | (imm.strict_vertex_ct ? 0 : GL_MAP_FLUSH_EXPLICIT_BIT));
-#endif
#if TRUST_NO_ONE
assert(imm.buffer_data != NULL);
@@ -390,11 +381,10 @@ void immEnd(void)
// unused buffer bytes are available to the next immBegin
// printf(" %u of %u bytes\n", buffer_bytes_used, imm.buffer_bytes_mapped);
}
-#if !APPLE_LEGACY
+
// tell OpenGL what range was modified so it doesn't copy the whole mapped range
// printf("flushing %u to %u\n", imm.buffer_offset, imm.buffer_offset + buffer_bytes_used - 1);
glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, buffer_bytes_used);
-#endif
}
#if IMM_BATCH_COMBO
@@ -412,11 +402,6 @@ void immEnd(void)
else
#endif
{
-#if APPLE_LEGACY
- // tell OpenGL what range was modified so it doesn't copy the whole buffer
- // printf("flushing %u to %u\n", imm.buffer_offset, imm.buffer_offset + buffer_bytes_used - 1);
- glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, imm.buffer_offset, buffer_bytes_used);
-#endif
glUnmapBuffer(GL_ARRAY_BUFFER);
if (imm.vertex_ct > 0)