2022-04-23 08:59:50 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2021-01-09 06:30:07 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shader_recompiler/environment.h"
|
2021-06-16 04:49:19 +00:00
|
|
|
#include "shader_recompiler/frontend/ir/basic_block.h"
|
2021-02-06 02:11:23 +00:00
|
|
|
#include "shader_recompiler/frontend/ir/program.h"
|
2021-01-09 06:30:07 +00:00
|
|
|
#include "shader_recompiler/frontend/maxwell/control_flow.h"
|
2021-02-06 02:11:23 +00:00
|
|
|
#include "shader_recompiler/object_pool.h"
|
2021-11-19 07:32:53 +00:00
|
|
|
#include "shader_recompiler/runtime_info.h"
|
2021-01-09 06:30:07 +00:00
|
|
|
|
2022-03-19 04:59:56 +00:00
|
|
|
namespace Shader {
|
|
|
|
struct HostTranslateInfo;
|
|
|
|
}
|
|
|
|
|
2021-01-09 06:30:07 +00:00
|
|
|
namespace Shader::Maxwell {
|
|
|
|
|
2021-02-06 02:11:23 +00:00
|
|
|
[[nodiscard]] IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool,
|
|
|
|
ObjectPool<IR::Block>& block_pool, Environment& env,
|
2021-06-16 06:03:08 +00:00
|
|
|
Flow::CFG& cfg, const HostTranslateInfo& host_info);
|
2021-01-09 06:30:07 +00:00
|
|
|
|
2021-04-18 23:03:38 +00:00
|
|
|
[[nodiscard]] IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b,
|
|
|
|
Environment& env_vertex_b);
|
2021-05-01 12:56:25 +00:00
|
|
|
|
2022-01-25 17:16:06 +00:00
|
|
|
void ConvertLegacyToGeneric(IR::Program& program, const RuntimeInfo& runtime_info);
|
2021-11-19 07:32:53 +00:00
|
|
|
|
2022-11-30 22:16:00 +00:00
|
|
|
// Maxwell v1 and older Nvidia cards don't support setting gl_Layer from non-geometry stages.
|
|
|
|
// This creates a workaround by setting the layer as a generic output and creating a
|
|
|
|
// passthrough geometry shader that reads the generic and sets the layer.
|
|
|
|
[[nodiscard]] IR::Program GenerateGeometryPassthrough(ObjectPool<IR::Inst>& inst_pool,
|
|
|
|
ObjectPool<IR::Block>& block_pool,
|
|
|
|
const HostTranslateInfo& host_info,
|
|
|
|
IR::Program& source_program,
|
|
|
|
Shader::OutputTopology output_topology);
|
|
|
|
|
2021-01-09 06:30:07 +00:00
|
|
|
} // namespace Shader::Maxwell
|