summaryrefslogtreecommitdiffstats
path: root/opengl/tools
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-04-10 16:13:35 -0700
committerJesse Hall <jessehall@google.com>2013-04-10 22:00:26 -0700
commit1c8b8e8b8ee6290875fe59288ffa7ccaf4d86247 (patch)
treed84d45f39fab9f87b21c8cbace5cf62e60adf5be /opengl/tools
parent610bbf2b6fd80af98849d7e23526c6ce8a4112da (diff)
downloadframeworks_native-1c8b8e8b8ee6290875fe59288ffa7ccaf4d86247.zip
frameworks_native-1c8b8e8b8ee6290875fe59288ffa7ccaf4d86247.tar.gz
frameworks_native-1c8b8e8b8ee6290875fe59288ffa7ccaf4d86247.tar.bz2
Special-case glMapBufferRange
Updating the generator to handle GLvoid*/java.nio.Buffer return values probably wouldn't be too hard, but this is the only function that needs it currently. Bug: 8566953 Change-Id: I359a951136ab479ab576ce2e5a2881b937b7e8c9
Diffstat (limited to 'opengl/tools')
-rw-r--r--opengl/tools/glgen/specs/gles11/GLES30.spec2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp13
-rw-r--r--opengl/tools/glgen/stubs/gles11/glMapBufferRange.java9
-rw-r--r--opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg1
4 files changed, 24 insertions, 1 deletions
diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec
index d95937d..b7fe460 100644
--- a/opengl/tools/glgen/specs/gles11/GLES30.spec
+++ b/opengl/tools/glgen/specs/gles11/GLES30.spec
@@ -184,7 +184,7 @@ void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose,
void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer )
-// GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
+GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length )
void glBindVertexArray ( GLuint array )
void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays )
diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp
new file mode 100644
index 0000000..2485642
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp
@@ -0,0 +1,13 @@
+/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
+static jobject
+android_glMapBufferRange__IIII
+ (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
+ GLvoid* _p = glMapBufferRange((GLenum)target,
+ (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
+ jobject _buf = (jobject)0;
+ if (_p) {
+ _buf = _env->NewDirectByteBuffer(_p, length);
+ }
+ return _buf;
+}
+
diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java
new file mode 100644
index 0000000..482ea99
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java
@@ -0,0 +1,9 @@
+ // C function GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
+
+ public static native java.nio.Buffer glMapBufferRange(
+ int target,
+ int offset,
+ int length,
+ int access
+ );
+
diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg
new file mode 100644
index 0000000..ad5c077
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg
@@ -0,0 +1 @@
+{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII }, \ No newline at end of file