2020-12-05 13:08:24 +01:00
|
|
|
#pragma once
|
2017-08-04 16:11:39 +02:00
|
|
|
#include <sstream>
|
|
|
|
|
|
2019-05-29 08:52:38 +02:00
|
|
|
#include "GLSLTypes.h"
|
2017-08-04 16:11:39 +02:00
|
|
|
#include "ShaderParam.h"
|
|
|
|
|
|
2020-12-19 12:28:10 +01:00
|
|
|
namespace rsx
|
|
|
|
|
{
|
|
|
|
|
// TODO: Move this somewhere else once more compilers are supported other than glsl
|
|
|
|
|
enum texture_control_bits
|
|
|
|
|
{
|
2021-08-29 22:22:41 +02:00
|
|
|
GAMMA_A = 0,
|
|
|
|
|
GAMMA_R,
|
2020-12-19 12:28:10 +01:00
|
|
|
GAMMA_G,
|
|
|
|
|
GAMMA_B,
|
|
|
|
|
ALPHAKILL,
|
|
|
|
|
RENORMALIZE,
|
|
|
|
|
EXPAND_A,
|
|
|
|
|
EXPAND_R,
|
|
|
|
|
EXPAND_G,
|
|
|
|
|
EXPAND_B,
|
|
|
|
|
DEPTH_FLOAT,
|
2022-03-13 09:32:04 +01:00
|
|
|
DEPTH_COMPARE_OP,
|
|
|
|
|
DEPTH_COMPARE_1,
|
|
|
|
|
DEPTH_COMPARE_2,
|
2022-04-01 20:53:25 +02:00
|
|
|
FILTERED_MAG,
|
|
|
|
|
FILTERED_MIN,
|
2022-03-13 09:32:04 +01:00
|
|
|
UNNORMALIZED_COORDS,
|
2020-12-19 12:28:10 +01:00
|
|
|
|
|
|
|
|
GAMMA_CTRL_MASK = (1 << GAMMA_R) | (1 << GAMMA_G) | (1 << GAMMA_B) | (1 << GAMMA_A),
|
|
|
|
|
EXPAND_MASK = (1 << EXPAND_R) | (1 << EXPAND_G) | (1 << EXPAND_B) | (1 << EXPAND_A),
|
|
|
|
|
EXPAND_OFFSET = EXPAND_A
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-09-26 00:14:10 +02:00
|
|
|
|
2017-08-21 19:56:31 +02:00
|
|
|
namespace program_common
|
|
|
|
|
{
|
2020-12-19 12:28:10 +01:00
|
|
|
void insert_compare_op(std::ostream& OS, bool low_precision);
|
|
|
|
|
void insert_compare_op_vector(std::ostream& OS);
|
|
|
|
|
void insert_fog_declaration(std::ostream& OS, const std::string& wide_vector_type, const std::string& input_coord, bool declare = false);
|
2017-08-21 19:56:31 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-04 16:11:39 +02:00
|
|
|
namespace glsl
|
|
|
|
|
{
|
2020-12-19 12:28:10 +01:00
|
|
|
std::string getFloatTypeNameImpl(usz elementCount);
|
|
|
|
|
std::string getHalfTypeNameImpl(usz elementCount);
|
|
|
|
|
std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1, bool scalar = false);
|
|
|
|
|
void insert_vertex_input_fetch(std::stringstream& OS, glsl_rules rules, bool glsl4_compliant=true);
|
|
|
|
|
void insert_rop_init(std::ostream& OS);
|
|
|
|
|
void insert_rop(std::ostream& OS, const shader_properties& props);
|
|
|
|
|
void insert_glsl_legacy_function(std::ostream& OS, const shader_properties& props);
|
|
|
|
|
void insert_fog_declaration(std::ostream& OS);
|
|
|
|
|
std::string getFunctionImpl(FUNCTION f);
|
|
|
|
|
void insert_subheader_block(std::ostream& OS);
|
2018-09-26 00:14:10 +02:00
|
|
|
}
|