2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-09-18 17:49:40 -04:00
|
|
|
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
#if PLATFORM_ANDROIDESDEFERRED
|
2014-09-18 17:49:40 -04:00
|
|
|
/*=============================================================================
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
AndroidESDeferredOpenGL.cpp: Manual loading of OpenGL functions from DLL.
|
2014-09-18 17:49:40 -04:00
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "OpenGLDrvPrivate.h"
|
|
|
|
|
|
|
|
|
|
#include "AndroidApplication.h"
|
|
|
|
|
#include "AndroidOpenGLPrivate.h"
|
|
|
|
|
#include <dlfcn.h>
|
|
|
|
|
#include <android/log.h>
|
|
|
|
|
#include <android/native_window_jni.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define LOG_TAG "UE4"
|
|
|
|
|
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
|
|
|
|
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
|
|
|
|
|
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// OpenGL function pointers
|
|
|
|
|
|
|
|
|
|
#define DEFINE_GL_ENTRYPOINTS(Type,Func) Type Func = NULL;
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_CORE(DEFINE_GL_ENTRYPOINTS) \
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_MANUAL(DEFINE_GL_ENTRYPOINTS) \
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_OPTIONAL(DEFINE_GL_ENTRYPOINTS)
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
bool FAndroidESDeferredOpenGL::bSupportsBindlessTexture = false;
|
2014-09-18 17:49:40 -04:00
|
|
|
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
void FAndroidESDeferredOpenGL::ProcessExtensions(const FString& ExtensionsString)
|
2014-09-18 17:49:40 -04:00
|
|
|
{
|
Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3056055)
#lockdown Nick.Penwarden
#rb None
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3011102 on 2016/06/13 by Steve.Cano
After taking a screenshot using glReadPixels, transfer the data to the target buffer from bottom row up to fix the "upside-down" render that OpenGL does. Confirmed with QA (owen.stupka_volt) that this does not appear to be happening on iOS (non-metal devices, inclusion of iOS in write-up was a mistake), verified on an ipod touch 5. Also confirmed that this does not happen on html5, and that Mobile HDR flag does not make a difference in function.
#jira UE-26421
#ue4
#android
Change 3015801 on 2016/06/16 by Dmitriy.Dyomin
Probbably fix for UE-30878, was not able to repro an actual crash(FFoliageInstanceBaseCache::AddInstanceBaseId). Added even more logging in case fix does not work.
#jira UE-30878
Change 3015903 on 2016/06/16 by Dmitriy.Dyomin
Fixed: Levels window has Refresh/UI issues when World Composition is active
#jira UE-26160
Change 3018352 on 2016/06/17 by Chris.Babcock
Handle Android media prepare failure (URL without internet for example)
#jira UE-32029
#ue4
#android
Change 3026387 on 2016/06/24 by Jack.Porter
Remove FFuncTestManager warning about PIE when running on a standalone game binary
Change 3026398 on 2016/06/24 by Jack.Porter
Prevent FSocketBSD::Recv returning false on SE_EWOULDBLOCK
Change 3027553 on 2016/06/25 by Niklas.Smedberg
OpenGL: Made some block size calculation work for arbitrary block sizes (e.g. not pow-of-two).
Change 3027554 on 2016/06/25 by Niklas.Smedberg
Metal: copyFromTexture now gets block-aligned size parameter (e.g. used for texture streaming)
Change 3028061 on 2016/06/26 by Jack.Porter
Fixed a problem where newly discovered instances were not added to an existing session in the Session Browser.
Fixed a problem where selecting an instance in a session with multiple instances didn't deselect the previously selected instance correctly.
Change 3029220 on 2016/06/27 by Steve.Cano
Change Android Tilt values to use GetRotationMatrix/GetOrientation logic, same as java-side android would use, and adjust slightly to match as closely as possible to iOS values for tilt. There is drift and some differences in the "Y" value but the same sort of inconsistencies are also seen on iOS.
#jira UE-6135
#ue4
#android
Change 3030420 on 2016/06/28 by Jack.Porter
Fix crash with RenderOutputValidation when running with cooked content
Change 3030426 on 2016/06/28 by Jack.Porter
Fix to CL 3026398 - make FSocketBSD(IPv6)::Recv(From) return false when recv returns 0.
A return value of 0 indicates the connection was shutdown in an orderly manner.
Change 3030973 on 2016/06/28 by Steve.Cano
Added a landscape downloader background along with the options to change it from within Android settings
#ue4
#android
#jira UE-32318
Change 3031757 on 2016/06/28 by Chris.Babcock
Remove unused methods from AndroidJNI header
#ue4
#android
Change 3032387 on 2016/06/29 by Allan.Bentham
Rename android es31+aep -> glesdeferred.
Change 3032711 on 2016/06/29 by Allan.Bentham
Rename GLSL_310_ES_EXT shader define:
ES31_AEP_PROFILE -> ESDEFERRED_PROFILE
bumped UE_SHADER_GLSL_310_ES_EXT_VER version number.
Change 3033698 on 2016/06/29 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3034210 on 2016/06/30 by Steve.Cano
Added a new AndroidRuntimeSettings variable that allows creation of installers for both Windows and Mac/Linux if set to true.
#jira UE-32302
#ue4
#android
Change 3034530 on 2016/06/30 by Chris.Babcock
Rename FManifestReader to FAndroidFileManifestReader in AndroidFile
#jira UE-32679
#ue4
#android
Change 3034612 on 2016/06/30 by Steve.Cano
Change Alpha from being set to a range of 0-255 to being in a range of 0-1 (which is the correct range of values)
#jira UE-25325
#ue4
#android
Change 3034679 on 2016/06/30 by Chris.Babcock
Fix tooltip (.command for mac, not .sh)
#jira UE-32302
#ue4
#android
Change 3038881 on 2016/07/05 by Jack.Porter
Package and launch on multiple Android devices simultaneously using the -Device=xxxxxxx+yyyyyyyy+zzzzzzzz format generated by a Project Launcher profile when you select multiple devices
#jira UEMOB-115
Change 3039240 on 2016/07/06 by Jack.Porter
TcpMessageTransport - connection-based message bus transport.
#jira UEMOB-112
#jira UEMOB-113
Change 3039252 on 2016/07/06 by Jack.Porter
Enable messaging and session services and functional testing on Android when launched with -messaging
Android device detection module support for adding port forwarding and connection announcement for TcpMessageTransport
#jira UEMOB-112
#jira UEMOB-113
Change 3039264 on 2016/07/06 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3040041 on 2016/07/06 by Chris.Babcock
Pass proper value to script generator functions
#jira UE-32861
#ue4
#android
Change 3040890 on 2016/07/07 by Allan.Bentham
Fix shadow crash
#jira UE-32884
Change 3041458 on 2016/07/07 by Peter.Sauerbrei
fix for IOS launch on failures
Change 3041542 on 2016/07/07 by Peter.Sauerbrei
better fix for the multi-device deployment issue
Change 3041774 on 2016/07/07 by Steve.Cano
Fixing crash that occurs when a games app id for Google Play is set before configuring the apk packaging. Also validating the value that is inserted and using it to override any values that have been hand-inserted into the GooglePlayAppID.xml
#jira UE-16992
#android
#ue4
Change 3042222 on 2016/07/08 by Dmitriy.Dyomin
Mobile packaging scenarious
Added a wizard for creating launcher profiles (Android & IOS) for scenario: Minimal App + Downloadable content
Added Archive step to launcher profiles to be able to store build product into specified directory
Changes to a cooker to be able to pack DLC based with a different flavor to a release App
Changes to DLC packaging to be able to build streaming data without chunking pak files
#jira UEMOB-119
Change 3042244 on 2016/07/08 by Dmitriy.Dyomin
Fixed crash in FTcpMessageTransportConnection::Stop
Change 3042270 on 2016/07/08 by Dmitriy.Dyomin
GitHub #2320 : [ULevelStreamingKismet] Load Level Instance, Enables UE4 Users to create multiple transformed instances of a .umap without having to include in persistent level's list ? Rama
contributed by: EverNewJoy
#jira UE-29867
Change 3042449 on 2016/07/08 by Dmitriy.Dyomin
Fixing Mac Editor build erros from CL# 3042222
Change 3042480 on 2016/07/08 by Allan.Bentham
Add ES3.1 profile & compiler_glsl_es3_1 to shaders.
Change 3042481 on 2016/07/08 by Allan.Bentham
hlslcc - ES3.1 changes.
set ES3.1 version number to 310
Do not use ES2 keywords for ES3.1.
Generate Layout Locations for ES3.1
bump version.
Change 3042483 on 2016/07/08 by Allan.Bentham
Add mobile ES3.1 support.
Recreates EGL and ES3.1 context during PlatformInitOpenGL if ES3.1 is required.
Change 3042485 on 2016/07/08 by Allan.Bentham
Undo android XGE change.
Change 3042506 on 2016/07/08 by Dmitriy.Dyomin
One more compile fix from CL# 3042222
Change 3044173 on 2016/07/10 by Dmitriy.Dyomin
UAT: Added support for building target platforms with multiple cook flavors
ex: -targetplatform=Android -cookflavor=ETC1+ETC2
Change 3044213 on 2016/07/11 by Dmitriy.Dyomin
Fixed: Can't stream in a level whose name is a substring of another streaming level
#jira UE-32999
Change 3044221 on 2016/07/11 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3044815 on 2016/07/11 by Allan.Bentham
Corrected NAME_GLSL_ES3_1_ANDROID format string.
Change 3046911 on 2016/07/12 by Chris.Babcock
Add handling of OnTextChanged for virtual keyboard input on Android
#jira UE-32348
#ue4
#android
Change 3046958 on 2016/07/12 by Chris.Babcock
Rename some functions with Error in the name to prevent false coloring in the logs
#jira UE-30541
#ue4
#android
Change 3047169 on 2016/07/12 by Chris.Babcock
Return player ID and handle auth token for Google Play Games on Android (contributed by gameDNAstudio)
#jira UE-30610
#pr #2372
#ue4
#android
Change 3047406 on 2016/07/12 by Jack.Porter
Add missing import to GameActivity.java
Change 3047442 on 2016/07/13 by Dmitriy.Dyomin
Added: Mobile custom post-process
Limitations: can fetch only from PostProcessInput0 (SceneColor) other scene textures are not supported. Does not support "Replacing the Tonemapper" blendable location.
#jira UEMOB-147
Change 3047466 on 2016/07/13 by Dmitriy.Dyomin
Disabled engine crash handler on Android, system crash handler works more reliably across different os versions/devices
Change 3047746 on 2016/07/13 by Jack.Porter
Rename FBasePassFowardDynamicPointLightInfo
Change 3047778 on 2016/07/13 by Jack.Porter
Missing file for rename FBasePassFowardDynamicPointLightInfo
Change 3047788 on 2016/07/13 by Allan.Bentham
Fix incorrect TargetPlatformDescriptor string generation.
Change 3047790 on 2016/07/13 by Allan.Bentham
Fixed half3x3 matrix use with ES3.1 glsl
Fixed couple of interpolator precision mismatch.
Fixed ES3.1 support detection issues
Change 3047816 on 2016/07/13 by Allan.Bentham
Remove AndroidGL4 remnants.
Change 3048926 on 2016/07/13 by Chris.Babcock
Added detection of Amazon Fire TV to disable requiring virtual joysticks
#ue4
#android
Change 3049335 on 2016/07/14 by Dmitriy.Dyomin
Fixing UAT crash when packaging project for iOS
Change 3049390 on 2016/07/14 by Jack.Porter
Disabled error for warning 4819 "The file contains a character that cannot be represented in the current code page (xxx). Save the file in Unicode format to prevent data loss"
This is triggered by European characters and copyright symbols in source saved as latin-1 when compiling on non-US windows. Seen often in 3rd party headers, eg nvapi.
#code_review: Ben.Marsh
Change 3049391 on 2016/07/14 by Jack.Porter
Fixed incorrect comment order in CL 3049390
Change 3049545 on 2016/07/14 by Dmitriy.Dyomin
Reworking some code from CL#3047442 to make static analizer happy
Change 3049626 on 2016/07/14 by Allan.Bentham
Automatic CSM shader toggling
#jira UE-27429
Change 3051574 on 2016/07/15 by Jack.Porter
Support for lighting channels on Mobile
- Multiple directional lights are supported in different channels but primitives are only affected by the directional light in the first channel they have set
- CSM shadows from stationary or movable directional lights correctly follow their lighting channels
- No channel limitations for dynamic point lights
Notes:
Removed mobile-specific directional light shadowing fields from View uniform buffer and mobile no longers uses SimpleDirectionalLight.
Separate uniform buffers for mobile directional light are generated for each lighting channel.
CSM culling information is now stored in FViewInfo and not per FVisibleLightViewInfo as the visibility bits are per view.
#code_review Daniel.Wright
#jira UEMOB-110
Change 3051699 on 2016/07/15 by Steve.Cano
Preserve the original, pre-transformed input vertices for Slate shaders, which is required to properly do anti-aliasing (the ViewProjection-transformed values were causing the lines to not be drawn).
#jira UE-20320
#ue4
#android
Change 3051744 on 2016/07/15 by Chris.Babcock
Fix Android Vulkan include path checks (contributed by kodomastro)
#jira UE-33311
#PR #2602
#ue4
#android
Change 3052023 on 2016/07/15 by Chris.Babcock
Fix shadowed variables
Change 3052110 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- missing template
- accessor function for MobileDirectionalLights from scene
Change 3052242 on 2016/07/15 by Chris.Babcock
Compile fixes for light channel support on mobile
- removed dependency on C++14 feature
Change 3052730 on 2016/07/16 by Dmitriy.Dyomin
Win32 build fix
Change 3053041 on 2016/07/17 by Jack.Porter
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
Change 3053054 on 2016/07/17 by Jack.Porter
Changed use of old function ShouldUseDeferredRenderer() to new GetShadingPath()
Change 3053055 on 2016/07/17 by Jack.Porter
Fixed local variable aliasing in unity build
Change 3053206 on 2016/07/18 by Jack.Porter
Support ExecuteJavascript on iOS and Android
Expose ExecuteJavascript to widget blueprint
Fix ExecuteJavascript unicode string support on desktop platforms
#jira UEMOB-152
Change 3053323 on 2016/07/18 by Dmitriy.Dyomin
Added: Ability to set thread affinity for a device in Device Profiles (ex: +CVars=android.SetThreadAffinity=RT 0x02 GT 0x01)
#jira UEMOB-107
Change 3053723 on 2016/07/18 by Jack.Porter
Fix for UnrealTournamentProto.Automation.cs build errors
Change 3055090 on 2016/07/19 by Dmitriy.Dyomin
Junk OnlineBlueprintSupport module binaries
[CL 3056789 by Jack Porter in Main branch]
2016-07-19 19:13:01 -04:00
|
|
|
FOpenGLESDeferred::ProcessExtensions(ExtensionsString);
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
bSupportsBindlessTexture = ExtensionsString.Contains(TEXT("GL_NV_bindless_texture"));
|
2016-03-17 11:10:14 -04:00
|
|
|
|
|
|
|
|
// Nexus 9 running Android < 6.0 runs slow with NvTimerQuery so disable it
|
|
|
|
|
if (FAndroidMisc::GetDeviceModel() == FString(TEXT("Nexus 9")))
|
|
|
|
|
{
|
|
|
|
|
TArray<FString> VersionParts;
|
|
|
|
|
FAndroidMisc::GetAndroidVersion().ParseIntoArray(VersionParts, TEXT("."), true);
|
|
|
|
|
if (VersionParts.Num() > 0 && FCString::Atoi(*VersionParts[0]) < 6)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogRHI, Log, TEXT("Disabling support for NvTimerQuery on Nexus 9 before Android 6.0"));
|
|
|
|
|
bSupportsNvTimerQuery = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// OpenGL platform functions
|
|
|
|
|
|
|
|
|
|
class FScopeContext
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FScopeContext(FPlatformOpenGLContext* PlatformContext)
|
|
|
|
|
{
|
|
|
|
|
check(PlatformContext);
|
|
|
|
|
LastContext = eglGetCurrentContext();
|
|
|
|
|
LastSurface = eglGetCurrentSurface(EGL_DRAW);
|
|
|
|
|
bSameContextAndSurface = (LastContext == PlatformContext->eglContext) && (LastSurface == PlatformContext->eglSurface);
|
|
|
|
|
if (!bSameContextAndSurface)
|
|
|
|
|
{
|
|
|
|
|
eglMakeCurrent(AndroidEGL::GetInstance()->GetDisplay(), PlatformContext->eglSurface, PlatformContext->eglSurface, PlatformContext->eglContext);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~FScopeContext( void )
|
|
|
|
|
{
|
|
|
|
|
if (!bSameContextAndSurface)
|
|
|
|
|
{
|
|
|
|
|
if (LastContext)
|
|
|
|
|
{
|
|
|
|
|
eglMakeCurrent(AndroidEGL::GetInstance()->GetDisplay(), LastSurface, LastSurface, LastContext);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
eglMakeCurrent(AndroidEGL::GetInstance()->GetDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
EGLContext LastContext;
|
|
|
|
|
EGLSurface LastSurface;
|
|
|
|
|
bool bSameContextAndSurface;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enable/Disable debug context from the commandline
|
|
|
|
|
*/
|
|
|
|
|
static bool PlatformOpenGLDebugCtx()
|
|
|
|
|
{
|
|
|
|
|
#if UE_BUILD_DEBUG
|
|
|
|
|
return ! FParse::Param(FCommandLine::Get(),TEXT("openglNoDebug"));
|
|
|
|
|
#else
|
|
|
|
|
return FParse::Param(FCommandLine::Get(),TEXT("openglDebug"));;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct FPlatformOpenGLDevice
|
|
|
|
|
{
|
|
|
|
|
void SetCurrentSharedContext();
|
|
|
|
|
void SetCurrentRenderingContext();
|
|
|
|
|
void SetCurrentNULLContext();
|
|
|
|
|
|
|
|
|
|
FPlatformOpenGLDevice();
|
|
|
|
|
~FPlatformOpenGLDevice();
|
|
|
|
|
void Init();
|
|
|
|
|
void LoadEXT();
|
|
|
|
|
void Terminate();
|
|
|
|
|
void ReInit();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FPlatformOpenGLDevice::FPlatformOpenGLDevice()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPlatformOpenGLDevice::~FPlatformOpenGLDevice()
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->DestroyBackBuffer();
|
|
|
|
|
AndroidEGL::GetInstance()->Terminate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FPlatformOpenGLDevice::Init()
|
|
|
|
|
{
|
|
|
|
|
UE_LOG( LogRHI, Warning, TEXT("Entering FPlatformOpenGLDevice::Init"));
|
|
|
|
|
extern void InitDebugContext();
|
|
|
|
|
|
2016-03-11 09:55:03 -05:00
|
|
|
AndroidEGL::GetInstance()->InitSurface(false, true);
|
2014-09-18 17:49:40 -04:00
|
|
|
AndroidEGL::GetInstance()->SetSingleThreadRenderingContext();
|
|
|
|
|
|
|
|
|
|
// Initialize all of the entry points we have to query manually
|
|
|
|
|
#define GET_GL_ENTRYPOINTS(Type,Func) Func = (Type)eglGetProcAddress(#Func);
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_CORE(GET_GL_ENTRYPOINTS);
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_MANUAL(GET_GL_ENTRYPOINTS);
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_OPTIONAL(GET_GL_ENTRYPOINTS);
|
|
|
|
|
|
|
|
|
|
// Check that all of the required entry points have been initialized
|
|
|
|
|
bool bFoundAllEntryPoints = true;
|
|
|
|
|
#define CHECK_GL_ENTRYPOINTS(Type,Func) if (Func == NULL) { bFoundAllEntryPoints = false; UE_LOG(LogRHI, Warning, TEXT("Failed to find entry point for %s"), TEXT(#Func)); }
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_CORE(CHECK_GL_ENTRYPOINTS);
|
|
|
|
|
|
|
|
|
|
checkf(bFoundAllEntryPoints, TEXT("Failed to find all required OpenGL entry points."));
|
|
|
|
|
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_MANUAL(CHECK_GL_ENTRYPOINTS);
|
|
|
|
|
ENUM_GL_ENTRYPOINTS_OPTIONAL(CHECK_GL_ENTRYPOINTS);
|
|
|
|
|
|
|
|
|
|
const FString ExtensionsString = ANSI_TO_TCHAR((const ANSICHAR*)glGetString(GL_EXTENSIONS));
|
|
|
|
|
|
|
|
|
|
// If EXT_disjoint_timer_query wasn't found, NV_timer_query might be available
|
|
|
|
|
{
|
|
|
|
|
// These functions get exported under different names by different extensions
|
|
|
|
|
// Can't just check for NULL, because Android returns and unimplemented function catch
|
|
|
|
|
|
|
|
|
|
if ( !ExtensionsString.Contains(TEXT("GL_EXT_disjoint_timer_query")) && ExtensionsString.Contains(TEXT("GL_NV_timer_query")))
|
|
|
|
|
{
|
|
|
|
|
glQueryCounterEXT = (PFNGLQUERYCOUNTEREXTPROC)eglGetProcAddress("glQueryCounterNV");
|
|
|
|
|
glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)eglGetProcAddress("glGetQueryObjectui64vNV");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bool bAdvancedFeatures = FOpenGL::SupportsAdvancedFeatures();
|
|
|
|
|
|
|
|
|
|
// devices that have ES2.0 only might support some ES3.x core functionality with extensions
|
|
|
|
|
if(!bAdvancedFeatures)
|
|
|
|
|
{
|
|
|
|
|
if(ExtensionsString.Contains(TEXT("GL_EXT_occlusion_query_boolean")))
|
|
|
|
|
{
|
|
|
|
|
glGenQueries = (PFNGLGENQUERIESPROC(eglGetProcAddress("glGenQueriesEXT")));
|
|
|
|
|
glDeleteQueries = (PFNGLDELETEQUERIESPROC(eglGetProcAddress("glDeleteQueriesEXT")));
|
|
|
|
|
glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)((void*)eglGetProcAddress("glGetQueryObjectuivEXT"));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Android doesn't setup formats completely compatible with glTexStorage in ES2 mode
|
|
|
|
|
glTexStorage2D = nullptr;
|
|
|
|
|
glTexStorage3D = nullptr;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-25 19:41:01 -04:00
|
|
|
// For MSAA
|
|
|
|
|
glFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)((void*)eglGetProcAddress("glFramebufferTexture2DMultisampleEXT"));
|
|
|
|
|
glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)((void*)eglGetProcAddress("glRenderbufferStorageMultisampleEXT"));
|
|
|
|
|
|
2014-09-18 17:49:40 -04:00
|
|
|
if (!bFoundAllEntryPoints)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogRHI, Warning, TEXT("Failed to acquire all optional OpenGL entrypoints, may fall back to OpenGL ES 2.0"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bAdvancedFeatures)
|
|
|
|
|
{
|
|
|
|
|
GLuint DefaultVertexArrayObject = 0;
|
|
|
|
|
glGenVertexArrays(1, &DefaultVertexArrayObject);
|
|
|
|
|
glBindVertexArray(DefaultVertexArrayObject);
|
|
|
|
|
}
|
|
|
|
|
InitDefaultGLContextState();
|
|
|
|
|
InitDebugContext();
|
|
|
|
|
|
|
|
|
|
AndroidEGL::GetInstance()->SetMultithreadRenderingContext();
|
|
|
|
|
if (bAdvancedFeatures)
|
|
|
|
|
{
|
|
|
|
|
GLuint DefaultVertexArrayObject = 0;
|
|
|
|
|
glGenVertexArrays(1, &DefaultVertexArrayObject);
|
|
|
|
|
glBindVertexArray(DefaultVertexArrayObject);
|
|
|
|
|
}
|
|
|
|
|
InitDefaultGLContextState();
|
|
|
|
|
InitDebugContext();
|
|
|
|
|
|
|
|
|
|
AndroidEGL::GetInstance()->SetSharedContext();
|
|
|
|
|
if (bAdvancedFeatures)
|
|
|
|
|
{
|
|
|
|
|
GLuint DefaultVertexArrayObject = 0;
|
|
|
|
|
glGenVertexArrays(1, &DefaultVertexArrayObject);
|
|
|
|
|
glBindVertexArray(DefaultVertexArrayObject);
|
|
|
|
|
}
|
|
|
|
|
InitDefaultGLContextState();
|
|
|
|
|
InitDebugContext();
|
|
|
|
|
|
|
|
|
|
PlatformSharedContextSetup(this);
|
|
|
|
|
|
|
|
|
|
AndroidEGL::GetInstance()->InitBackBuffer(); //can be done only after context is made current.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FPlatformOpenGLDevice::SetCurrentSharedContext()
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->SetCurrentSharedContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FPlatformOpenGLDevice::SetCurrentRenderingContext()
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->SetCurrentRenderingContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FPlatformOpenGLDevice* PlatformCreateOpenGLDevice()
|
|
|
|
|
{
|
|
|
|
|
FPlatformOpenGLDevice* Device = new FPlatformOpenGLDevice();
|
|
|
|
|
Device->Init();
|
|
|
|
|
return Device;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformDestroyOpenGLDevice(FPlatformOpenGLDevice* Device)
|
|
|
|
|
{
|
|
|
|
|
delete Device;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FPlatformOpenGLContext* PlatformCreateOpenGLContext(FPlatformOpenGLDevice* Device, void* InWindowHandle)
|
|
|
|
|
{
|
|
|
|
|
//Assumes Device is already initialized and context already created.
|
|
|
|
|
return AndroidEGL::GetInstance()->GetRenderingContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformReleaseOpenGLContext(FPlatformOpenGLDevice* Device, FPlatformOpenGLContext* PlatformContext)
|
|
|
|
|
{
|
|
|
|
|
// nothing to do for now
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void* PlatformGetWindow(FPlatformOpenGLContext* Context, void** AddParam)
|
|
|
|
|
{
|
|
|
|
|
check(Context);
|
|
|
|
|
|
|
|
|
|
return (void*)&Context->eglContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformDestroyOpenGLContext(FPlatformOpenGLDevice* Device, FPlatformOpenGLContext* PlatformContext)
|
|
|
|
|
{
|
|
|
|
|
delete Device; //created here, destroyed here, but held by RHI.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformBlitToViewport( FPlatformOpenGLDevice* Device, const FOpenGLViewport& Viewport, uint32 BackbufferSizeX, uint32 BackbufferSizeY, bool bPresent,bool bLockToVsync, int32 SyncInterval )
|
|
|
|
|
{
|
|
|
|
|
if (FOpenGL::IsES2())
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->SwapBuffers();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FPlatformOpenGLContext* const Context = Viewport.GetGLContext();
|
|
|
|
|
|
|
|
|
|
check(Context && Context->eglContext );
|
|
|
|
|
|
|
|
|
|
FScopeContext ScopeContext(Context);
|
|
|
|
|
|
|
|
|
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
|
|
|
|
//Disabling for now to work around a GL_INVALID_OPERATION which might or might not be legit in the context of EGL.
|
|
|
|
|
//Note that the drawbuffer state is part of the FBO state, so we don't need to touch it per frame.
|
|
|
|
|
//glDrawBuffer(GL_BACK);
|
|
|
|
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, Context->ViewportFramebuffer);
|
|
|
|
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
|
|
|
|
|
|
|
|
|
//LOGD("PlatformBlitToViewport: backbuffer (%d, %d) to screen (%d, %d)", BackbufferSizeX, BackbufferSizeY, GRealScreenWidth, GRealScreenHeight);
|
|
|
|
|
|
|
|
|
|
uint32 GRealScreenHeight, GRealScreenWidth;
|
|
|
|
|
AndroidEGL::GetInstance()->GetDimensions( GRealScreenWidth, GRealScreenHeight);
|
|
|
|
|
|
|
|
|
|
glBlitFramebuffer(
|
|
|
|
|
0, 0, BackbufferSizeX, BackbufferSizeY,
|
|
|
|
|
0, GRealScreenHeight, GRealScreenWidth, 0,
|
|
|
|
|
GL_COLOR_BUFFER_BIT,
|
|
|
|
|
GL_LINEAR
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (bPresent)
|
|
|
|
|
{
|
|
|
|
|
uint32 IdleStart = FPlatformTime::Cycles();
|
|
|
|
|
|
|
|
|
|
AndroidEGL::GetInstance()->SwapBuffers();
|
|
|
|
|
REPORT_GL_END_BUFFER_EVENT_FOR_FRAME_DUMP();
|
|
|
|
|
// INITIATE_GL_FRAME_DUMP_EVERY_X_CALLS( 1000 );
|
|
|
|
|
|
|
|
|
|
GRenderThreadIdle[ERenderThreadIdleTypes::WaitingForGPUPresent] += FPlatformTime::Cycles() - IdleStart;
|
|
|
|
|
GRenderThreadNumIdle[ERenderThreadIdleTypes::WaitingForGPUPresent]++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-04-29 11:53:00 -04:00
|
|
|
// return true;
|
|
|
|
|
//Do not want WaitForFrameEventCompletion
|
|
|
|
|
return false;
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformRenderingContextSetup(FPlatformOpenGLDevice* Device)
|
|
|
|
|
{
|
|
|
|
|
Device->SetCurrentRenderingContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformFlushIfNeeded()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformRebindResources(FPlatformOpenGLDevice* Device)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformSharedContextSetup(FPlatformOpenGLDevice* Device)
|
|
|
|
|
{
|
|
|
|
|
Device->SetCurrentSharedContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformNULLContextSetup()
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->SetCurrentContext(EGL_NO_CONTEXT, EGL_NO_SURFACE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EOpenGLCurrentContext PlatformOpenGLCurrentContext(FPlatformOpenGLDevice* Device)
|
|
|
|
|
{
|
|
|
|
|
return (EOpenGLCurrentContext)AndroidEGL::GetInstance()->GetCurrentContextType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformRestoreDesktopDisplayMode()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FRHITexture* PlatformCreateBuiltinBackBuffer(FOpenGLDynamicRHI* OpenGLRHI, uint32 SizeX, uint32 SizeY)
|
|
|
|
|
{
|
|
|
|
|
FOpenGLTexture2D* Texture2D = NULL;
|
|
|
|
|
|
|
|
|
|
if ( FOpenGL::IsES2())
|
|
|
|
|
{
|
|
|
|
|
uint32 Flags = TexCreate_RenderTargetable;
|
2015-07-23 15:10:46 -04:00
|
|
|
Texture2D = new FOpenGLTexture2D(OpenGLRHI, AndroidEGL::GetInstance()->GetOnScreenColorRenderBuffer(), GL_RENDERBUFFER, GL_COLOR_ATTACHMENT0, SizeX, SizeY, 0, 1, 1, 1, PF_B8G8R8A8, false, false, Flags, nullptr, FClearValueBinding::Transparent);
|
2014-09-18 17:49:40 -04:00
|
|
|
OpenGLTextureAllocated(Texture2D, Flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Texture2D;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformResizeGLContext( FPlatformOpenGLDevice* Device, FPlatformOpenGLContext* Context, uint32 SizeX, uint32 SizeY, bool bFullscreen, bool bWasFullscreen, GLenum BackBufferTarget, GLuint BackBufferResource)
|
|
|
|
|
{
|
|
|
|
|
check(Context);
|
|
|
|
|
FScopeContext ScopeContext(Context);
|
|
|
|
|
|
|
|
|
|
if (FOpenGL::IsES2())
|
|
|
|
|
{
|
|
|
|
|
glViewport(0, 0, SizeX, SizeY);
|
|
|
|
|
VERIFY_GL(glViewport);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Context->ViewportFramebuffer == 0)
|
|
|
|
|
{
|
|
|
|
|
glGenFramebuffers(1, &Context->ViewportFramebuffer);
|
|
|
|
|
}
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, Context->ViewportFramebuffer);
|
|
|
|
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, BackBufferTarget, BackBufferResource, 0);
|
|
|
|
|
|
|
|
|
|
#if UE_BUILD_DEBUG
|
|
|
|
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
|
|
|
|
FOpenGL::DrawBuffer(GL_COLOR_ATTACHMENT0);
|
|
|
|
|
GLenum CompleteResult = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
|
|
|
|
if (CompleteResult != GL_FRAMEBUFFER_COMPLETE)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogRHI, Fatal, TEXT("PlatformResizeGLContext: Framebuffer not complete. Status = 0x%x"), CompleteResult);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
glViewport(0, 0, SizeX, SizeY);
|
|
|
|
|
static GLfloat ZeroColor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
|
|
|
|
glClearBufferfv(GL_COLOR, 0, ZeroColor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformGetSupportedResolution(uint32 &Width, uint32 &Height)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformGetAvailableResolutions(FScreenResolutionArray& Resolutions, bool bIgnoreRefreshRate)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformInitOpenGL()
|
|
|
|
|
{
|
|
|
|
|
// Original location for querying function entrypoints
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformOpenGLContextValid()
|
|
|
|
|
{
|
|
|
|
|
return (eglGetCurrentContext() != EGL_NO_CONTEXT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32 PlatformGlGetError()
|
|
|
|
|
{
|
|
|
|
|
return glGetError();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformGetBackbufferDimensions( uint32& OutWidth, uint32& OutHeight )
|
|
|
|
|
{
|
|
|
|
|
AndroidEGL::GetInstance()->GetDimensions(OutWidth, OutHeight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// =============================================================
|
|
|
|
|
|
|
|
|
|
/* Query management
|
|
|
|
|
* Queries can be per context, depending on the extension / version used
|
|
|
|
|
* This code attempts to be safe about it. The ES2 version of Android
|
|
|
|
|
* is #if 0 below
|
|
|
|
|
*/
|
|
|
|
|
// ES2 FALLBACK HACK
|
|
|
|
|
#if 0
|
|
|
|
|
void PlatformGetNewRenderQuery( GLuint* OutQuery, uint64* OutQueryContext )
|
|
|
|
|
{
|
|
|
|
|
GLuint NewQuery = 0;
|
|
|
|
|
FOpenGL::GenQueries(1, &NewQuery);
|
|
|
|
|
*OutQuery = NewQuery;
|
|
|
|
|
*OutQueryContext = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformReleaseRenderQuery( GLuint Query, uint64 QueryContext )
|
|
|
|
|
{
|
|
|
|
|
FOpenGL::DeleteQueries(1, &Query);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformContextIsCurrent( uint64 QueryContext )
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
struct FOpenGLReleasedQuery
|
|
|
|
|
{
|
|
|
|
|
EGLContext Context;
|
|
|
|
|
GLuint Query;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static TArray<FOpenGLReleasedQuery> ReleasedQueries;
|
|
|
|
|
static FCriticalSection* ReleasedQueriesGuard;
|
|
|
|
|
|
|
|
|
|
void PlatformGetNewRenderQuery(GLuint* OutQuery, uint64* OutQueryContext)
|
|
|
|
|
{
|
|
|
|
|
if (!ReleasedQueriesGuard)
|
|
|
|
|
{
|
|
|
|
|
ReleasedQueriesGuard = new FCriticalSection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
FScopeLock Lock(ReleasedQueriesGuard);
|
|
|
|
|
|
|
|
|
|
#ifdef UE_BUILD_DEBUG
|
|
|
|
|
check(OutQuery && OutQueryContext);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
EGLContext Context = eglGetCurrentContext();
|
|
|
|
|
check(Context);
|
|
|
|
|
|
|
|
|
|
GLuint NewQuery = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Note, not reusing queries, because timestamp and occlusion are different
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (!NewQuery)
|
|
|
|
|
{
|
|
|
|
|
FOpenGL::GenQueries(1, &NewQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*OutQuery = NewQuery;
|
|
|
|
|
*OutQueryContext = (uint64)Context;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlatformReleaseRenderQuery(GLuint Query, uint64 QueryContext)
|
|
|
|
|
{
|
|
|
|
|
EGLContext Context = eglGetCurrentContext();
|
|
|
|
|
if ((uint64)Context == QueryContext)
|
|
|
|
|
{
|
2015-06-18 23:49:47 -04:00
|
|
|
FOpenGL::DeleteQueries(1, &Query);
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FScopeLock Lock(ReleasedQueriesGuard);
|
|
|
|
|
#ifdef UE_BUILD_DEBUG
|
|
|
|
|
check(Query && QueryContext && ReleasedQueriesGuard);
|
|
|
|
|
#endif
|
|
|
|
|
FOpenGLReleasedQuery ReleasedQuery;
|
|
|
|
|
ReleasedQuery.Context = (EGLContext)QueryContext;
|
|
|
|
|
ReleasedQuery.Query = Query;
|
|
|
|
|
ReleasedQueries.Add(ReleasedQuery);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DeleteOcclusionQueriesForCurrentContext(EGLContext Context)
|
|
|
|
|
{
|
|
|
|
|
if (!ReleasedQueriesGuard)
|
|
|
|
|
{
|
|
|
|
|
ReleasedQueriesGuard = new FCriticalSection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
FScopeLock Lock(ReleasedQueriesGuard);
|
|
|
|
|
for (int32 Index = 0; Index < ReleasedQueries.Num(); ++Index)
|
|
|
|
|
{
|
|
|
|
|
if (ReleasedQueries[Index].Context == Context)
|
|
|
|
|
{
|
|
|
|
|
FOpenGL::DeleteQueries(1, &ReleasedQueries[Index].Query);
|
|
|
|
|
ReleasedQueries.RemoveAtSwap(Index);
|
|
|
|
|
--Index;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PlatformContextIsCurrent( uint64 QueryContext )
|
|
|
|
|
{
|
|
|
|
|
return (uint64)eglGetCurrentContext() == QueryContext;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FString FAndroidMisc::GetGPUFamily()
|
|
|
|
|
{
|
|
|
|
|
return FAndroidGPUInfo::Get().GPUFamily;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FString FAndroidMisc::GetGLVersion()
|
|
|
|
|
{
|
|
|
|
|
return FAndroidGPUInfo::Get().GLVersion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FAndroidMisc::SupportsFloatingPointRenderTargets()
|
|
|
|
|
{
|
2015-07-15 06:39:44 -04:00
|
|
|
return FAndroidGPUInfo::Get().bSupportsFloatingPointRenderTargets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FAndroidMisc::SupportsShaderFramebufferFetch()
|
|
|
|
|
{
|
|
|
|
|
return FAndroidGPUInfo::Get().bSupportsFrameBufferFetch;
|
|
|
|
|
}
|
2014-09-18 17:49:40 -04:00
|
|
|
|
|
|
|
|
void FAndroidMisc::GetValidTargetPlatforms(TArray<FString>& TargetPlatformNames)
|
|
|
|
|
{
|
|
|
|
|
TargetPlatformNames = FAndroidGPUInfo::Get().TargetPlatformNames;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FAndroidAppEntry::PlatformInit()
|
|
|
|
|
{
|
|
|
|
|
const bool Debug = PlatformOpenGLDebugCtx();
|
|
|
|
|
|
2016-03-16 21:16:51 -04:00
|
|
|
// @todo vulkan: Yet another bit of FAndroidApp stuff that's in GL - and should be cleaned up if possible
|
|
|
|
|
if (!FAndroidMisc::ShouldUseVulkan())
|
|
|
|
|
{
|
|
|
|
|
//AndroidEGL::GetInstance()->Init(AndroidEGL::AV_OpenGLES, 3, 1, Debug);
|
|
|
|
|
AndroidEGL::GetInstance()->Init(AndroidEGL::AV_OpenGLES, 2, 0, Debug);
|
|
|
|
|
}
|
2014-09-18 17:49:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|