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]
- 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]
- 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]
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]
- 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]
- 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]