mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
VideoCommon: Allow BitfieldExtract in specialized shaders
This commit is contained in:
@ -9,24 +9,6 @@
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
void WriteLightingFunction(ShaderCode& out)
|
||||
{
|
||||
// ==============================================
|
||||
|
Reference in New Issue
Block a user