Commit Graph

54 Commits

Author SHA1 Message Date
Marc Audy
e5bb9b4d0d Integrate all non-branch Engine/Source changes from //depot/UE4-Orion to //depot/UE4
#lockdown Ben.Marsh
#platformnotify Josh.Adams

[CL 2718236 by Marc Audy in Main branch]
2015-10-06 15:59:09 -04:00
Martin Mittring
29f89a390c Integrate from Orion
CL 2704794 2704931 2704948 2704962 2705238 2706353 2700643 2705458

        Uniform Buffer layout name

and

more debug info for this and other bugs: OR-7159 CRASH: Client crashed at start of match in D3D11Commands.cpp

Adding OptionalData (key value pairs) to the shaders (to put shader name into the shader code for better debugging), affects all RHI, invalidate DDC key for all shaders, cleanup existing code (was adding 0/1/5 bytes and had to compensate in many areas)

OptionalData:
key is a char, value is up to 255 bytes, up to 64K in total

#platformnotify Josh.Adams

[CL 2706923 by Martin Mittring in Main branch]
2015-09-25 17:34:00 -04:00
Dmitry Rekman
3e6290e814 Bunch of minor Linux cleanups and improvements.
- Mostly coming from MatthewL with changes.
- UE-19705 (getting MAC) - reworked to use ioctl
- UE-14633: IsFirstInstance is now a function on Linux
- UE-16061:dummy windows shouldn't be visible in the task bar.
- UE-18217 fixed.
- Unnecessary printf() removed.
- Set output to non-cached if running under debugger.

#platformnotify Josh.Adams

[CL 2698549 by Dmitry Rekman in Main branch]
2015-09-20 18:16:58 -04:00
Allan Bentham
e4a5934305 Fix FOpenGLCodeHeader serialisation for android. (where TCHAR == 4 bytes)
#codereview Mark.Satterthwaite

[CL 2669028 by Allan Bentham in Main branch]
2015-08-26 06:02:24 -04:00
Mark Satterthwaite
027c88145a Remove the r.Shaders.AvoidFlowControl CVar introduced in 2662625 - setting this by default was causing problems on various platforms and it isn't sufficiently useful to retain. Instead just force the Mac OpenGL shader platform to retain flow-control statements and let everything else use the default as before 2662625.
[CL 2665840 by Mark Satterthwaite in Main branch]
2015-08-24 06:10:23 -04:00
Mark Satterthwaite
1de828bbb1 Merging changes from ZebraBranch that:
- Append the source shader name to the GLSL when debug info is enabled to make it easier to debug.
- Always preserves GLSL flow control for Mac GLSL to improve performance on 2 of 3 vendors.
- Exposes a CVar to control whether to preserve or avoid GLSL flow-control for other shader platforms. The default remains to avoid flow control in GLSL.
#codereview michael.trepka

[CL 2662625 by Mark Satterthwaite in Main branch]
2015-08-20 10:15:09 -04:00
Rolando Caloca
42b256cb79 UE4 - Fix env var; added COMPILER_HLSLCC to shaders
[CL 2658309 by Rolando Caloca in Main branch]
2015-08-17 16:09:30 -04:00
Dmitry Rekman
db93d26078 Linux: some fixes/improvements for shader debugging.
[CL 2642399 by Dmitry Rekman in Main branch]
2015-08-03 16:07:57 -04:00
Rolando Caloca
0b5c4df5dc UE4 - hlslcc - Fixes for command lines; always pack uniforms; fix uninitialized variables
#codereview Dmitry.Rekman

[CL 2639009 by Rolando Caloca in Main branch]
2015-07-30 13:31:13 -04:00
Rolando Caloca
daef6ebed2 UE4 - hlslcc - Common header reader
[CL 2609224 by Rolando Caloca in Main branch]
2015-07-02 11:52:03 -04:00
Rolando Caloca
8b34bd48af UE4 - Fix Precision output for ES platforms
#codereview Dmitry.Rekman, Michael.Trepka, Chris.Babcock

[CL 2592355 by Rolando Caloca in Main branch]
2015-06-18 14:24:11 -04:00
Rolando Caloca
9a899d66d4 UE4 - Mobile Preview for feature level ES3.1/Metal (experimental)
[CL 2510893 by Rolando Caloca in Main branch]
2015-04-13 18:00:32 -04:00
Allan Bentham
64090df1f4 Ensure correct assignment of emulated (ES2) uniform buffer indices for UB's generated within BuildResourceTableMapping(). Typically arises when only sampler related parameters are encountered.
Fixes UE-9804 and probably more.

#codereview nick.penwarden, Rolando.Caloca

[CL 2482912 by Allan Bentham in Main branch]
2015-03-18 08:03:21 -04:00
Rolando Caloca
6cb53ebc04 UE4 - OpenGL - Allow running emulated (packed/flattened) uniform buffers when running PC ES2; use OpenGL.UseEmulatedUBs=1 on your consolevariables.ini
- Only works with -game, not in-editor!
#codereview Allan.Bentham

