2018-03-24 00:51:06 +01:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <functional>
|
2018-10-05 12:37:55 +02:00
|
|
|
#include <optional>
|
2018-03-24 00:51:06 +01:00
|
|
|
#include <string>
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "video_core/shader/shader.h"
|
|
|
|
|
2018-11-17 08:29:10 +01:00
|
|
|
namespace OpenGL::ShaderDecompiler {
|
2018-03-24 00:51:06 +01:00
|
|
|
|
2018-11-17 08:29:10 +01:00
|
|
|
using ProgramCode = std::array<u32, Pica::Shader::MAX_PROGRAM_CODE_LENGTH>;
|
|
|
|
using SwizzleData = std::array<u32, Pica::Shader::MAX_SWIZZLE_DATA_LENGTH>;
|
2018-03-24 00:51:06 +01:00
|
|
|
using RegGetter = std::function<std::string(u32)>;
|
|
|
|
|
|
|
|
std::string GetCommonDeclarations();
|
|
|
|
|
2018-10-05 12:37:55 +02:00
|
|
|
std::optional<std::string> DecompileProgram(const ProgramCode& program_code,
|
|
|
|
const SwizzleData& swizzle_data, u32 main_offset,
|
|
|
|
const RegGetter& inputreg_getter,
|
2019-08-19 02:07:50 +02:00
|
|
|
const RegGetter& outputreg_getter, bool sanitize_mul);
|
2018-03-24 00:51:06 +01:00
|
|
|
|
2018-11-17 08:29:10 +01:00
|
|
|
} // namespace OpenGL::ShaderDecompiler
|