aboutsummaryrefslogtreecommitdiff
path: root/shared/OpenglCodecCommon
AgeCommit message (Collapse)Author
2018-08-13Fix compile warnings found in shared/OpenglCodecCommon.Matt Wachowski
Bug: b/80194417 Test: Recompile and look for warnings. Change-Id: Icd4ad776ffbe8daf3e6c3af821149cadf4657d78
2018-05-30Fix glReadPixels when row length != 0pie-devLingfeng Yang
Fixes: 79208762 The pipe encoder assumes the user in the guest side has allocated all the client memory for glReadPixels including the padding between image rows (the total pitch determined by GL_PACK_ROW_LENGTH), but that is not necessarily the case; the guest can have allocated fewer bytes than the row length would suggest. This can cause memory corruption. This CL detects the case when GL_PACK_ROW_LENGTH != 0 and there is a client buffer for glReadPixels, in which case it takes the pipe buffer and only writes the pixels, row by row, to the client buffer, discarding the padding. this cl does not impact real devices Change-Id: I6fde6677897f2717c7ac05bc349225ea1e02243e Merged-In: I6fde6677897f2717c7ac05bc349225ea1e02243e (cherry picked from commit 372c425bd2d1d67eced350383e6369bca1530b4e)
2018-04-23Support GL_RGBA16F and GL_RGB10_A2 pixel sizeYahan Zhou
Also, GL_RGB10_A2 should work with GL_UNSIGNED_INT_2_10_10_10_REV instead of GL_UNSIGNED_INT_10_10_10_2. This cl does not impact real devices. BUG: 77977729 Test: atest CtsNativeHardwareTestCases Change-Id: I01fe508d741b04a7107f0a628b5ccb4ba320daa0
2017-10-27Add more parameter sizeYahan Zhou
GLES3 glGetTexParameterfv and glGetProgramiv support some extra parameters. We add them to the list to suppress warning messages when running Unity games. Test: download and run the game Homescapes, run adb logcat and should not get glUtilsParamSize warnings. Change-Id: Ib540ef50d145127a055ab14d0d550fcc19a7e43f
2017-08-28Fix wrong uniform type in sampler settingLingfeng Yang
Previously, external/2D texture binding setup was not done as often as it should be because the wrong uniform type was specified in setSamplerUniform. This CL allows external/2D textures to restore their bindings more frequently, which can result in more accurate external texture emulation. bug: 37640508 Test: CtsUiRenderingTestCases android.uirendering.cts.testclasses.ColorSpaceTests all pass Change-Id: I0aea07262906dae087b9d0a7c53a368b44d20172
2017-04-14Rename socket_loopback_server to _socket_loopback_server. am: b0a0e2f029 am: ↵Josh Gao
29e7fb8e96 am: c569046cc2 Change-Id: Iea1512ee3ca0eb2a48d01f44742efa99f472e816
2017-04-14Rename socket_loopback_server to _socket_loopback_server.android-wear-o-preview-4android-wear-o-preview-3android-o-preview-4android-o-preview-3android-o-preview-2android-o-iot-preview-5o-iot-preview-5Josh Gao
The master branch of this project gets included in ancient emulator branches, that still have socket_loopback_server in libcutils. Prepend an underscore in the local static implementation to avoid collision. Test: treehugger Change-Id: I458f3aeccee0cfeadc8226d64887ff5d0820c1d7
2017-04-14Update for libcutils socket_loopback_server removal. am: 4b20c7bed3 am: ↵Josh Gao
b86587ffad am: 567fb225a9 Change-Id: I66ed5116614ae15d8e58e7ae75d9b0e1e70f281a
2017-04-13Update for libcutils socket_loopback_server removal.Josh Gao
TcpStream seems to be expecting IPv4 only, since connect has a default address of 127.0.0.1, so add a socket_loopback_server implementation that only listens on IPv4. Bug: http://b/37282612 Test: treehugger Change-Id: I17deae4b4ac9ced36955433dca837b36cd80b11e
2017-01-24[WIP] ES 3.1 guestside changesLingfeng Yang
Change-Id: Ie4619ee6e161274383b9f6b0d2922344da20f62f
2017-01-11[GLESv3] Fix buildLingfeng Yang
Change-Id: I1255b2505eec7ce032992b99c20df4a1dca4394f
2017-01-11[GLESv3] Transform feedback state trackingLingfeng Yang
Needed to pass some negative_api tests involving transform feedback. Change-Id: I7be230bb6432c32641de6bb9249fd00ba3dfe926
2017-01-11[GLESv3] Shader state updatesLingfeng Yang
- Track program pipelines - Track separate shader programs - Track original shader source in guest Change-Id: I8f54089ddf12d03677275cde58ea7f267e410482
2017-01-11[GLESv3] glUtils update for ES 3.xLingfeng Yang
Change-Id: Iaf9b5832af0822d9f663a5365e7ae9a7cee426cc
2017-01-11[GLESv3] FBO stateLingfeng Yang
- Draw/read framebuffers - Multisampled render buffers - Multiple color attachments - GL_DEPTH_STENCIL attachment Change-Id: Ic0f51633a42a14d333b6dc3fb52c6fa9de0bfe17
2017-01-11[GLESv3] ES 3.x buffer stateLingfeng Yang
- VAOs - indexed buffers Change-Id: I743c3e22bdbb67ca0b6cecac6b231cd674a5061f
2017-01-10[GLESv3] Texture state tracking upgradesLingfeng Yang
- TextureUtils to get the low down on all offset/size related calculations (ripped from SwiftShader) - This involves track of all PBO fields - Move TextureRec and friends to GLSharedGroup - Implement new encoder utils to use in encoder Change-Id: Ic6585f49d2928fe965181ec706d5fefa8713e0eb
2017-01-10[GLESv3] versions, es > 2, encoderLingfeng Yang
- Encoder with ES 3.x entry points - Allow ES versions > 2 depending on host capability Change-Id: I71e374f1685610bb0e4f9e04f4bba87b0cbaa02b
2016-11-22Fix glLinkProgram with invalid program nameYahan Zhou
glLinkProgram might try setting up program attributes even when an invalid program name is passed to it. This patch fixes it. BUG: 33069416 Change-Id: I93ed140095b67df47b158ba837c4aac8eb9e8e50
2016-11-04Improve ChecksumCalculatorYurii Zubrytskyi
- Expose the checksum sizes through public constants to allow users to preallocate static arrays for those - Get rid of a slower memcpy() operations in checksum calculation Change-Id: Ieaa92fce7b32b75a5db0f94d505c917ecfa16f74
2016-10-17Fix buildLingfeng Yang
Change-Id: Ib64555ca689cd514139d5a8b712f1266ee38ab49
2016-10-17Speed up draw-call-bound apps with index range cacheLingfeng Yang
Previously, we were looping through the entire index buffer (can be 10^3-10^4+ items) on every draw call, in order to find min/max vertex index. This operation often consumes half or more of the time taken per draw call (from systrace). The min/max vertex index are required if: - we are in some "immediate array" mode where we got an array passed as "offset" argument of glDrawElements (i.e., index buffer 0 bound) - validation (dEQP tests, debugging draw calls where vertex buffer out-of-bounds is in question) ANGLE uses the concept of an "index range cache" in order to avoid recalculating index ranges that are known already. This CL incorporates the IndexRangeCache class from ANGLE, greatly improving glDrawElements run time by making it not depend on the size of the index buffer. It also makes a slight further tweak: if we do not flush every draw call, but instead every two draw calls, we have lower pipe overhead and can get about 1 FPS more. The performance improvement: ~10-20% FPS on non-draw-call-limited GPUs. Linux, Quadro K2200: Antutu v6: ~35->~40 FPS No dEQP GLES2 or EGL regressions were found. Change-Id: I29be0f405c6d3e3257e212912c6af6c6f3e12fa7
2016-09-16[AMD] Fix segfault in glCopyTexImage + cube map luminanceLingfeng Yang
bug: 31523568 In particular, the test dEQP.functional.texture.specification.basic_copyteximage2d.cube_luminance segfaults the emulator on some AMD GPUs. When we define cube maps using glCopyTexImage2D and are using the GL_LUMINANCE internal format, if the negative components of the cube map are defined first, the host AMD driver may segfault (tested in Mobility Radeon and RX 480). The workaround is to detect this particular API call, cube map target, and internal format, and define the positive component first using the same arguments, if the positive component has not been defined already. Change-Id: I26ed25bf3b7358ed7121a52f89d541c325beb6e4
2016-07-18[cherry-pick] Delete some useless filesTina Zhang
Currently, some files are not used by the guest part of GL emulation any more. cherry-pick from https://android-review.googlesource.com/#/c/169695/ Change-Id: I1fb87614aaba19be6863d6fb85e80937d0778384 Signed-off-by: Tina Zhang <tina.zhang@intel.com>
2016-06-21Make build script compatible with klp and upYahan Zhou
It gets rid of c++11 and makes build script compatible with klp and up. It also includes GL headers here, because headers in framework/native might be different across API levels. Change-Id: Ida425416a392cef878256965d69b54afe42b7263
2016-06-01[cherry-pick] Lose HAVE_ANDROID_OS in goldfish.Elliott Hughes
cherry pick from: https://android-review.googlesource.com/#/c/166427 Change-Id: Id626aee8d65e0ded543ac12416c37f938d196676
2016-04-28Merge "glActiveTexture should set GL_INVALID_ENUM when taking wrong input" ↵Yahan Zhou
into mnc-emu-dev
2016-04-15Stricter FBO completeness checksLingfeng Yang
dEQP-GLES2.functional.fbo.completeness.*: 39 Fail -> 0 Fail Based on similar logic in Swiftshader's libGLESv2/libGLESv2.cpp Also cache the result of glCheckFramebufferStatus, if already called from somewhere else. Change-Id: I3fb42dd6902cfce4043d08fd459a7069ef491f7e
2016-04-15Validate presence of framebuffer attachment's objectLingfeng Yang
dEQP-GLES2.functional.negative_api.state.get_framebuffer_attachment_parameteriv Fail -> Pass dEQP-GLES2.functional.fbo.api.attachment_query_empty_fbo Fail -> Pass Track texture and renderbuffer object associations to framebuffer attachment points. Change-Id: Iff646bc57ef0202105768123cfa99384f37b01a3
2016-03-16Checksum for GLES messages from host to guestYahan Zhou
Add checksum for GLES messages from host to guest. This patch contains generated code (gl_enc.cpp, gl2_enc.cpp, renderControl_enc.cpp) and shared code with the host (ChecksumCalculator.cpp, ChecksumCalculator.h). Change-Id: I577a34cae5208d3f11a165f861a69fa0971cf864
2016-03-15Checksum for GL pipe communicationYahan Zhou
This is the guest side implementation for cl go/oag/c/207292. It initializes checksum whenever a renderControl is created. Each HostConnection owns a checksum structure. The list contains mostly auto-generated code by emugen. Change-Id: I5f7bb9ec8a0cea82f3687f8a15839081651fd841
2016-03-02Cache glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, int*).Lingfeng Yang
BUG: https://buganizer.corp.google.com/issues/27418143 If we don't, the chatter over the pipe will kill framerate. I believe this is OK for the emulator, as the parameter is dependent on only the GPU hardware. Change-Id: I9bd74de6317316902bddf54b915ef509625cee52
2016-03-01glActiveTexture should set GL_INVALID_ENUM when taking wrong inputYahan Zhou
The GL spec says it generates GL_INVALID_ENUM if taking a wrong input. Currently it generates GL_INVALID_OPERATION which is not the expected error code. Change-Id: I3313ad49130651d0358dbd3bdeb67b7e2d4fd5d9
2016-02-10Support glDrawElements with GL_UNSIGNED_INT in the encoderYahan Zhou
Currently glDrawElements with type GL_UNSIGNED_INT is not supported by our encoder and decoder. The emulator will crash if someone uses it. This patch add the support in the encoder side. The related issue is here: b.android.com/200338 The patch on the decoder: https://android-review.googlesource.com/#/c/202101 Change-Id: I9a6cde9983d34f39cfcc8c66a7ccf021dd5963eb
2016-02-01Clean up minor opengl errors/warnings.Lingfeng Yang
There are always disconcerting messages printed to logcat whenever developing apps on the emulator. glUtilsParamSize and other functions often fail with "unknow param 0x00..." These are missing GLenums and types that for some reason are not in glUtils.cpp in OpenglCodecCommon. There also has been a long-standing warning that eglSurfaceAttrib is not implemented. It seems we don't need to implement that to get things done, so we will give a no-op implementation that suppresses the warning. Change-Id: I1b672cedf1672fc09cfe6a832f908e1496cc7a46
2014-12-11Add parameters validation to glShaderSource() APITina Zhang
According to GLES2.0 Spec., add parameters validataion to glShaderSource() API. Change-Id: I5b0e939fd9657ccbb40a13896c8fc74ef02fd085 Signed-off-by: Tina Zhang <tina.zhang@intel.com>
2014-11-17Properly initialize GLClientState's m_statesbohu
The data pointer of m_states[i] should be initialized to 0; otherwise it contains garbage. Change-Id: Ibfa9bb6fec395de6ac98a3e6b91d4c6ff4143f2c
2014-11-06Unbind buffer when buffer is deletedbohu
When buffer is deleted, it should be un-bind also. Also fix error code related to buffer Change-Id: I3e7ec88399822469a36119c2de03157a2bbea812
2014-10-30opengl: Remove compiler warnings.David 'Digit' Turner
Simply remove multiple compiler warnings about unused parameter. Note that this modifies three auto-generated files, which will require fixing the 'emugen' program in the future. Change-Id: I19edce7c6480770b893d033ed6b1c65744091d62
2014-10-17Guard against negative width and heightbohu
When negative width or height passes into pixelDataSize, some bogus values are returned. This commit checks both width and height to make sure they are valid. Change-Id: Ia49a9f464e6bb4894207ca4e07bbfdf34fbe741d
2013-11-09Delete buffer data when removing it from the SharedGroup namespaceJesse Hall
Updating or deleting data associated with a buffer object was clearing the name->data association, but not actually deallocating the data. Thanks to manjian2006 for finding the bug and proposing the fix. Bug: 60468 Change-Id: I477f1e67d33a486419127ac790f32ddbbf566089
2013-04-09Add liblogYing Wang
Bug: 8580410 Change-Id: I2c07b8ce85aff341575ee8c3f509f64e252b8ed4
2013-03-11migrate opengl and system from development/toolskeunyoung
- components under system are moved one directory up like all other HALs Change-Id: I03b870b870d83b247ac398cadfb155f03c9adfa0