summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * [gl] ES version from underlying GLES or core profile GL versionLingfeng Yang2018-08-232-43/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bug: 64131077 - Use context creation trials to determine max GLES version - Use feature control for compatibility and to prevent making guests that don't support ES3 run ES3. - Edit the version string to match, too. - remove dlsym based dispatch - filter extensions based on known working set of ES2 extensions if in ES2 mode Change-Id: I02c36cb9bcddb0ebba82c98a5ab631bbfe15162e
| * [gl][snapshot] Use LazyLoadedEGLDispatchLingfeng Yang2018-08-233-21/+0
| | | | | | | | | | | | | | | | Instead of duplicating the functionality of it. +fix build break on Mac due to non-void function with blank return Change-Id: If3159c23a4957f7cd3418ad1f435d06b7d019bdb
| * [egl] Use eglGetProcAddress as fallback for missing functionsLingfeng Yang2018-08-233-3/+40
| | | | | | | | | | | | bug: 63908229 Change-Id: I69b832198ae6dd5d58cee842bafa6e3dc5a74fa1
| * [ANGLE Snapshot] GLES2 translator on top of ANGLEYahan Zhou2018-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies our GLES2 translator to allow it to mount on top of ANGLE. Because ANGLE is a GLES2 backend while previously our translator assumes desktop GL backend, some modifications are required. The main changes in this patch include: (1) Pass a flag to GLES translator to tell if it is running on top of another GLES backend (2) Desktop GL sometimes assume EXT postfix for some functions while GLES does not. Modify dispatcher so that it loads func as well funcEXT and funcOES as alias. (3) ANGLE does not like GL_RGB8 and GL_RGBA8 texture internal formats. Change them to GL_RGB and GL_RGBA. (4) Bypass some texture parameter validations when using ANGLE backend. (5) Ignore the parsed shader and use orignal shader source when using ANGLE backend. Change-Id: I6c5a770a0157c020920a432f3c949e2f8d67e0eb
| * [gl] Fix 'inout' variable qualification + complex readbackLingfeng Yang2018-08-2323-88/+439
| | | | | | | | | | | | | | | | | | | | | | | | | | - Can use variables with both input and output qualities - Allow readback of complex structures. 3 phases: - host_pack_tmp_alloc: custom expression to allocate aligned temporaries for the output structs - host_pack: custom expression to pack into stream (losing alignment) - guest_unpack: custom expression to unpack into object on guest (regaining alignment) Change-Id: I9073325efe6847762e8b2d42fd9803d81ff67374
| * Fix a series of compiler warningsErwin Jansen2018-08-232-2/+0
| | | | | | | | | | | | | | | | - Fix a set of warnings from the mac build - Deleted unused variables - Marked methods as override Change-Id: I614f0a444b83de6ec978afc017cfb53d9ceafd62
| * [gl] Allow custom unpack in decoderLingfeng Yang2018-08-233-5/+45
| | | | | | | | | | | | Encoder has custom pack, why not custom unpack as well? Change-Id: I955e0967dad6ee6e1c46bda51774463b67774744
| * [snapshot] Save if IOStream has |m_buf| setYurii Zubrytskyi2018-08-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IOStream uses |m_buf| as a buffer pointer and as a flag at the same time: if it's not set then there's no need to flush. Previous snapshotting code didn't save this bit of information, so next time one tried to allocate a buffer from a just loaded empty IOStream, it thought it's not empty (as |m_buf| was not nullptr) and tried to flush garbage. This CL saves this separately, so now |m_buf| after snapshot loading is exactly in the same state as it was before. Bug=b/36700704 Change-Id: I7af309bb1d3c16ba20969f7bb3f9bfc067d0051d
| * unconditionally extern "C", update guest encoderLingfeng Yang2018-08-233-7/+1
| | | | | | | | Change-Id: Ia1cc789acd1ec4d00b83950e0125de4e7957d097
| * Fix running with anything other than lib64GLES_V2_translatorLingfeng Yang2018-08-232-1/+3
| | | | | | | | Change-Id: Id145c7fda144dcca34d9d61c1d6e465edc862535
| * [GPU snapshot] Snapshot translator GLES2 contextYahan Zhou2018-08-231-0/+1
| | | | | | | | | | | | | | | | | | This patch snapshot the translator GLES2 context as it is. Namespaces and GL objects will be in another patch. Hardware GPU restore will be in another patch. Change-Id: I12cd6d0b7174414bce0bd9143fcdf21786f12ba4
| * Remove a bad assert() in IOStream dtorYurii Zubrytskyi2018-08-231-2/+1
| | | | | | | | | | | | | | | | The assert was ok for the regular case, but it would fail if the guest closed the pipe in the middle of processing because of some logic error Change-Id: I9d69f8ea6d9cb0e0cca3b1607fa49b7876be6b14
| * ChecksumCalculator serializationYurii Zubrytskyi2018-08-233-3/+40
| | | | | | | | Change-Id: Id135b7e226c0664c3bc2261f0f6b5ab28cb580c6
| * [GPU snapshot] Framebuffer and contexts snapshotYahan Zhou2018-08-232-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch snapshot FrameBuffer and RenderContexts. With this patch, after from a GPU snapshot, the emulator should not crash but it will complain about invalid window surface handle. Next step: snapshot window surfaces TODO: call eglMakeCurrent after loading refactor objectNameManager so that shared groups are indexed by ID better interface for EglContext::onLoad clean up the code Change-Id: I7aa740f215f96c054634f08d5862bbc9534728c1
| * IOStream and ChannelStream serialization functionsYurii Zubrytskyi2018-08-231-0/+16
| | | | | | | | | | | | | | | | | | - IOStream serializes its internal state first, then calls derived class' implementation. - ChannelStream just saves/loads internal buffers Change-Id: Iccb7302c9cfe1f0f5d2c592376d5498d1b586266
| * GL state snapshot - initial structureLingfeng Yang2018-08-233-7/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | - sit between udnerlying es driver and guest - work with any es backend (angle, swiftshader, etc) - snapshot clear color as a smoke test TODO - plug into rest of snapshot - snapshot minimum set of GL state necessary to get to home screen Change-Id: Idf2eb9822d62f9308275ff2df8d12f4402e085c3
| * [WIP] glesv31 hostside changesLingfeng Yang2018-08-233-14/+17
| | | | | | | | Change-Id: I2710d1685e19071cdadf0d5eeb1f29fae6f68e9a
| * [test] OpenGL unit testsLingfeng Yang2018-08-231-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL moves MyEGL/GLESv2/Dispatch into a more general location---emugl_common---allowing us to dispatch underlying GLESv2/EGL libs from other places in the emulator than qt gl widget, and introduces code for OpenGL unit tests, along with a basic context creation unit tests. We can now do offscreen-rendering type unit tests with OpenGL. This is very helpful for debugging host-side OpenGL issues, rather than going through X11 / WGL from the ground up to repro OpenGL cases. This should also be useful for testing snapshots. Usage: qemu dir -> cwd DYLD_LIBRARY_PATH (or platform equivalent)=objs/lib64 objs/lib64OpenglRender_unittests --gtest_also_run_disabled_tests should run at least basic context creation and dispatch. Change-Id: If89966156bb4978a302fd94a96d77e5ce1552c03
| * [GLESv3] fix build on older imagesLingfeng Yang2018-08-233-0/+48
| | | | | | | | Change-Id: Ibef7263f881c55d9f79c0881bfa24c1f0c46eebf
| * [GLESv3] ES 3.x API implementation v1Lingfeng Yang2018-08-231-1/+165
| | | | | | | | | | | | | | | | - ES 3.0 almost conformant (~80 failing tests not having to do w/ compressed texture support) - ES 3.1 has a first cut, still lots TODO Change-Id: I3aaafa6f42aba5ba7b1937556529b746d54cfb95
| * [GLESv3] dispatch, (en|de)coder, feature controlLingfeng Yang2018-08-2312-253/+1584
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an initial pass at GLES 3.x encoding. Some GLES 3.x functions like mapped buffers need tricky handling. See gles2.in for documentation of current encoder design and scoping of 3.x features and issues. Features: - Dynamic version detection of GLES 3.x support in both underlying GLESv2 lib (possibly SwiftShader or ANGLE) and the host OpenGL underneath the GLESv2 lib. Dynamic detection is put under feature control (currently off) to allow development while not breaking CTS. - Auto-generated translation of GLES 3.x functions to host OpenGL in android/scripts/gen-entries.py - Added all GLES 3.x buffer targets. - Enabled GLSL ES 300 -> GLSL compiler in ANGLE shader translator. Change-Id: Ib56ca6962466e6c21bfc45cdeb97ffa684c873c6
| * [getopt] Fixed our own implementation of getopt()Yurii Zubrytskyi2018-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | We have own code for getopt() that's not used now. But if we try compiling emugen on platform without native getopt(), e.g. Windows, we need to use ours. It had a bug where we were not advancing the |optind| variable if option's value was in the next |argv| item. This CL fixed it Change-Id: I4d1f4cf226f22817fdbba28a4fbc6f34ee78ea83
| * [build] Copy target CFLAGS into the host onesYurii Zubrytskyi2018-08-232-2/+2
| | | | | | | | | | | | | | | | | | | | | | We use host CFLAGS to build emugen, and it was missing all flags one needs, including debug info and optimizations. This CL copies the flags we use for target build. + Fix build errors after enabling Werror Change-Id: I6be85210f3e9e447fb603e48dace074296b59d0e
| * [apigen] Fix the generated code for WITH_LARGE_SUPPORT=0Yurii Zubrytskyi2018-08-231-135/+154
| | | | | | | | | | | | | | | | We've abandoned that mode for a while, but it is a good way to compare the performance of memcpy() buffers vs pass them through the pipe without copying Change-Id: I4a0b1b2332c93fd5484c8e82399e35686247a504
| * [video] Do YV12 conversion on the host with a shaderLingfeng Yang2018-08-234-1/+573
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing YV12 conversion in the guest makes gralloc unlock block for a very long time, which chokes MediaCodec. Doing YV12 conversion in shader, 1080p60 is achievable for short bursts, since the conversion is faster by over 10x (<3ms instead of ~30ms to convert a 1080p YV12 frame to RGB888). Still, at 1080p60, there are various stalls/hiccups... Change-Id: I031c4fd7b1260e89d9bc4398602ea1baea6f5e98
| * [video] goldfish_dma androidemu changesLingfeng Yang2018-08-2315-22/+707
| | | | | | | | | | | | | | | | | | This set of CLs instantiates the goldfish dma pipe extension's interface, and uses it to perform all color buffer updates, making video playback smoother. Change-Id: I543ba907fcc948d48d812146fa2e69a86cecb941
| * Move android-emugl from distrib/ to android/David 'Digit' Turner2018-08-23321-43029/+1
| | | | | | | | | | | | | | | | | | | | Since this is no longer a side-project, move it under android/ where it logically belong. distrib/ should now only contains sources and build files related to third-party libraries used by the emulator. Change-Id: I012c2d8c875d018b0c97891773fa5e8e2811087e
| * emugl: Simplify RenderChannel interface.David 'Digit' Turner2018-08-238-251/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch simplifies the RenderChannel interface and its implementation (a.k.a. RenderChannelImpl). This has several benefits: - The interface is now much closer to the one expected by an AndroidPipe instance, making EmuglPipe easier to implement (e.g. get rid of atomic variables in it). - RenderChannelImpl only uses a single lock instead of three, and doesn't use atomic variables anymore, thanks to the BufferQueue class. This makes the code a lot less confusing and removes risks of thread-racy behaviour due to the use of multiple locks and atomics at the same time. Performance wise, this seems to be comparable to the current implementation. The following numbers corresponds to the frames/s collected when running the Antutu3D 6.0 "Garden" benchmark, on an Android API level 23/x86 system image, 1920x1080 resultion, running on an HPz620 (32 cores at 2.7 GHz) with the "performance" scaling governor set on all CPUs: Official Current release Tip-of-tree With this patch 15.07 17.13 17.52 15.35 17.36 17.52 15.06 17.34 17.37 Change-Id: I1f0e998b23c38051c8de519a3cab3f6a961be930
| * emugl: Move IOStream.h to host/include/libOpenglRender/David 'Digit' Turner2018-08-238-14/+9
| | | | | | | | | | | | | | | | | | There is no longer a reason to distinguish between include/libOpenglRender and include/OpenglRender/. Since the former only contains IOStream.h, move the header to include/libOpenglRender to get rid of one include directory during the build. Change-Id: I75b20025e79d25ed9dfb1c6e57c55566a5995c17
| * [GL] Minor optimizations and cleanupsYurii Zubrytskyi2018-08-2315-157/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make the IOStream's ctor and dtor protected - Remove unused virtual function in IOStream - writeFully() - Change ApiGen to privately inherit from std::vector<> (inheriting from vector is still bad, but I don't want too many unrelated changes in the CL) - Don't pass output parameter buffers from the guest to host in the GL protocol. We used to reserve memory for output buffers among the input parameters stream, and never actually read it on the host. Now we don't reserve it anymore (and don't pass it over!) - Add two conditional defines to ApiGen.cpp, INSTRUMENT_TIMING_{GUEST,HOST} When defined to 1, emugen generates timing printouts for each of the generated functions. Very useful for debugging. - Don't call eglMakeCurrent if the context we're making current is already one - Grab the thread-specific checksum calculator in the RenderThread's main function and pass it to decode() functions. This way we don't need to keep calling into TLS on every packet processing for several times to just get what we know is there and won't change 43 -> 44 fps in Antutu Change-Id: I9411cbd1758192b049f8f2e37b2d319e9f6a8593
| * SmallVector class for GLes pipe data transfersYurii Zubrytskyi2018-08-238-102/+689
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a SmallVector class that allocates smaller data chunks on the stack, and falls back to heap memory for larger ones. For the ChannelBuffer class it makes the slow allocations almost disappear for my testing, only having them once in a couple minutes. SmallVector as of now only implements a tiny subset of vector<> interface, the one used in the code. Overall speedup is about 10% for Antutu benchmark, 15% for YouTube video player at 720p60Hz Change-Id: Ib64efe2ef7dac18263866069a5a5e67baec385cb
| * [gl] Slightly faster checksum calculationYurii Zubrytskyi2018-08-232-11/+19
| | | | | | | | | | | | | | | | Checksum calculation is something we call on each gl command, so it has to be really fast. This CL gets rid of unneeded memcpy() calls, so it is slightly faster now Change-Id: Ib299580c167be1c94130a4fbda1e81fed88bf3a5
| * [gl] Update the emugen test data for the latest emugen changesYurii Zubrytskyi2018-08-231-19/+11
| | | | | | | | Change-Id: I141d650302a7f0d984fd09b0be7bee09c0a9a65c
| * [emugen] Slightly better generated code for protocol decodersYurii Zubrytskyi2018-08-231-22/+18
| | | | | | | | Change-Id: If9f45a5e0233c03fc1fbb02132e1375200d30121
| * [gl] Simpler implementation for Unpack() callYurii Zubrytskyi2018-08-231-47/+10
| | | | | | | | | | | | + fixed a wrong code for double, where it was read as 4-byte type Change-Id: I68785eae5234ced97cbb2890afcfeafaeb52f1ee
| * Refactor pre-process GL resource management (host)Yahan Zhou2018-08-236-241/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we bind a process unique id (puid) to the GL encoder / decoder commands when managing process owned GL resources. This patch simplify it by telling each rendering thread its puid at the beginning, and using that puid for resource management. It will make our life easier when we need to change other resources from owned-by-thread to owned-by-process (e.g. EglContext). This CL must work with guest CL: https://googleplex-android-review.git.corp.google.com/#/c/1472672/ Change-Id: I2d82f8b439d0fc2354989ac5a037e9b413fde5d4
| * goldfish_sync: properly clean up sync objectsLingfeng Yang2018-08-235-69/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be issues that arise from sync objects not being destroyed properly, such as -gpu swiftshader leaking threads. This CL: - adds rcDestroySyncKHR to allow the guest to destroy EGL sync objects on the host. - adds a self-deleting FenceSync class that is expressly for wrapping underlying OpenGL sync operations and destroying sync objects at the proper time. - removes the FenceSyncInfo class; now all sync handles are passed as FenceSync objects. Now, no locks are needed when processing sync objects. - because changes in the system image and GL pipe protocol are also needed, it bumps the GLAsyncSwap extension string to "ANDROID_EMU_native_sync_v2", so that combinations of old/new emulator/system-image still work. If different version strings are detected, we fall back to disabling the sync feature. This scheme seems to have not broken CTS (so far), and fixes thread leakage while running -gpu swiftshader. Change-Id: If4bac1d8025731366bc090faf7ef837ca298fba8
| * goldfish_sync: more robust context creation/destructionLingfeng Yang2018-08-2312-35/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are having problems with sync device running on things that are not z840 / K2200 at least, which could have to do with not cleaning up / creating sync device resources in a clean manner. This CL moves all sync device context creation/destruction logic to the same code paths as FrameBuffer's and RenderThread's; use createRenderContext / bindContext to create and set a context, and drainWindowSurface / drainRenderContext to tear it all down. It also adds glDeleteSync for -gpu host and calls eglDestroySyncKHR when a EGLSyncKHR object with ANDROID_NATIVE_FENCE nature is signaled, which helps to not leak sync objects (Overall, sync objects may still be leaking judging from -gpu swiftshader performance, but this is just a first step). Overall, this seems to fix intermittent (3-4 hr) segfaults and deadlocks (in the NVIDIA driver!) while running CTS on z420 / K600 workstations. Change-Id: Ie9ba252e1415f5c9e8e6c299076d581280256c3d
| * Add EGLImage clean up when guest process exitsYahan Zhou2018-08-239-58/+488
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up EGLImage when guest process exits. The implementation details are very similar to color buffer cleanup: https://android-review.googlesource.com/#/c/246823/ It associates each EGLImage with its process ID, and cleans them up when the process exits. This patch also renames GrallocPipe to GLProcessPipe. This is because the pipe is now used to release not only color buffers allocated by gralloc, but also EGLImages. It works with guest patch: https://googleplex-android-review.git.corp.google.com/#/c/1269309/ Tracking bug: https://buganizer.corp.google.com/issues/29457657 Change-Id: I3143b48e1b5dc5f57a4cb87c62e86eb11c1f534e
| * Add host-side EGL sync + GLESv3 supportLingfeng Yang2018-08-2321-1140/+4369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "better solution" was alluded to in https://android-review.googlesource.com/#/c/221311/ A first step of which is to support host-side OpenGL sync commands glFenceSync and glClientWaitSync. One way to add them is to add GLESv3 types support and extend the GLESv2 implementation. This involves some changes to OpenGLESDispatch, and, for the emugl Translator backend, adding the functions to GLESv2Imp.cpp. We then include a trivial implementation of host-side eglCreateSyncKHR and eglClientWaitSyncKHR through wrapping these first two GLESv3 functions: glFenceSync and glClientWaitSync. Host Opengl 3.2+ is required. Note: I had thought that adding GLESv3 suggests a GLESv3Imp* and related set of things, but it seems popular (judging from ANGLE and Swiftshader) to combine the v2/v3 libraries in some way; if we use ANGLE as backend, for example, we will want to flip through ANGLE's libGLESv2.dll, there not being any libGLESv3.dll Note: This involves a change in the encoder. It should be backwards compatible among old + new versions of system images, though, as the actual use of the new renderControl functions does not happen unless the GLAsyncSwap feature is activated. This is part of a sequential, multi-CL change: external/qemu: https://android-review.googlesource.com/240119 https://android-review.googlesource.com/239442 https://android-review.googlesource.com/221593 <- this CL https://android-review.googlesource.com/248563 <- needs this https://android-review.googlesource.com/248564 <- needs this https://android-review.googlesource.com/223032 <- needs this external/qemu-android: https://android-review.googlesource.com/240155 https://android-review.googlesource.com/238790 kernel/goldfish: https://android-review.googlesource.com/232631 https://android-review.googlesource.com/238399 Change-Id: Iee6570709e70def813ff52a7745305e6fd0de58d
| * Fix Werrors in decoderLingfeng Yang2018-08-232-4/+4
| | | | | | | | Change-Id: I9cf187c2cc8de168a470834cb3904e20dd555c05
| * Add flush to rcCloseColorBufferPuidYahan Zhou2018-08-231-0/+3
| | | | | | | | | | | | It is needed to make sure all color buffers are closed correctly. Change-Id: Ib661f51a31c783edc5123e173bdfa81273be207a
| * [GLES1->2] Properly separate entry points / internal callsLingfeng Yang2018-08-233-0/+702
| | | | | | | | | | | | | | | | Otherwise, gl*** calls in the GLESv1->2 translator that are internal calls might instead call completely different libraries, like system OpenGL. Change-Id: I89b7fd4461e5d6f50f82c2585638dc44bde2fa9f
| * [GLES1->2] Add GLES1->2 translation entry points and link themLingfeng Yang2018-08-235-10/+119
| | | | | | | | | | | | ...if the underlying backend does not support GLESv1 Change-Id: I19c077d2f26c6549bc3d0452314dc2c9ea23b24f
| * Add pre-process pipe for gralloc memory cleanupYahan Zhou2018-08-2314-26/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://buganizer.corp.google.com/issues/29457657 This patch clean up color buffers allocated by gralloc when a guest process is killed. It did two things: (1) It creates a grallocPipe the first time gralloc registers any buffers in a host process. The pipe will be released when the process dies, which triggers a callback function to clean up its color buffers. (2) For color buffer create/open/close, add a new render control function, which passes the guest process id as an additional parameter. Then we keep track of which process is holding which color buffers. The guest processes are identified by generating a 64bit ID for each process from the host. It will need the guest side patch to work: https://googleplex-android-review.git.corp.google.com/#/c/1207896/ Change-Id: I8add9eb8f224cb32ffdfd309bf921c6921230a96
| * Make OpenGL logger thread safeLingfeng Yang2018-08-234-26/+53
| | | | | | | | | | | | | | | | - our opengl command rate is now fast enough to raise STL exception when concurrently using push_back - also fix build error Change-Id: Ief7c2ffb09ea0e5fec300b1e1e3f2679bbd6ad02
| * Make generated encoder compatible with c++98Yahan Zhou2018-08-232-8/+12
| | | | | | | | | | | | Make generated encoder compatible with c++98 for backporting GL changes. Change-Id: I03a5daff3f3766622637350f1264f26a2e5648b8
| * EGLDispatch.cpp: Remove compiler warning.David 'Digit' Turner2018-08-231-1/+1
| | | | | | | | | | | | A function was returning NULL instead of false. Oh my :) Change-Id: I09ed8575add21fa850a9f7ec15208801be4c4f75
| * Fix gl encoder generatorYahan Zhou2018-08-237-11/+4
| | | | | | | | | | | | | | | | | | This patch fix the gl encoder generator scripts. After the fix, the generated encoder should be almost the same as the current one in mnc. The only difference would be 3 flushes in glDraw*, which should be moved to non-generated code later. Change-Id: Ibdbfe6e5c259baae221a955d24fa76df4f2e03a3
| * [style] Remove all pointer initializations of ptr(NULL) styleYurii Zubrytskyi2018-08-2332-657/+847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::shared_ptr<> has a gotcha: its default ctor just zeroes out both pointer to an object and a pointer to a reference count. But if you initialize it with NULL, like in shared_ptr<C> ptr(NULL); ... it would allocate a new reference counter structure. This means we should be careful about our use of shared_ptr-s and don't unnecessarily allocate reference count left and right. This CL takes care of the existing set of (NULL)-initialized pointers - all of them, not just smart ones, - to make sure we got a single common style for them that doesn't waste CPU cycles. + Adds some cref shared_ptr<> returns instead of return by value in the places where we actually don't need copies + Makes sure the POD members are initialized at the declaration point and we don't add extra foo() lines to the ctor init lists. Together it saves about 0.5% of the CPU time spent in the GPU emulation code during Antutu benchmark. It's greater than zero! Change-Id: I56f9ba61013e86196722722451435bc9d9bb4148