Changyeon Lee [Wed, 22 Jun 2022 10:24:14 +0000 (19:24 +0900)]
build: Remove BuildRequires libtbm-vigs
libtbm-vigs dependency is removed
Change-Id: I3a7e9dfe5197e55dcdb4e2427eb6b9e1cc1cbcb0
byungchul.so [Mon, 9 May 2022 06:50:08 +0000 (15:50 +0900)]
build: use /hal/lib64 runpath for x86_64
Change-Id: Icaee3d90e2e0be7c796d3a361e816afdbd1a171f
byungchul.so [Fri, 1 Apr 2022 05:58:10 +0000 (14:58 +0900)]
Version Up
Change-Id: I04eb71341b57c8fdd04f7955055c401d588017de
Lukasz Kostyra [Tue, 16 Feb 2021 07:23:30 +0000 (08:23 +0100)]
Logger: Enable dlog logging and log messages in one line
Change-Id: I596372e265a1d679b294306fb692ec94bb00cbc7
byungchul.so [Mon, 13 Dec 2021 04:03:33 +0000 (13:03 +0900)]
Invoke yagl_gles2_context_prepare_framebuffer in glClear for GLESv2/GLESv3
- glClear can be used to clear entire framebuffer. Therefore invoke
yagl_gles2_context_prepare_framebuffer in glClear for GLESv2/GLESv3
to write back clear result if the fb is binded with texture that
targets from an eglimage.
Change-Id: I591bdb1a6ebfd36afc948a070dd25089fed5be60
byungchul.so [Mon, 13 Dec 2021 03:05:48 +0000 (12:05 +0900)]
Support offscreen rendering for TBM_FORMAT_ARGB8888 tbm buffer
- Assume below events:
...
// Use TBM_FORMAT_ARGB8888 tbm buffer for offscreen rendering. The tbm buffer is used as
// native buffer for an eglImage and the texture binded with the eglImage is attached to
// framebuffer object.
tbm_buffer = tbm_surface_create(w, h, TBM_FORMAT_ARGB8888);
EvasGLImage *evas_image = evasglCreateImageForContext(evas_gl, evas_gl_ctx,
EVAS_GL_NATIVE_SURFACE_TIZEN, tbm_surface, attrs);
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glEvasGLImageTargetTexture2DOES(GL_TEXTURE_2D, evas_image);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
Rendering something here...
// Bind default framebuffer after rendering...
glBindFramebuffer(GL_FRAMEBUFFER, old_framebuffer);
...
- The TBM_FORMAT_ARGB8888 tbm buffer should have rendering result after
finishing rendering but it's not because offscreen rendering for TBM_FORMAT_ARGB8888
tbm buffer not supported yet in the YAGL. This patch fixes this issue.
Change-Id: I0af2253e9d69fd20b45280a4c3380e5da1488d2a
Lukasz Kostyra [Tue, 2 Nov 2021 10:21:19 +0000 (11:21 +0100)]
yagl_glsl_state: Prevent division by zero in yagl_glsl_state_pp_solve_binary
Resolves coverity issue CID 1241990
Change-Id: Ie60284afee63a108d9b2f10ffc07e9cc04363909
Lukasz Kostyra [Wed, 20 Oct 2021 09:31:15 +0000 (11:31 +0200)]
yagl_gles3_program: Prevent buffer overflow
Fixes defects WGID 467867 and WGID 467868
Change-Id: I03fca7c5af1d52b6f644c4517e09ee2e931d51c7
Lukasz Kostyra [Tue, 19 Oct 2021 09:17:03 +0000 (11:17 +0200)]
yagl_gles3_program: Replace strcpy with strncpy for safety
Fixes defect WGID 443657
Change-Id: I0c57b2b7f23175e218d17dce6320af51550f238b
Lukasz Kostyra [Fri, 15 Oct 2021 12:13:11 +0000 (14:13 +0200)]
yagl_gles1_calls: Remove useless condition check in glPointParameter*
Fixes defect WGID 443651
Change-Id: Ia5ffab9da9f2cde329e94813bc1a6ff9315437a2
Lukasz Kostyra [Fri, 15 Oct 2021 11:41:13 +0000 (13:41 +0200)]
yagl_log: Replace strcat with strncat in yagl_log_func_enter_split
Fixes defects WGID 106406 and WGID 289901
Change-Id: I01ff4890be3a803be476d1f01025e66222eec122
Lukasz Kostyra [Fri, 15 Oct 2021 11:11:48 +0000 (13:11 +0200)]
yagl_tizen_window: Fix potential NULL dereference
Fixes defect WGID 443650
Change-Id: I78718e64ef45510a0872062a7812c3aec4b9860f
Lukasz Kostyra [Fri, 15 Oct 2021 10:24:58 +0000 (12:24 +0200)]
yagl_tizen_native_image: Fix potential NULL dereference
Defect WGID 443637
Change-Id: I785a6c56bcfb5562303c7de1b87fa82e1994dac3
Lukasz Kostyra [Thu, 7 Oct 2021 08:19:24 +0000 (10:19 +0200)]
yagl_glsl_parser: Fix invalid placement of set_last_sampler_array_count
When parsing non-array uniforms, there was a possibility that a parsed
uniform was not a sampler. Despite that, set_last_sampler_array_count
was called, which could trigger an assertion.
This fixes boot issues on wearable image, as wearable image EFL was
using some shaders exploiting this corner case.
Change-Id: Icf3363f6c6622047ecbafa68a68e3bbc385e1471
Lukasz Kostyra [Wed, 6 Oct 2021 12:08:08 +0000 (14:08 +0200)]
yagl_glsl_parser: Fix support for uniform arrays
Uniform arrays were incorrectly processed by GLSL ES parser, which in
some situations resulted in shader compilation errors. Uniform array
support has been added and sampler replacement code has been slightly
adjusted to read amount of sampler units from shader code.
Note that this only fixes shader parsing code to allow successful
compilation of shaders. This does NOT yet add full support for
samplerExternalOES uniform arrays for GLES 2 and above.
Change-Id: I24ead4473eb51e3e9d13b39fd98186763c6a5384
Lukasz Kostyra [Tue, 17 Aug 2021 11:26:08 +0000 (13:26 +0200)]
yagl_glsl_state: Early exit on cleanup when Shader was not initialized
There might be situations like:
glCreateShader(shader, ...);
glDestroyShader(shader);
This would crash since yagl_glsl_state is initialized only when
glShaderSource() is called. Situation is now fixed.
This fixes gl-getshadersource WebGL browser test.
Change-Id: Icd8fa28bc1866f4f6cd3f199fb5a8ad724d71573
Signed-off-by: Lukasz Kostyra <l.kostyra@samsung.com>
Sylwester Nawrocki [Thu, 20 May 2021 15:50:41 +0000 (17:50 +0200)]
Prevent an out of array bounds access in yagl_glsl_state_pp_condition_parse_add_op()
While moving higher or equal priority operations to expression stack in
yagl_glsl_state_pp_condition_parse_add_op function the state->pp_ops
array could be accessed with index -1. Reorder the while() expression
to avoid an out of array bounds access. This fixes an issue indicated
with SVACE warning:
* OVERFLOW_UNDER_CHECK: Buffer 'state->pp_ops' of size 64 accessed at
yagl_glsl_state.c:640 can overflow, since its index 'state->pp_current_op
- 1' can have value -1 that is out of range, as indicated by preceding
conditional expression at yagl_glsl_state.c:640.
[overflow] overflow at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640
[check: Sub] Sub at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640
[declaration] Shift at emulator-yagl-1.6/GLESv2/yagl_glsl_state.c:640
Change-Id: I2cb6a16ce6c3302f8a2dd4fe92bd8bfbec11c5ca
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
byungchul so [Mon, 29 Mar 2021 07:43:24 +0000 (07:43 +0000)]
Merge "EGL: erase libtbm-vigs dependency" into tizen
Junkyeong Kim [Mon, 29 Mar 2021 07:31:28 +0000 (16:31 +0900)]
EGL: erase libtbm-vigs dependency
use libhal-backend-tbm-vigs only.
Change-Id: Ide48f8395dab329f300044dcd0b8dd2ee6bc8522
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
Chanwoo Choi [Fri, 26 Mar 2021 08:56:55 +0000 (17:56 +0900)]
EGL: Fix linking issue to add runpath for accessing /hal/lib path
On Tizen 6.5, the install path of hal backend is changed
from /usr/lib to /hal/lib. In order to fix this linking issue,
add the runpath option for accessing /hal/lib path.
Change-Id: I04d9872d795091c560ace11c28e19b17a9c58fa7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Junkyeong Kim [Fri, 5 Mar 2021 02:26:23 +0000 (11:26 +0900)]
EGL: use libhal-backend-tbm-vigs
Change-Id: I567abfab3dff0306d61476c0fc95f09c24ddfcda
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
Lukasz Kostyra [Tue, 16 Feb 2021 13:34:24 +0000 (14:34 +0100)]
GLSL parser: Rework precision qualifier patching
Since precision qualifiers can be used in multiple places (or can be
provided using preprocessor), they are now handled by adding following
statements to shader header (if needed):
#define highp
#define mediump
#define lowp
Parser has been adjusted to pass forward precision qualifiers instead of
patching them.
Change-Id: I002fb62b7ddee0d00a81a60f6b082694c2f9653e
Lukasz Kostyra [Fri, 22 Jan 2021 16:12:16 +0000 (17:12 +0100)]
Keep sampler information with Program object & cleanup
GL/GLES specification allows (and recommends) following sequence of
events:
glAttachShader(); glAttachShader();
glLinkProgram();
glDetachShader(); glDetachShader();
glDeleteShader(); glDeleteShader();
This makes program->vertex_shader and program->fragment_shader NULL
and forgoes any information regarding sampler types, which was used
for pre/post draw calls and TEXTURE_EXTERNAL_OES support. This
information is now cached in program object and all further actions
related to them refer to these cached copies.
Additional:
* Assume sampler uniform value to be 0 (as per GLES spec)
* Adjust some logging and cleanup code
* glTexParameter* functions are now recognizing TEXTURE_EXTERNAL_OES
target and react accordingly
* glGetActiveUniform() returns correct type of uniform to user if
uniform type is samplerExternalOES
Change-Id: Ib5f35730dd9f2f0139780a735ea8ec4f7ba84609
Lukasz Kostyra [Thu, 21 Jan 2021 17:49:50 +0000 (18:49 +0100)]
Replace vertex shader external textures & fix some issues
Vertex shader, just like fragment shader, has access to samplers.
This patch enables rebinding textures used in vertex shader, which
could be of type samplerExternalOES.
Additional issues fixed:
* Shader Program could be vertex-only. This caused crashes, which
are now fixed.
* Condition resolution in GLSL parser was incorrect and has been fixed
Change-Id: I2c30b1c30ae9d75467e2c6dd4f4e128adc630320
Lukasz Kostyra [Mon, 18 Jan 2021 11:34:14 +0000 (12:34 +0100)]
Recognize preprocessor functions in GLSL code
On some situations preprocessor code can contain functions.
For now this code is recognized and ignored in order to not produce
syntax errors.
Change-Id: I1e80fc4f07a39dac1c112b7816efb0a813d091f9
Lukasz Kostyra [Fri, 15 Jan 2021 13:18:34 +0000 (14:18 +0100)]
Cleanup GLSL parser/lexer code
* Improved precision qualifier flushing
* Clarified shift/reduce ambiguities
* Removed deprecated %name_prefix directive warning
Change-Id: Ib740538a67e6f5e6a13a8e35b2caae51874636fa
Lukasz Kostyra [Fri, 15 Jan 2021 12:09:12 +0000 (13:09 +0100)]
Add GLSL lexer/parser support for uniform arrays
Using uniform arrays caused syntax error. GLSL lexer/parser now
understands these statements.
Change-Id: Ia5345594ab356fa3977447fe6f3434a06371f946
Lukasz Kostyra [Fri, 8 Jan 2021 10:59:47 +0000 (11:59 +0100)]
yagl_glsl_parser: Reorganize precision qualifier parsing
It is possible for uniforms to have precision qualifier assigned to
them. GLSL lexer/parser now properly discovers such situations.
Additionally, following issues were found and fixed:
* Invalid logging format for yagl_gles2_context_pre_draw warnings.
* Uninitialized variable issues with yagl_glsl_state_pp_resolve_define.
* GL_TEXTURE_EXTERNAL_OES targets having no texture target assigned,
causing debug assertions to fail on use.
Change-Id: Id01c84ed72f8c2a96a4f3d22bdc3c6a96eaaa803
Lukasz Kostyra [Thu, 7 Jan 2021 12:56:41 +0000 (13:56 +0100)]
Implement parsing of preprocessor condition directives
Some #define statements could be hidden beneath #if/#elif/#else/#endif
blocks. In order to properly recognize them YaGL shader parser now
recognizes and evaluates these blocks.
Change-Id: I1c9c0d4237b9796dbad9e9d6ef0cad9e4b3196ae
Lukasz Kostyra [Tue, 29 Dec 2020 11:08:05 +0000 (12:08 +0100)]
Parse GLSL #define preprocessor macros
GLSL lexer/parser now handles #define macros in order to properly
discover samplerExternalOES/sampler2D type.
Change-Id: I77f01bb722d31f980bf8a1d6b00a717c108a15b0
Lukasz Kostyra [Wed, 23 Dec 2020 22:01:01 +0000 (23:01 +0100)]
Bind external textures via 2D texture targets
Change-Id: I56a834f01c3fdc862ed06a2e616f83600b425490
Lukasz Kostyra [Tue, 22 Dec 2020 19:55:25 +0000 (20:55 +0100)]
Collect available samplers with their names
Flex/Bison parser is used to additionally collect what names of
sampler2D's/samplerExternalOES's are added.
This will be used in upcoming commit to resolve issues with
samplerExternalOES usage.
Change-Id: I5d1349a83ba5531a9bf5a97a6d18fadc9b8734f9
Lukasz Kostyra [Tue, 22 Dec 2020 16:14:55 +0000 (17:14 +0100)]
Keep shader state cached for further analysis
Change-Id: I55dac1c67109bb867af39079def0bcb827b925ff
Sylwester Nawrocki [Mon, 12 Oct 2020 15:26:27 +0000 (17:26 +0200)]
YaGL: Avoid potential null pointer dereference in glGetUniformLocation()
Avoid passing a NULL name argument to function
yagl_gles2_program_get_uniform_location() as that function will
dereference the pointer without checking.
When the name argument is NULL make the function return value -1,
which according to OpenGL/GLES specification indicates that name
contains an invalid value/string.
This suppresses a SVACE warning:
* DEREF_AFTER_NULL: After having been compared to NULL value at yagl_gles2_calls.c:1096,
pointer 'name' is passed as 2nd parameter in call to function 'yagl_gles2_program_get_uniform_location'
at yagl_gles2_calls.c:1100, where it is dereferenced at yagl_gles2_program.c:373.
[dereference] Variable 'name' is passed to function 'yagl_gles2_program_get_uniform_location'
as 2nd parameter at GLESv2/yagl_gles2_calls.c:1100
[null check] null check at GLESv2/yagl_gles2_calls.c:1096
Change-Id: Id4a4315e6c48eebf2c4047c158faa5bf54897e18
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 9 Oct 2020 18:05:31 +0000 (20:05 +0200)]
YaGL: Prevent potential null pointer dereference in eglCreateImageKHR()
In case yagl_validate_context() fails ctx is NULL and as such will be
dereferenced at end of the function (ctx->client_ctx->sg). Fix this
by testing ctx before the yagl_sharegroup_mutex_unlock_if_shared() call.
yagl_context_release(ctx) is safe as it tests for null internally.
This suppresses SVACE warning:
* DEREF_OF_NULL.EX: After having been assigned to NULL value at yagl_egl_calls.c:1746,
pointer 'ctx' is dereferenced at yagl_egl_calls.c:1923.
[dereference] Dereference at EGL/yagl_egl_calls.c:1923
[assignment] Null assign at EGL/yagl_egl_calls.c:1746
Change-Id: I7d67eed012cd03d320fc49a92e567fedf69ead46
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 9 Oct 2020 17:22:21 +0000 (19:22 +0200)]
YaGL: Prevent potential null pointer dereference in yagl_render_finish()
This suppresses SVACE warning:
* DEREF_OF_NULL.RET.PROC.STAT: Return value of a function 'yagl_get_context' is dereferenced at yagl_render.c:78 without checking,
but it is usually checked for this function (10/11).
[dereference] Dereference at /home/abuild/rpmbuild/BUILD/emulator-yagl-1.6/EGL/yagl_render.c:78
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:2421
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:2102
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1457
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1418
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1293
[counter-example] counter-example: yagl_get_context at EGL/yagl_egl_calls.c:1012
Change-Id: Ie8d33b96af61e9a15e2a5ece46cdd6e63acc2d24
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Lukasz Kostyra [Mon, 7 Sep 2020 15:18:00 +0000 (17:18 +0200)]
EGL: Fix minor incosistencies with specification
Change-Id: Ie0ee72ce6299b31e0d61a282b93498b08f4680cc
Lukasz Kostyra [Mon, 7 Sep 2020 09:04:56 +0000 (11:04 +0200)]
GLES: Perform additional transport flushes
On some rare cases there still was a multithreading issue with resource
sharing across GL contexts. Ensuring glBind*() calls flush the transport
queue eliminates these cases.
Additionally removed sharegroup locking and flushing for Framebuffer
objects - these, according to specification, are not shared between
contexts (and so, between threads) and thus don't require extra
implicit synchronization.
Change-Id: If696ab64d553f6aadca39cd0044c533d35c064d8
Lukasz Kostyra [Thu, 23 Jul 2020 14:11:40 +0000 (16:11 +0200)]
Implement thread safety when sharing EGL context
- glGen* and associated calls now lock a sharegroup-global mutex.
- glGen* and glDeleteObjects host calls flush the transport
to ensure resource is created before recording more calls.
- Some instances of yagl_host_glDeleteObjects being called were removed
because they caused the same assertion to fail - these could remove
a texture which was next bound.
Change-Id: Iea1b71062f25bc48a6aa583f7074801d416574a8
Lukasz Kostyra [Fri, 3 Jul 2020 10:51:40 +0000 (12:51 +0200)]
Remove dummy libraries
Following commit removes dummy EGL/GLES libraries and implements
discovery of /dev/yagl in libEGL.so.
If /dev/yagl is missing (ex. there is no host GPU available), libEGL.so will
fail any EGL function. This will make it impossible to create a functioning
GLES context, which will make GLES functions exit early, on YAGL_GET_CTX() calls.
Change-Id: I758496c39806c854315399a2b5c33ca688a8573c
Dongkyun Son [Tue, 31 Dec 2019 05:14:29 +0000 (14:14 +0900)]
[Tizen 6.0] Silence build warnings for GCC 9.2 build
Change-Id: I7aa3dfc39a9ca9748b779b4c71c57ec129e693da
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Mikhail Labiuk [Tue, 7 Aug 2018 17:04:51 +0000 (20:04 +0300)]
Modify decision for window reset by checking tpl_surface_validate
Call tpl_surface_validate before dequeue to check if it needs to be reset.
Change-Id: I346ca23f4d85c7f8e3f174ac79a9bdf83cf7652e
Signed-off-by: Mikhail Labiuk <m.labiuk@samsung.com>
Vladislav Andresov [Thu, 31 May 2018 04:43:52 +0000 (07:43 +0300)]
Add handling of new format XBGR
Currently this format can be used only for output images
which would be product of rendering.
Change-Id: Ic3a7c5fe2e2c528059dc41a4df868268720c94a9
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
Vladislav Andresov [Mon, 18 Jun 2018 19:55:58 +0000 (22:55 +0300)]
Add fixes for video360 issue
- set internal format GL_RGBA as default
for texture images;
- fix creating of dummy VIGS surfaces while
eglCreatePbufferSurface is called with zero sizes.
Change-Id: Ic08c464fc010b9b01a5b893f392d589b531bb4bf
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
SooChan Lim [Thu, 22 Mar 2018 11:47:28 +0000 (20:47 +0900)]
Do not use the tbm_bufmgr_backend.h file
libtbm-vigs provides the drm_dev to get the vigs_drm_device.
yagl can also get the vigs_surface through the tbm_bo_get_handle.
Change-Id: Iba180f60b101886ae940b2eb1f5b7c5617d5eda9
Jinhyung Jo [Thu, 7 Dec 2017 12:18:23 +0000 (21:18 +0900)]
YaGL: add new rule for texture2D in GLSL
The GLSL patchers did not work correctly with a statement like bellow:
#define TextureLookup texture2D
The token 'texture2D' in the comment is not parsed with desired result.
So, add a new rule for that situation.
Change-Id: I84ae9166c0d322baf48d1c20bb74a1c27172c59f
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
joonbum.ko [Wed, 6 Dec 2017 04:13:57 +0000 (13:13 +0900)]
Modified to completely unref the unused GEM memory.
tbm_surface is dequeued from tpl_surface,
but window does not want to use it(window resized or destroyed),
then we have to cancel it to complete destroying using below API.
- tpl_surface_cancel_dequeued_buffer(tpl_surface_t *, tbm_surface_h)
Change-Id: Ib4d5798d29111aa0ef0b74e9e3986abdf2665c4d
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
Vladislav Andresov [Thu, 5 Oct 2017 14:12:21 +0000 (17:12 +0300)]
YAGL: Add hardware conversion for YUV420 format
Change-Id: Icf94edd832657527f940c0815653f0365e47d166
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
Vladislav Andresov [Wed, 16 Aug 2017 13:15:56 +0000 (16:15 +0300)]
Add hw y-inverting for ARGB images
Change-Id: I9ee0fd94cb773d326a18074aa99d4576d5ac9639
Signed-off-by: Vladislav Andresov <v.andresov@partner.samsung.com>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Wed, 26 Apr 2017 11:59:27 +0000 (14:59 +0300)]
Ensure fence_dpy is setup for all threads
This is needed in order to be able to create fences in transport layer
and avoid race conditions when invoking yagl_host_* routines with return
values. Previously fence_dpy was assigned only in eglGetDisplay. Though
the app may make EGL calls from auxiliary threads which will have
fence_dpy uninitialized.
Change-Id: Ibe66030cb4a30d189750d1ab233164cfea60b339
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Fri, 9 Dec 2016 10:06:48 +0000 (13:06 +0300)]
Avoid using yagl_host_handle when acquiring images
yagl_host_handle is defined as uint32_t, while EGL image client handle
(either EGLImageKHR or GLeglImageOES) is void *. On x64 arch the cast to
yagl_host_handle will lead to data truncation and as a result the image
may not be found.
Change-Id: I02e8a14326c635d0f6bcb0e9b289a0467c846f1f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Fri, 23 Dec 2016 17:14:20 +0000 (20:14 +0300)]
Fix wrong host texture binding
The call sequence like bellow was causing flickering:
glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
glBindTexture(GL_TEXTURE_2D, 0);
glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);
Eventually zero texture was used on the host side since external
textures are currently handled as GL_TEXTURE_2D.
Change-Id: I9d8480df7dd5f44f49f31e170de6f478c663f8c3
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
joonbum.ko [Mon, 28 Nov 2016 08:29:58 +0000 (17:29 +0900)]
Y-invert ARGB images
This patch resolves the issue with widgets rendered upside-down. Tizen
platfrom expects 'yinvert == 1' for EGL images created from tizen sfc.
Change-Id: If34b0c717f705a13351d94b50361b2a6d5945998
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 1 Nov 2016 17:23:29 +0000 (20:23 +0300)]
Fix yagl setup script for x64 arch
Driver path can be either /usr/lib/driver or /usr/lib64/driver.
Change-Id: I133ea4aa0152f396d3c7ebd4b61dd9fbac8bbfb5
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Jinhyung Jo [Fri, 28 Oct 2016 06:20:37 +0000 (15:20 +0900)]
YaGL: modify lib path
The lib path in the 64-bit architecture was missing.
I modify the lib path.
Change-Id: I65e0ebbce42a782605b4d2c764fc5ba596603db0
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Slava Barinov [Tue, 20 Sep 2016 14:52:59 +0000 (17:52 +0300)]
Build: ASan build support added
Address Sanitizer support requires adding pthread in the end of list
Change-Id: I8db1b86e394002baf4418b7494d7497047b65be8
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Vasiliy Ulyanov [Mon, 4 Jul 2016 10:09:28 +0000 (13:09 +0300)]
YaGL: Add tpl surface validation
With EFL a 1x1 surface is created at first and then it is resized. There
is a need to handle such situation before drawing GL stuff and
invalidate the renderer.
Change-Id: Ic11cbae921d1f486f1a81fa1633c6f64d5673efe
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Mon, 26 Sep 2016 13:04:15 +0000 (16:04 +0300)]
Add RGBA8888 format support for EGL tizen sfc ext
This format requires convertion to ARGB.
Change-Id: Ia9ade3d84b3d061c5f713457e6ac0e2cbae31418
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 13 Sep 2016 16:10:37 +0000 (19:10 +0300)]
Ensure drm gem is always 'named'
When creating EGL image from tizen surface, the underlying gem may have
no name assigned. This ends up with client handle set to zero. The commit
fixes such an issue.
Change-Id: Ica907a251d9a64a8661232e2718930caa052e0a3
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Mun, Gwan-gyeong [Tue, 9 Aug 2016 07:05:19 +0000 (16:05 +0900)]
Build: Remove link of libGLESv1_CM.so on /usr/lib
CoreGL supports libGLESv1 so emulator-yagl does not need to make link of libGLESv1_CM
Change-Id: I68ff61626524c8ffcd82733c83bcc7604d061256
jin-gyu.kim [Fri, 29 Jul 2016 05:48:58 +0000 (14:48 +0900)]
Define PATH variable in the script file.
Change-Id: Iffc998df2d3a1400bd3d18f5b28b6968ecd19400
Vasiliy Ulyanov [Thu, 21 Jul 2016 12:58:28 +0000 (15:58 +0300)]
YaGL: Check for GPU acceleration on boot
If emulator is run without host GPU acceleration, yagl will likely
terminate GL apps on initialization failure. In order to handle the
situation propely, dummy GL libs are now packed along with yagl. When
emulator boots up, a script will check if /dev/yagl is present and
setup the symlinks appropriately.
Change-Id: I6715c5798b0c2a6cdef16a24a1e3c8786f6aa36f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 19 Jul 2016 15:17:56 +0000 (18:17 +0300)]
YaGL: Fix debug build for x64 platform
Ponters cannot be cast directly to integers of different size with
'-Werror=pointer-to-int-cast' gcc option. The commit fixes this issue
when making a build with debug logs enabled.
Change-Id: I401e5230af0f08b97a3597c05368f4859ed9d949
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Mon, 20 Jun 2016 13:48:54 +0000 (16:48 +0300)]
YaGL: Fix required texture image units query
GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is now accepted as parameter name in
glGetTexParameterfv.
Change-Id: I7bdc3635262b28826f225395a76048d897710eb6
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Wed, 24 Feb 2016 13:30:23 +0000 (16:30 +0300)]
YaGL: Add more strict error checking
- glLinkProgram: linking should fail if vertex and fragment
shaders are not both present in the program object.
- glBlitFramebuffer: if the source and destination buffers
are identical, an INVALID_OPERATION error should be generated.
NOTE: valid only for OGLES3.0. Not the case with e.g.
GL_ANGLE_framebuffer_blit.
Change-Id: I0fdc4e383e32e9cfcb9028f4b279b8acdb8410c7
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 14 Jun 2016 08:00:19 +0000 (11:00 +0300)]
YaGL: Fix license issues
- COPYING: XFree86 -> MIT
- LICENSE: LGPL3.0 -> LGPL3.0+
Change-Id: I90e9129f0098c38ef30eeb409dc627e2df70c6dd
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Thu, 26 May 2016 10:12:03 +0000 (13:12 +0300)]
YaGL: Redefine samplerExternalOES in GLSL
The former external sampler hadnling did not work correctly with
statements like bellow:
#define SamplerType samplerExternalOES
Using a #define construct in the header for samplerExternalOES seems
more appropriate rather than substituing every occurrence.
Change-Id: If1c654046ad78011a5148013889f5dc93882a6a9
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Thu, 11 Feb 2016 09:12:23 +0000 (12:12 +0300)]
YaGL: Y-invert YUV images
EGL images created from tbm surfaces appear flipped vertically.
In case of planar data we have to make conversion anyway so it
can be handled as well.
Change-Id: I8242bdffdd1f0340b616cb1f5912ea51a5c27026
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Mon, 1 Feb 2016 15:32:47 +0000 (18:32 +0300)]
YaGL: Implement GL_OES_EGL_image_external extension
Currently external textures are handled as 2d textures since
host will unlikely recognize GL_TEXTURE_EXTERNAL_OES as a valid
target. The same applies to GLSL (i.e. sampler2D is used instead
of samplerExternalOES). Color conversion is performed in software
and it is done when glEGLImageTargetTexture2DOES function is
called. It is an initial implementation and at the moment it is not
fully conformant.
Change-Id: I6a781d1062a2f5373e8ff507a5279c58ed29b042
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 24 May 2016 11:10:13 +0000 (14:10 +0300)]
YaGL: Fix debug build with tizen platform
The macro YAGL_LOG_FUNC_SET initilizes logger specific local vars like
pid, tid, etc. There is no need to use it if the function actually does
not produce any logs, since it may lead to 'unused variable' compiler
errors.
Change-Id: I9f9c2ccba7b8364d60891a1748fc62d5b2516fbf
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 10 May 2016 10:03:42 +0000 (13:03 +0300)]
YaGL: Add back buffer null check in get_buffer_age
Change-Id: I53b79769401aae2a1e8a7f9e58637473f1cd3299
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Mun, Gwan-gyeong [Mon, 2 May 2016 11:31:27 +0000 (20:31 +0900)]
Build: Recover build architecture (x86, x86_64) and emulator bcond on rpm spec file
Change-Id: I27bc19e40273bf84f505001baadbd169ee80272f
Xuelian Bai [Thu, 28 Apr 2016 19:51:31 +0000 (03:51 +0800)]
porting YAGL to TIZEN platform
This patch ports YAGL to TIZEN platform as an
initial version, creates following files:
EGL/tizen/yagl_tizen_display.c
EGL/tizen/yagl_tizen_display.h
EGL/tizen/yagl_tizen_native_image.c
EGL/tizen/yagl_tizen_native_image.h
EGL/tizen/yagl_tizen_pbuffer.c
EGL/tizen/yagl_tizen_pbuffer.h
EGL/tizen/yagl_tizen_platform.c
EGL/tizen/yagl_tizen_platform.h
EGL/tizen/yagl_tizen_window.c
EGL/tizen/yagl_tizen_window.h
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
Change-Id: I639dc736f242096ba417054576453ea941113eea
Mun, Gwan-gyeong [Wed, 20 Apr 2016 16:37:18 +0000 (01:37 +0900)]
Change GLESV1_CM symbolic link for COREGL
Change-Id: I970f8d859ba8a1d565219f304bbd2451feff2194
Vasiliy Ulyanov [Tue, 5 Apr 2016 10:52:36 +0000 (13:52 +0300)]
YaGL: Fix LICENSE.MIT text
Change-Id: I4fda882a7ea7f3604025d4c5574dcb17c530ef7f
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Wed, 16 Mar 2016 12:34:19 +0000 (15:34 +0300)]
YaGL: Disable ETC1_RGB8_OES format check
OES_compressed_ETC1_RGB8_texture spec says:
INVALID_OPERATION is generated by CompressedTexSubImage2D,
TexSubImage2D, or CopyTexSubImage2D if the texture image <level>
bound to <target> has internal format ETC1_RGB8_OES.
Currently this error check causes problems with some apps so
temporarly disable it as a workaround.
Change-Id: I8bdc6f2b7a7b65730d4dee9a8a91b9f6ce465485
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 15 Mar 2016 08:56:29 +0000 (11:56 +0300)]
Revert "YaGL: Mark glGenTextures call as flushing"
This reverts commit
246a7db9c03797276b650b955139210c04f80e84.
The race condition was occuring because of improper glFinish
call handling with surfaceless context. The commit also adds
explicit transport flushing to ensure all the rendering commands
are offloaded to the host in this case.
Change-Id: Ic70d7f82904c1636acc495fb2e500115f62c6125
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Sat, 12 Mar 2016 14:10:12 +0000 (17:10 +0300)]
YaGL: Mark glGenTextures call as flushing
This is a workaround for web-tct. There seems to be a race
condition with these tests (i.e. they are rendering from
several threads without ensuring GL synchronization). The
commit should be reverted as soon as a proper fix is applied.
Change-Id: I095e76f0d9c84e7623035ca24817cfc98e7a2ae5
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Thu, 3 Mar 2016 15:14:47 +0000 (18:14 +0300)]
YaGL: Fix dynamic symbols loading with coregl
EGL/GLES vendor-specific drivers are located in /usr/lib/driver
when emulator runs with coregl. This needs to be considered when
loading symbols internally.
Change-Id: I6461ead2c5d6d66cbf2cc1fd25ee53887981df8a
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Thu, 3 Mar 2016 14:55:02 +0000 (17:55 +0300)]
YaGL: Add pbuffer support for Wayland platform
Currently it is needed to make Tizen 3.0 feature tests pass
in emulator. They appear to be using eglCreatePbufferSurface(...)
for offscreen rendering. I am not sure if such functionality is
really needed with Wayland (in fact it is not supported even in
Mesa). Anyway I have not found any spec saying that Wayland should
fail with this call so for the moment some draft implementation
should be okay I think.
Change-Id: I01372121c0e080e0007c69a12d4b97ad8df6fc04
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Mon, 1 Feb 2016 08:20:17 +0000 (11:20 +0300)]
YaGL: Fix Prevent issues
Change-Id: I781453b800d376a16294921984e2cb2b36f1411b
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Mun, Gwan-gyeong [Mon, 28 Dec 2015 05:32:27 +0000 (14:32 +0900)]
YaGL: Fix build configuration for install directory of 64bit architecture.
32bit: install /usr/lib
64bit: install /usr/lib64
Change-Id: I6c50ea39a7eeaa17abe188aaa48d5ee61615529c
Mun, Gwan-gyeong [Mon, 28 Dec 2015 01:23:51 +0000 (10:23 +0900)]
wayland-egl: add missed package config file
Change-Id: I973a4ef3f89c1b26e52772c5bc386726d61d326c
Mun, Gwan-gyeong [Mon, 28 Dec 2015 01:06:08 +0000 (10:06 +0900)]
YaGL: Seperate emulator-yagl package to libwayland-egl package.
Change-Id: I99ef17705e7a1197f8555116f2c2a386f5726a03
Mun, Gwan-gyeong [Thu, 24 Dec 2015 12:46:40 +0000 (21:46 +0900)]
YaGL: Change install directory of real driver.
Coregl package provide libGLES, liEGL wrapper. and Coregl dynamically load real driver from /usr/lib/driver
Remove GL/EGL header files from devel package. : CoreGL provide GL/EGL header file.
Remove build script of X env.
Change-Id: I3015c5ee2828b94cd1525b98db9e7acba4cf5762
Jinhyung Jo [Wed, 9 Dec 2015 04:33:51 +0000 (13:33 +0900)]
YaGL: support EGL_NATIVE_VISUAL_ID for GBM
The EGL_KHR_platform_gbm extension has specific behavior
for the EGL_NATIVE_VISUAL_ID.
There is following contents in the EGL officail size,
(https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_platform_gbm.txt)
New Behavior section
"For each EGLConfig that belongs to the GBM platform, the
EGL_NATIVE_VISUAL_ID attribute is a GBM color format, such as
GBM_FORMAT_XRGB8888. "
The EFL EVAS in Tizen requires the GBM_FORMAT_ARGB8888.
And YaGL can support this format. So returns it.
This is W/A patch. Must be resolved correclty.
Change-Id: I402ebb20d17bf1a119ca09154519d57305e539a7
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
jinhyung.jo [Fri, 6 Nov 2015 05:14:29 +0000 (14:14 +0900)]
YaGL: Version bump
For the 64bit addressing
(commit id:
233c1f2ea5be0b1d160b64856e33365e0ab58313)
Be sure synchronize with the kernel & QEMU packages.
Change-Id: Ia3537a5d5e13f1a0764c20105dea576c364b826d
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
jinhyung.jo [Wed, 4 Nov 2015 13:15:31 +0000 (22:15 +0900)]
YaGL: Fix compilation warning & add '-Werror' option
Removed a usage of the deprecated function, wl_client_add_resource'
And added a compilation option, '-Werror'.
Change-Id: I20fb58f9ab26c9a1f359ec8f4f5d56c261778bd7
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
jinhyung.jo [Wed, 4 Nov 2015 09:48:16 +0000 (18:48 +0900)]
YaGL: Patches for the 64bit addressing
Tizen 3.0 supports a 64bit guest.
However current yagl is implemented by assumed to use 32bit address.
So modify the address related parts.
The qemu device sources were also modifed.
And remove the warnings:
-Wint-to-pointer-cast/-Wpointer-to-int-cast/-Wunused-variables
TODO: fix the warning - 'wl_client_add_resource' is deprecated
Change-Id: Id3875eefa012240df34fffbc7d12f36c9584b4f1
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Vasiliy Ulyanov [Fri, 7 Aug 2015 15:52:28 +0000 (18:52 +0300)]
Revert "YaGL: Workaround for libevas gles version check"
This workaround appears no longer needed since the corresponding
fix has been applied to libevas. Besides it seems to cause
problems with cairo.
This reverts commit
1a1d13934f4bad7b779cd6093c0f00cc9f36ec03.
Change-Id: Iad9af1b3bcd6c2756963ebd0e10e97879245d496
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
jinhyung.jo [Fri, 31 Jul 2015 07:57:30 +0000 (16:57 +0900)]
YaGL: Modified the .spec & COPYING files.
Modified to provide the correct license information.
Change-Id: Ie0689f070e6e6162132c07df6603a721c3fca453
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
jinhyung.jo [Tue, 21 Jul 2015 02:41:05 +0000 (11:41 +0900)]
YaGL: Updating the EGL header files
Update EGL header files to the version of May 2015, EGL spec 1.5.
Change-Id: Ifc7ba9cadebb0b229f1d1ee72171e241d2801a0a
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Vasiliy Ulyanov [Wed, 1 Jul 2015 07:49:30 +0000 (10:49 +0300)]
YaGL: mark eglMakeCurrent call as 'flushing'
According to EGL spec the currently bound context needs
to be flushed before being released or another context
is made current.
Without flushing we may miss some GL calls if there are
several threads rendering to a single context.
Change-Id: Id6680a086d895ba94b4c279b18443d93017838d1
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 23 Jun 2015 13:53:20 +0000 (16:53 +0300)]
YaGL: keep at least 2 back buffers for dri3 drawables
With only one back buffer available the rendering freezes
Change-Id: I9b2cdbeddf4786bc57bef997574d606a15ebf4cb
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Thu, 11 Jun 2015 10:11:28 +0000 (13:11 +0300)]
YaGL: Avoid clamping with floating point textures
We need to pass the proper dst_internalformat to the host when
using a texture with floating-point components in glTexImage2D.
Change-Id: Ia588a6e84ad5e359d3ed6d6eaf7d8769569acc38
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
jinhyung.jo [Thu, 18 Jun 2015 02:19:59 +0000 (11:19 +0900)]
YaGL: Modified the startup script
Checks the device node instead of the kernel command
Change-Id: Ib14005a53dd989419b8c49ec72600f107af1ab50
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Vasiliy Ulyanov [Tue, 9 Jun 2015 16:06:21 +0000 (19:06 +0300)]
YaGL: Add program link status check
According to the OGLES2.0 spec:
void UseProgram(uint program);
If program has not been successfully linked, the error
INVALID_OPERATION is generated and the current rendering
state is not modified.
Change-Id: I481a494c210e76ee4db319ae569d3491ade1d35a
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 9 Jun 2015 15:53:47 +0000 (18:53 +0300)]
YaGL: Generate error for rectangular cubemap images
According to the OGLES2.0 spec:
void TexImage2D(enum target, int level,
int internalformat, sizei width, sizei height,
int border, enum format, enum type, void *data);
When the target parameter to TexImage2D is one of the six cube map
two-dimensional image targets, the error INVALID_VALUE is generated
if the width and height parameters are not equal.
Change-Id: Ideb9172fa721cd7c92d1ef98a397d9fe48690e66
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Tue, 9 Jun 2015 15:35:09 +0000 (18:35 +0300)]
YaGL: Fix yagl_get_gles2_sym(...) resolution order
dlsym(NULL, ...) may return a valid pointer to a local symbol. We
need to search it in libGLESv2 explicitly first.
Change-Id: I6200679d7b69444798d3feeb77b685e2772eb3a7
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Vasiliy Ulyanov [Mon, 1 Jun 2015 06:54:06 +0000 (09:54 +0300)]
YaGL: Fix incorrect texture object release
EGL_KHR_gl_texture_2D_image: texture object is acquired in
yagl_gles_image_wrap_tex(...). Hence the release should be performed
in the corresponding destructor (i.e. yagl_gles_image_destroy(...)).
Change-Id: I92aaf0a4368201453e022859f4c52cdeb103af06
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>