Commit Graph

175 Commits

Author SHA1 Message Date
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
Jaroslaw Palczynski
65ba5d456f TArray documentation and a coupld of methods deprecation.
Changes mostly in Array.h. The changes in other files are only renames for deprecated functions.

[CL 2312616 by Jaroslaw Palczynski in Main branch]
2014-09-29 04:23:44 -04:00
Rolando Caloca
f95c834450 UE4 - Rename ir_gen_glsl.* to GlslBackend.*
- Fix some warnings

[CL 2310427 by Rolando Caloca in Main branch]
2014-09-25 18:03:18 -04:00
Rolando Caloca
e3fd63ec34 UE4 - Move glsl backend out of ThirdParty into ShaderFormatOpenGL
[CL 2310098 by Rolando Caloca in Main branch]
2014-09-25 14:27:21 -04:00
Rolando Caloca
95e0ed4435 UE4 - CCT now writes out source
[CL 2309773 by Rolando Caloca in Main branch]
2014-09-25 10:31:22 -04:00