diff options
| author | Stenzek <stenzek@gmail.com> | 2017-07-20 15:25:24 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-07-30 17:43:59 +1000 |
| commit | 7d78cf0f6fbca526e748590aeb6dfdc3c016669e (patch) | |
| tree | 8aaeae2df72e621fdc722e818d746ad6cbbbf442 /Source/Core/VideoCommon/UberShaderCommon.cpp | |
| parent | 07591e7d5cf1a909a1691492337cda55025c0d20 (diff) | |
ShaderGen: Implement pixel ubershaders
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderCommon.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/UberShaderCommon.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/UberShaderCommon.cpp b/Source/Core/VideoCommon/UberShaderCommon.cpp new file mode 100644 index 0000000000..2c6ba23c28 --- /dev/null +++ b/Source/Core/VideoCommon/UberShaderCommon.cpp @@ -0,0 +1,27 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "VideoCommon/UberShaderCommon.h" +#include "VideoCommon/VideoConfig.h" + +namespace UberShader +{ +void WriteUberShaderCommonHeader(ShaderCode& out, APIType api_type, + const ShaderHostConfig& host_config) +{ + // ============================================== + // BitfieldExtract for APIs which don't have it + // ============================================== + if (!host_config.backend_bitfield) + { + out.Write("uint bitfieldExtract(uint val, int off, int size) {\n" + " // This built-in function is only support in OpenGL 4.0+ and ES 3.1+\n" + " // Microsoft's HLSL compiler automatically optimises this to a bitfield extract " + "instruction.\n" + " uint mask = uint((1 << size) - 1);\n" + " return uint(val >> off) & mask;\n" + "}\n\n"); + } +} +}
\ No newline at end of file |
