2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-10-16 18:52:32 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-12-09 23:00:08 +01:00
|
|
|
#include <fmt/format.h>
|
2017-07-20 05:52:23 +02:00
|
|
|
#include <functional>
|
2021-12-09 23:00:08 +01:00
|
|
|
|
2017-02-01 16:56:13 +01:00
|
|
|
#include "Common/CommonTypes.h"
|
2021-12-09 23:00:08 +01:00
|
|
|
|
2017-04-30 10:07:57 +02:00
|
|
|
#include "VideoCommon/RenderState.h"
|
2014-10-16 18:52:32 +02:00
|
|
|
#include "VideoCommon/ShaderGenCommon.h"
|
2016-07-22 01:04:57 +02:00
|
|
|
|
|
|
|
enum class APIType;
|
2014-10-16 18:52:32 +02:00
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
struct geometry_shader_uid_data
|
|
|
|
{
|
|
|
|
u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
|
2017-06-24 10:18:53 +02:00
|
|
|
bool IsPassthrough() const;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2014-11-22 19:18:45 +01:00
|
|
|
u32 numTexGens : 4;
|
2017-09-09 10:30:15 +02:00
|
|
|
u32 primitive_type : 2;
|
2014-10-16 18:52:32 +02:00
|
|
|
};
|
|
|
|
#pragma pack()
|
|
|
|
|
2019-05-30 07:05:06 +02:00
|
|
|
using GeometryShaderUid = ShaderUid<geometry_shader_uid_data>;
|
2014-10-16 18:52:32 +02:00
|
|
|
|
2021-08-02 00:11:22 +02:00
|
|
|
ShaderCode GenerateGeometryShaderCode(APIType api_type, const ShaderHostConfig& host_config,
|
2017-07-20 09:10:02 +02:00
|
|
|
const geometry_shader_uid_data* uid_data);
|
2017-04-30 10:07:57 +02:00
|
|
|
GeometryShaderUid GetGeometryShaderUid(PrimitiveType primitive_type);
|
2017-07-20 05:52:23 +02:00
|
|
|
void EnumerateGeometryShaderUids(const std::function<void(const GeometryShaderUid&)>& callback);
|
2021-12-09 23:00:08 +01:00
|
|
|
|
|
|
|
template <>
|
|
|
|
struct fmt::formatter<geometry_shader_uid_data>
|
|
|
|
{
|
|
|
|
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
|
|
|
template <typename FormatContext>
|
2022-01-13 02:16:29 +01:00
|
|
|
auto format(const geometry_shader_uid_data& uid, FormatContext& ctx) const
|
2021-12-09 23:00:08 +01:00
|
|
|
{
|
2022-01-13 07:52:21 +01:00
|
|
|
return fmt::format_to(ctx.out(), "passthrough: {}, {} tex gens, primitive type {}",
|
|
|
|
uid.IsPassthrough(), uid.numTexGens, uid.primitive_type);
|
2021-12-09 23:00:08 +01:00
|
|
|
}
|
|
|
|
};
|