rsx: Refactor out GLSLTypes from GLSLCommon to avoid warning spam due to unused functions when included in settings dialog code

This commit is contained in:
kd-11 2019-05-29 09:52:38 +03:00 committed by kd-11
parent 6e92516070
commit f2cac26154
5 changed files with 36 additions and 30 deletions

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <sstream> #include <sstream>
#include "GLSLTypes.h"
#include "ShaderParam.h" #include "ShaderParam.h"
namespace program_common namespace program_common
@ -132,19 +133,6 @@ namespace program_common
namespace glsl namespace glsl
{ {
enum program_domain
{
glsl_vertex_program = 0,
glsl_fragment_program = 1,
glsl_compute_program = 2
};
enum glsl_rules
{
glsl_rules_opengl4,
glsl_rules_rpirv
};
static std::string getFloatTypeNameImpl(size_t elementCount) static std::string getFloatTypeNameImpl(size_t elementCount)
{ {
switch (elementCount) switch (elementCount)
@ -500,20 +488,6 @@ namespace glsl
" ocol3 = " << reg3 << ";\n\n"; " ocol3 = " << reg3 << ";\n\n";
} }
struct shader_properties
{
glsl::program_domain domain;
// Applicable in vertex stage
bool require_lit_emulation;
// Only relevant for fragment programs
bool require_wpos;
bool require_depth_conversion;
bool require_texture_ops;
bool emulate_shadow_compare;
bool low_precision_tests;
};
static void insert_glsl_legacy_function(std::ostream& OS, const shader_properties& props) static void insert_glsl_legacy_function(std::ostream& OS, const shader_properties& props)
{ {
OS << "#define _select mix\n"; OS << "#define _select mix\n";

View File

@ -0,0 +1,31 @@
#pragma once
namespace glsl
{
enum program_domain
{
glsl_vertex_program = 0,
glsl_fragment_program = 1,
glsl_compute_program = 2
};
enum glsl_rules
{
glsl_rules_opengl4,
glsl_rules_spirv
};
struct shader_properties
{
glsl::program_domain domain;
// Applicable in vertex stage
bool require_lit_emulation;
// Only relevant for fragment programs
bool require_wpos;
bool require_depth_conversion;
bool require_texture_ops;
bool emulate_shadow_compare;
bool low_precision_tests;
};
};

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../Common/ShaderParam.h" #include "../Common/ShaderParam.h"
#include "../Common/GLSLCommon.h" #include "../Common/GLSLTypes.h"
namespace vk namespace vk
{ {

View File

@ -2,9 +2,9 @@
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "VKFragmentProgram.h" #include "VKFragmentProgram.h"
#include "VKCommonDecompiler.h" #include "VKCommonDecompiler.h"
#include "VKHelpers.h" #include "VKHelpers.h"
#include "../Common/GLSLCommon.h"
#include "../GCM.h" #include "../GCM.h"
std::string VKFragmentDecompilerThread::getFloatTypeName(size_t elementCount) std::string VKFragmentDecompilerThread::getFloatTypeName(size_t elementCount)

View File

@ -4,6 +4,7 @@
#include "VKVertexProgram.h" #include "VKVertexProgram.h"
#include "VKCommonDecompiler.h" #include "VKCommonDecompiler.h"
#include "VKHelpers.h" #include "VKHelpers.h"
#include "../Common/GLSLCommon.h"
std::string VKVertexDecompilerThread::getFloatTypeName(size_t elementCount) std::string VKVertexDecompilerThread::getFloatTypeName(size_t elementCount)
{ {
@ -205,7 +206,7 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
properties2.low_precision_tests = false; properties2.low_precision_tests = false;
glsl::insert_glsl_legacy_function(OS, properties2); glsl::insert_glsl_legacy_function(OS, properties2);
glsl::insert_vertex_input_fetch(OS, glsl::glsl_rules_rpirv); glsl::insert_vertex_input_fetch(OS, glsl::glsl_rules_spirv);
std::string parameters = ""; std::string parameters = "";
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)