summaryrefslogtreecommitdiff
path: root/opengl/tools
AgeCommit message (Collapse)Author
2020-10-21Merge "Update bufferOffset logic in GPU upload functions"Treehugger Robot
2020-07-28OpenGL: Use more inclusive termsYiwei Zhang
Bug: 162288333 Test: build Change-Id: I290a827e26fcd186a0461a568e41d0c50b7e19cd
2020-07-10Update bufferOffset logic in GPU upload functionsAdam Bodnar
Update JniCodeEmitter.java to do the correct pointer arithmetic for ByteBuffers passed to upload functions with position != 0 Bug: 67109954 Test: ./gen, <run printed commands>, build, flash, atest android.opengl.cts.ByteBufferTest Change-Id: I689e43b4fd40f5d4d928bf694269901d8541df33
2020-06-24Update to use nativehelper/JNIPlatformHelp.hOrion Hodson
Reflects refactoring of JNI helper code that depends on private methods within libnativehelper. Bug: 151443957 Test: Treehugger Change-Id: Ic174c63462da4613857c30e92739b5781dcda753 Merged-In: Ic174c63462da4613857c30e92739b5781dcda753 Exempt-From-Owner-Approval: cherry pick (cherry picked from commit aa614cc747fc5c9acf6ca3683799517ff8acc657)
2020-04-01Unbreak gen command and sync with current treeOrion Hodson
Fix location of UnsupportedAppUsage.java. Update templates to match current sources. Add set-up sanity checks to gen script. Bug: 151443957 Test: ./gen and observe no source changes Change-Id: I095ef85ba9b2ef6617c451221a35f3545c3933a3
2019-12-11Use new UnsupportedAppUsage annotation.Artur Satayev
Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I17478d80070fff10eb083cfe633093383d5aedad
2019-04-11Update stubs to use libnativehelper for java.nio.Buffer accessOrion Hodson
Bug: 124338141 Test: atest CtsGraphicsTestCases (cherry picked from commit 13309b3d8f837eb32774dd6e401452d1cf5010a1) Change-Id: I6bb5cbc27dbb00fe944f78bb8095cd3002989547 Merged-In: I5e4978f4523d4f80bc6813740f2ed9cb57c6d9f4
2019-04-04EGLAttrib requires special handling in JNICourtney Goeltzenleuchter
EGLAttrib is defined for a C / C++ interface and is intended to be the size of a pointer. That can change depending on which abi the code is built for but Java doesn't have a way of dealing with such types. Java defines EGLAttrib as a jlong, so need to convert jlong to 32bit when running on a 32bit device. Bug: 124382141 Test: atest --all-abi CtsGraphicsTestCases:EGL15Test Change-Id: I3322651cdc9d9d989b4813bc85f99e4e16fda5a0
2019-02-26glgen: sync generator with manual changesOrion Hodson
Syncs generator to accomodate manual changes to checked-in sources. Adds note to EGL15.cpp that file is automatically generated. Bug: 126352534 Bug: 124064285 Test: gen and diff based on generated command lines. Change-Id: I31909de4c077679dec0323761fb06f388d128a14
2019-02-26Sync generator script with manual Java changesOrion Hodson
Incorporate manual changes to generated Java files back into the generator. Bug: 126352534 Bug: 124338141 Test: ./gen and check output has no commands for java files to be run. Change-Id: Ie5f48d704b1485316718ae19b20016a08e688916
2018-12-11[EGL] Advertize DISPLAY_P3_PASSTHROUGH_EXT.Peiyong Lin
Make sure we advertize DISPLAY_P3_PASSTHROUGH_EXT extension, and add platform support. BUG: b/111436479 b/117886297 b/120213877 Test: adb shell /data/nativetest/EGL_test/EGL_test Change-Id: I9848a3502e6a3e416f70c7097c25b596d92aaf0a
2018-10-24Add private constructor to EGL15 classCourtney Goeltzenleuchter
Based on API review feedback, adding private constructor and making class final. Bug: 118296391 Test: make Change-Id: Ie3e0a5fcb45c75f8d1b6b77883d02770cc208b55
2018-10-19EGL 1.5 cleanup eglGetPlatformDisplayCourtney Goeltzenleuchter
Generation scripts cannot create code for eglGetPlatformDisplay, (prior CL modified code by hand after generation) this change removes the need for generating code for that function. Also include eglCreateImage and eglDestroyImage in EGL15.spec file. Bug: 80297325 Test: atest CtsGraphicsTestCases:EGL15Test Change-Id: I18e2f8fe43a43e6f74f4687af28c656dd9f65bc0
2018-10-17Generated EGL 1.5 supportCourtney Goeltzenleuchter
After updating opengl/tools/glgen2/registry/egl.xml and gl.xml do: cd opengl/tools/glgen ./gen cd ../glgen2 ./glgen.py Note: Manually undo delete of glMultiDrawElementsBaseVertexOES. EGL removed that as an API (https://github.com/KhronosGroup/OpenGL-Registry/issues/81) but we can't remove or we'd break backward compatibility. Test: compile Bug: 80239516 Change-Id: I6fa125ef076ad4ce5b53833ac6aef2f87edaf656 (cherry picked from commit ed87ada59b97ccfcabec8133fb026144a728a77c)
2018-10-11Make a GLESv1 only entries for GLESv1 driver loadingYiwei Zhang
This change creates a separate entry list for initializing gles1 apis from the driver. With this change, the gl driver loading time for one particular device reduced from ~180ms to ~40ms. Bug: b/117526831 Test: dEQP-EGL.* and systrace on multiple devices Change-Id: Ic2f6f1b8f4cd8f17db64b6e288769e2d6a7859eb
2018-04-01Update EGL and GLES headers.Krzysztof Kosiński
Notable new extensions: EGL_EXT_image_gl_colorspace GL_EXT_EGL_image_storage GL_EXT_clip_control GL_KHR_parallel_shader_compile The first two extensions will be required in P for devices with the feature android.vr.high_performance. Changes compared to Khronos versions of the headers: 1. The Khronos headers contain a recent fix to remove the incorrectly named function glMultiDrawElementsBaseVertexOES, which should have the EXT prefix according to the extension specification. However, frameworks/base references that function in libs/hwui/debug, so it was teomprarily added back to the gl2ext.h and the .in files. See ag/3831170 and this link for further information: https://github.com/KhronosGroup/OpenGL-Registry/issues/81 2. eglext.h was modified to add the undocumented and deprecated EGL_ANDROID_image_crop extension. See bug 15287899 for context. This also tweaks the glgen script to ignore Windows-specific items. Bug: 74131503 Bug: 76152545 Test: Built and ran a few OpenGL-related CTS tests on Pixel XL. Change-Id: I5b365c114b09228a6ead291c08e5330153f75748
2017-11-14Remove GCC-specific pragma am: 020c6ead1a am: 795c8c1d88Pirama Arumuga Nainar
am: f3c3e9a946 Change-Id: If83e29c47e08bbf615a2240eb38b84400dfa653a
2017-11-10Remove GCC-specific pragmaPirama Arumuga Nainar
Bug: http://b/68236396 Wunused-but-set-variable is not supported by Clang and no longer needs to be disabled. Test: Update frameworks/base/core/jni/ and build Change-Id: Ia5c142334b224e99eebc56beac0059fc533b7f25
2017-08-25cpp: use proper nativehelper headersSteven Moreland
libnativehelper exports headers under nativehelper. These were available before incorrectly as global headers in order to give access to jni.h. Test: modules using cpp find headers Bug: 63762847 Change-Id: Id60fdbcba4830946183db194b8f65559994cddfa
2017-05-02Add EGL_KHR_no_config_context extension header infoCourtney Goeltzenleuchter
Test: make Bug: 29940137 Change-Id: I8972c9dd775aaf1263c005eafbbec7bb4245d270
2017-04-26Add new EGL colorspace extensionsCourtney Goeltzenleuchter
Test: make Bug: 36258948 Change-Id: I8d47b1e4c5a6e5281aca25ddcd54157c5ffc1ead
2017-03-09Add EGL_SCALE_METADATA enumCourtney Goeltzenleuchter
EGL_SCALE_METADATA is part of existing SMPTE2086 extension. Test: make Change-Id: Iaf25e90334fe7f1b5d616f68d5f1ce94b8ecc5d0
2017-03-09EGL: Grab relevant upstream colorspace changesCourtney Goeltzenleuchter
Test: make Change-Id: Ic9d9456225b95e365f13d3fd793fe7444b5c0d80
2017-02-18Add missing GLES 3.x metadataRomain Guy
Prevent a crash when glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS) returns 0 Bug: 33106868 Test: Manual test app Change-Id: I5c9fdf4f6f14aa08961e70a0cf63fb78b88738fb
2017-02-01Merge "Fix a use-of-uninitialized-value warning" am: d047e10558 am: ↵George Burgess IV
f9e9c5bc2e am: dfadb2a1da am: 491b616e1d Change-Id: I147fb87e62e93a54d40f701076463420ed50105e
2017-01-31Fix a use-of-uninitialized-value warningGeorge Burgess IV
Caught by clang's static analyzer: frameworks/base/core/jni/com_google_android_gles_jni_GLImpl.cpp:190:30: warning: The right operand of '+' is a garbage value buf = (char*)buf + offset; This is because getPointer doesn't always set `offset` to a value. We could fix it locally by initializing `offset`, but it seems to be less error-prone to just fix getPointer instead. Bug: None Test: Still builds; warning is now gone. Change-Id: I90bea0c94cf8d7f92a0d9a4db4e64e7e563bfb09
2017-01-26Add support for EGL_EXT_pixel_format_floatCourtney Goeltzenleuchter
Bug: 32146087 Test: run test-opengl-configdump on device. Change-Id: Ic7843f523a1c4125f6697c58d930aad6fc3248ba
2017-01-12Add EGL_RECORDABLE_ANDROID enum in EGLExtKalle Raita
Test: CtsMediaTestCases on N5X Bug: 29402583 Change-Id: I47f7af535396cc1ad006b54ce150b9d7f376fced
2016-12-05Add null checks for *Buffer paramsRomain Guy
This change prevents crashes in native layers and throws an exception instead. Bug: 25695785 Test: CtsGraphicsTestCases Change-Id: Ib6e6b7a09a86d8bc01a1c10ddd1af44f54d79ee8
2016-11-30Guarantee that glMapBufferRange/glGetBufferPointv return a ByteBufferRomain Guy
Bug: 24950082 Test: CtsGraphicsTestCases Change-Id: I3774940392ba39ac92fcf680a7b6786fe61876a3
2016-11-30Deprecate eglCreatePixmapSurfaceRomain Guy
This function was never properly supported. It had partial support in our JNI layer in EGL10 but not implementation in EGL14. It has never been tested and it is unlikely that drivers support pixmap rendering. Bug: 11257511 Test: CtsGraphicsTestCases Change-Id: Ieb9a98fd94ac04219e7bf81ee5d31354bd591f39
2016-11-29Add fallback case in glGetShaderInfoLogRomain Guy
Some drivers do not always report the proper info log length through glGetShaderiv which causes the JNI bindings to return an empty log string. This change falls back to a length of 512 bytes when the queried length is 0. This is the same fallback used in libhwui. Bug: 16624915 Test: CtsOpenGLTestCases Change-Id: I8deea6a7454efceb7c5d862b7055a34964f5bded
2016-03-04Implement the stub for glCreateShaderProgramvPablo Ceballos
Bug 26851015 Change-Id: Ide7c46e0b5525d082dc591e92b4a8d8b21665708
2016-02-29Merge "Fix glGetTransformFeedbackVarying JNI" into nyc-devPablo Ceballos
2016-02-22Add glReadPixels with buffer-offset argumentPablo Ceballos
- For reading into PBOs on GLES3, add an overloaded version of glReadPixels that takes an offset argument. Bug 18878609 Change-Id: Ide9beca7b241a9f8a016e8ae17082bd0ba21246a
2016-02-09Fix glGetTransformFeedbackVarying JNIPablo Ceballos
- Deprecate the broken version that takes a byte argument. - Implement a new version that takes a byte buffer argument. Bug 19478262 Change-Id: I31cdb2e8bbcad5238b74443cf4ef25d36f5aba52
2015-12-18Add GLES32 class templatesPablo Ceballos
- Added a script that takes the #defines in gl2/3.h and formats them for use in the Java template. - Generated GLES32.spec using glgen2. - Added full support for void* in glgen. It wasn't previously necessary since the apis were using GLvoid instead. - Created the GLES32 header stubs. Added stubs for GLES32 functions that couldn't be handled by the code generator. Added checks in the checks.spec file where appropriate. - Generated the GLES32 class and JNI. Change-Id: Ifc8512ed56af75bbc3e7ec2ea1377895201d5325
2015-12-18opengl: Update headers and registry and regenerate *api.inPablo Ceballos
- Update the registry xml files and python scripts in glgen2. Took r32166 from: https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/ - Update the GLES headers (and add gl32.h). Took r32166 from: https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api/ - Include gl32.h in libs/hooks.h - Update glgen2/glgen.py to properly handle glPathGlyphIndexRangeNV which uses an explicit array parameter (and is the only GL extension that does this). This modification also fixes a bunch of whitespace issues in the *.in files. - Get rid of the remaining bits of glTrace code in glgen2/glgen.py - Regenerate the *.in files with glgen2 - The official glext.h hasn't been updated and differs from the registry in the second to last argument to glMultiDrawElementsEXT. This file was previously modified to match the registry and this modification has been carried forward in this commit. - getProcAddress.cpp was failing to compile for ARM because the inline assembly for loading the function pointer now exceeds the limit of 4095 for an immediate offset to the ldr instruction on ARM. Modify it to instead load the offset into a register and add it with an add instruction before the ldr instruction. - Khronos has added #ifdef GL_GLEXT_PROTOTYPES guards to the function prototypes in gl2/3.h. In order to keep existing code compiling add #define GL_GLEXT_PROTOTYPES to include/KHR/khrplatform.h for now. This should be fixed upstream and when it is this can be removed. Change-Id: I952ace43879557d7c363810b83d65159ad2ad1e3
2015-11-06glgen: Better support for null arguments in JNIPablo Ceballos
- Modify the checks.spec file format to specify which argument is allowed to be null. - Update the JniCodeEmitter to support passing null arguments for all pointer types as well as strings. - Update the EGL/GLES checks.spec files and stub files to allow null arguments through the JNI layer where the spec allows it. Bug 9321681 Change-Id: I7d8e7319b43da95993516aa3ac5318b971a1ff92
2015-09-29Add missing OpenGLES 3.1 bitfield constants.Pablo Ceballos
Bug 23892570 Change-Id: I4bd50c3fb4510d904ebdf76046a128d9a8fc0bda
2015-09-21constify generated JNINativeMethod fn ptr tablesDaniel Micay
Change-Id: Icbad34e298f6d8e60ef12e9a91200994249fe2f5
2015-05-22Fix EGL shim extension injection for GL ES 3 drivers.Alistair Strachan
The Android EGL shim injects GL_EXT_debug_marker into the ES driver EXTENSIONS string for the OpenGL ES 1.x and 2.0/3.0/3.1 drivers if the extension is not already provided. This feature is used by GLES_trace. In Open GL ES 3.0 it became possible to query an indexed version of the EXTENSIONS string via GetStringi(). NUM_EXTENSIONS Gets were also added to the specification (taken from Open GL). If the shim does not have to inject the extension, then there is no problem, as glGetString() and glGetStringi() / NUM_EXTENSIONS will be consistent. However, if the Android EGL shim injects the extension, NUM_EXTENSIONS and GetStringi() will report one less extension than is really available. Consistency between these methods is tested by the dEQP framework with the dEQP-GLES3.functional.state_query.string.extensions test. If the driver does not provide GL_EXT_debug_marker, this test fails. This change wraps all of the affected entry points so that the wrapped driver extensions are never visible directly to dEQP, eliminating the inconsistency.
2015-05-13Replace JNI primitive array critical calls with non-critical ones.Hiroshi Yamauchi
The glgen part. (cherry pick commit 4e7de461c18278a31be83e7c9074a02fbb6e9475) Bug: 19235243 Change-Id: I0d1e78acf39feb37a67e857216a6d52f4cede180
2015-02-23Fix pointer-to-int and int-to-pointer warnings.Dan Albert
Change-Id: If534cbcf2c3e644270572cbf829ba9b5acab29e6
2014-12-02Merge "Avoid overwriting EGL14.EGL_NO_SURFACE"Jesse Hall
2014-11-25Avoid overwriting EGL14.EGL_NO_SURFACESangkyu Lee
Both EGL14 and EGLExt have the same initialization codes for EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY. Since EGLExt is initialized later, they are overwritten by EGLExt's initialization codes. Therefore, EGL_NO_SURFACE returned by methods in EGL14 is not actually EGL14.EGL_NO_SURFACE object and it makes several problems in handling error cases. For instance, "Let's fish" game application cannot be run on L. To solve the problem, this patch makes EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY initialized just once. Change-Id: Icce878164ff0b715ad2b5a2cd038a9616c7cf1e9
2014-11-12Frameworks/native: Add pragmas to glgen headersAndreas Gampe
The code currently being generated by glgen is not the cleanest, but we would like to get core/jni onto -Werror. Thus add pragmas turning off warnings locally to the C headers. Also fix signed-comparison in two functions. Longer term TODO: Emit clean code. Change-Id: Iee8582f8c0c1de076d64851d3b6ca467afd5bc43
2014-05-20opengl: Fix include style in generated JNI codeJesse Hall
Bug: 15028495 Change-Id: Ie38d398751a374f11bef8944a2aa0f8311934911
2014-05-20opengl: Un-hide GLES31 and GLES31Ext classesJesse Hall
Bug: 15028495 Change-Id: Iaac1e8d2ad5ea840d728a78804e2566be18a4340
2014-05-20opengl: Add GLES31 and GLES31Ext class templatesJesse Hall
Bug: 15028495 Change-Id: I276d04f029d441e092428fad72f09ca15e1d233a