[CL 2475392 by Rolando Caloca in Main branch]
2015-03-11 13:45:34 -04:00
Rolando Caloca
6868525794 UE4 - hlslcc - Cleanup parser state & change hlslcc entry point to be a class in prep for moving to the Engine (missing Linux libraries)
odereview Dmitry.Rekman

[CL 2471354 by Rolando Caloca in Main branch]
2015-03-06 13:09:36 -05:00
Saul Abreu
79a26091bf Fixed behavior on FString::ParseIntoArray (muliple delimiters overload) functionality to support optionally culling empty strings. Greatly simplified implementation logic. Output parameter now properly named and taken by reference.
#codereview Steve.Robb, Robert.Manuszewski

[CL 2466824 by Saul Abreu in Main branch]
2015-03-02 15:51:37 -05:00
Allan Bentham
b61636e3df ES2: Remap vertex attributes when max vert attribs < 16
Fixes PVR SGX 540 crashes in UE-5155
[Requires shader compile worker rebuild.]

codereview nick.penwarden, chris.babcock, rolando.caloca

[CL 2460254 by Allan Bentham in Main branch]
2015-02-25 10:25:20 -05:00
Mark Satterthwaite
65e1a105de Shader caching has been updated to include the option to record draw-states used for each shader so that they may be pre-drawn to reduce in-driver hitching.
- This is especially important on OS X OpenGL where these hitches can be equivalent to several frames, so it is enabled by default for this platform.
- The logging of draw calls is turned on/off with r.UseShaderDrawLog and incurs a fixed overhead as all RHI state is tracked & recorded into the shader cache.
- The actual predrawing is turned on/off with r.UseShaderPredraw and requires an existing cache to be useful, the predrawing takes place at frame-end and can be controlled with r.PredrawBatchTime which the time in ms to spend predrawing each frame until complete, or -1 to do it in one go (currently the default).
- The shader cache is now also versioned with the game able to supply a version distinct from the engine, so that old caches may be invalidated if/when required.
- The shader cache is now compatible with OpenGL SM4 & SM5 on Windows & probably Linux too.
- It may not work correctly with desktop ES2 emulation as that is still untested.
- To make it easier to add to other RHIs the API has been made simper to avoid lots of exposed branches.

#codereview michael.trepka, dmitry.rekman

[CL 2460109 by Mark Satterthwaite in Main branch]
2015-02-25 08:13:48 -05:00
Mark Satterthwaite
83ad7e246f Implemented desktop OpenGL support for GL_ARB_separate_shader_objects without requiring any additional shader platforms to reduce shader compile/link hitches.
- Shaders which emit layout location data use INTERFACE_LOCATION & INTERFACE_BLOCK macros to defer to the runtime whether they can be used as separable or non-separable shaders.
- The runtime supplies the correct #define for each so that the shaders still work on platforms where the glLinkProgram implementation fails with separable shader code.
- Shader model 5 platforms (GLSL 430 or ES 3.10) which were already specifying & using layout location data continue to do so, even when using glLinkProgram.
- The 'OpenGL.UseSeparateShaderObjects' console variable allows switching between SSO/Link modes between executions, but not dynamically at runtime.
- Only defaults to on for Mac as that is the only platform which can guarantee that the extension is always available & so far the most tested platform.
- Updated hlslcc binaries are supplied for Mac, Linux & Windows.
- Added an OpenGL RHI stat for shader first draw time so that it is easy to see why hitches occur during runtime due to in-driver shader compilation.

reviewedby michael.trepka, nick.penwarden, dmitry.rekman, rolando.caloca

[CL 2435530 by Mark Satterthwaite in Main branch]
2015-02-06 11:35:30 -05:00
Jaroslaw Surowiec
1085fb3b7a Core - UE/UE-6813 - Confusing API: We have both FMemory::MemZero() and FMemory:Memzero()
[CL 2405761 by Jaroslaw Surowiec in Main branch]
2015-01-14 04:21:10 -05:00
Rolando Caloca
c0db1bfb0e UE4 - hlslcc & Metal
- Metal - Fix for RWBuffer<uint> generating swizzle .x
- hlslcc - Support for RWStructuredBuffer

[CL 2388726 by Rolando Caloca in Main branch]
2014-12-15 12:21:10 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Rolando Caloca
1e13c6f58a UE4 - hlslcc - Rollback //depot/UE4/Engine/Source/ThirdParty/hlslcc to changelist 2316264
[CL 2319202 by Rolando Caloca in Main branch]
2014-10-03 20:02:42 -04:00
Rolando Caloca
88ff3983ea UE4 - Revert CCT
[CL 2313607 by Rolando Caloca in Main branch]
2014-09-29 18:57:21 -04:00
Rolando Caloca
941da65c63 hlslcc - Move hlslcc interface out of each shader format and into ShaderCompilerCommon module
- Delete hlslcc exe files (not needed anymore)

[CL 2312870 by Rolando Caloca in Main branch]
2014-09-29 10:10:28 -04:00