| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <functional> |
| 7 |
#include "VideoCommon/PixelShaderGen.h" |
| 8 |
|
| 9 |
namespace UberShader |
| 10 |
{ |
| 11 |
#pragma pack(1) |
| 12 |
struct vertex_ubershader_uid_data |
| 13 |
{ |
| 14 |
u32 num_texgens : 4; |
| 15 |
|
| 16 |
u32 NumValues() const { return sizeof(vertex_ubershader_uid_data); } |
| 17 |
}; |
| 18 |
#pragma pack() |
| 19 |
|
| 20 |
using VertexShaderUid = ShaderUid<vertex_ubershader_uid_data>; |
| 21 |
|
| 22 |
VertexShaderUid GetVertexShaderUid(); |
| 23 |
|
| 24 |
ShaderCode GenVertexShader(APIType api_type, const ShaderHostConfig& host_config, |
| 25 |
const vertex_ubershader_uid_data* uid_data); |
| 26 |
void EnumerateVertexShaderUids(const std::function<void(const VertexShaderUid&)>& callback); |
| 27 |
} |
| 28 |
|
| 29 |
template <> |
| 30 |
struct fmt::formatter<UberShader::vertex_ubershader_uid_data> |
| 31 |
{ |
| 32 |
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } |
| 33 |
template <typename FormatContext> |
| 34 |
auto format(const UberShader::vertex_ubershader_uid_data& uid, FormatContext& ctx) const |
| 35 |
{ |
| 36 |
return fmt::format_to(ctx.out(), "Vertex UberShader for {} texgens", uid.num_texgens); |
| 37 |
} |
| 38 |
}; |