| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <fmt/format.h> |
| 7 |
#include <functional> |
| 8 |
|
| 9 |
#include "Common/CommonTypes.h" |
| 10 |
|
| 11 |
#include "VideoCommon/RenderState.h" |
| 12 |
#include "VideoCommon/ShaderGenCommon.h" |
| 13 |
|
| 14 |
enum class APIType; |
| 15 |
|
| 16 |
#pragma pack(1) |
| 17 |
struct geometry_shader_uid_data |
| 18 |
{ |
| 19 |
u32 NumValues() const { return sizeof(geometry_shader_uid_data); } |
| 20 |
bool IsPassthrough() const; |
| 21 |
|
| 22 |
u32 numTexGens : 4; |
| 23 |
u32 primitive_type : 2; |
| 24 |
}; |
| 25 |
#pragma pack() |
| 26 |
|
| 27 |
using GeometryShaderUid = ShaderUid<geometry_shader_uid_data>; |
| 28 |
|
| 29 |
ShaderCode GenerateGeometryShaderCode(APIType api_type, const ShaderHostConfig& host_config, |
| 30 |
const geometry_shader_uid_data* uid_data); |
| 31 |
GeometryShaderUid GetGeometryShaderUid(PrimitiveType primitive_type); |
| 32 |
void EnumerateGeometryShaderUids(const std::function<void(const GeometryShaderUid&)>& callback); |
| 33 |
|
| 34 |
template <> |
| 35 |
struct fmt::formatter<geometry_shader_uid_data> |
| 36 |
{ |
| 37 |
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } |
| 38 |
template <typename FormatContext> |
| 39 |
auto format(const geometry_shader_uid_data& uid, FormatContext& ctx) const |
| 40 |
{ |
| 41 |
return fmt::format_to(ctx.out(), "passthrough: {}, {} tex gens, primitive type {}", |
| 42 |
uid.IsPassthrough(), uid.numTexGens, uid.primitive_type); |
| 43 |
} |
| 44 |
}; |