mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: Allow BitfieldExtract in specialized shaders
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
#include "Common/BitField.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/TypeUtils.h"
|
||||
|
||||
enum class APIType;
|
||||
|
||||
@ -177,6 +178,8 @@ std::string GetDiskShaderCacheFileName(APIType api_type, const char* type, bool
|
||||
bool include_host_config, bool include_api = true);
|
||||
|
||||
void WriteIsNanHeader(ShaderCode& out, APIType api_type);
|
||||
void WriteBitfieldExtractHeader(ShaderCode& out, APIType api_type,
|
||||
const ShaderHostConfig& host_config);
|
||||
|
||||
void GenerateVSOutputMembers(ShaderCode& object, APIType api_type, u32 texgens,
|
||||
const ShaderHostConfig& host_config, std::string_view qualifier);
|
||||
@ -195,6 +198,15 @@ void AssignVSOutputMembers(ShaderCode& object, std::string_view a, std::string_v
|
||||
const char* GetInterpolationQualifier(bool msaa, bool ssaa, bool in_glsl_interface_block = false,
|
||||
bool in = false);
|
||||
|
||||
// bitfieldExtract generator for BitField types
|
||||
template <auto ptr_to_bitfield_member>
|
||||
std::string BitfieldExtract(std::string_view source)
|
||||
{
|
||||
using BitFieldT = Common::MemberType<ptr_to_bitfield_member>;
|
||||
return fmt::format("bitfieldExtract({}, {}, {})", source, static_cast<u32>(BitFieldT::StartBit()),
|
||||
static_cast<u32>(BitFieldT::NumBits()));
|
||||
}
|
||||
|
||||
// Constant variable names
|
||||
#define I_COLORS "color"
|
||||
#define I_KCOLORS "k"
|
||||
|
Reference in New Issue
Block a user