mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-10-07 02:43:32 +00:00
GPU: Cleanup definition of shader resources.
Was in the wrong header file, which was a bit confusing.
This commit is contained in:
parent
0496ca32ff
commit
ec309d55ab
@ -118,7 +118,7 @@ void ShaderLanguageDesc::Init(ShaderLanguage lang) {
|
||||
}
|
||||
}
|
||||
|
||||
void init_resources(TBuiltInResource &Resources) {
|
||||
void InitShaderResources(TBuiltInResource &Resources) {
|
||||
Resources.maxLights = 32;
|
||||
Resources.maxClipPlanes = 6;
|
||||
Resources.maxTextureUnits = 32;
|
||||
|
@ -6,6 +6,9 @@
|
||||
|
||||
#include "Common/Common.h"
|
||||
|
||||
struct TBuiltInResource;
|
||||
void InitShaderResources(TBuiltInResource &Resources);
|
||||
|
||||
// GLSL_1xx and GLSL_3xx each cover a lot of sub variants. All the little quirks
|
||||
// that differ are covered in ShaderLanguageDesc.
|
||||
// Defined as a bitmask so stuff like GetSupportedShaderLanguages can return combinations.
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "Common/GPU/ShaderTranslation.h"
|
||||
#include "ext/glslang/SPIRV/GlslangToSpv.h"
|
||||
#include "Common/GPU/thin3d.h"
|
||||
#include "Common/GPU/Shader.h"
|
||||
#include "Common/GPU/OpenGL/GLFeatures.h"
|
||||
|
||||
#include "ext/SPIRV-Cross/spirv.hpp"
|
||||
@ -51,8 +52,6 @@
|
||||
#include "ext/SPIRV-Cross/spirv_hlsl.hpp"
|
||||
#endif
|
||||
|
||||
extern void init_resources(TBuiltInResource &Resources);
|
||||
|
||||
static EShLanguage GetShLanguageFromStage(const ShaderStage stage) {
|
||||
switch (stage) {
|
||||
case ShaderStage::Vertex: return EShLangVertex;
|
||||
@ -241,7 +240,7 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, const ShaderLan
|
||||
const char *shaderStrings[1]{};
|
||||
|
||||
TBuiltInResource Resources{};
|
||||
init_resources(Resources);
|
||||
InitShaderResources(Resources);
|
||||
|
||||
// Don't enable SPIR-V and Vulkan rules when parsing GLSL. Our postshaders are written in oldschool GLES 2.0.
|
||||
EShMessages messages = EShMessages::EShMsgDefault;
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include "Common/System/System.h"
|
||||
#include "Common/System/Display.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/GPU/Shader.h"
|
||||
#include "Common/GPU/Vulkan/VulkanContext.h"
|
||||
#include "Common/GPU/Vulkan/VulkanDebug.h"
|
||||
#include "GPU/Common/ShaderCommon.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Core/Config.h"
|
||||
|
||||
@ -1317,7 +1317,7 @@ bool GLSLtoSPV(const VkShaderStageFlagBits shader_type, const char *sourceCode,
|
||||
glslang::TProgram program;
|
||||
const char *shaderStrings[1];
|
||||
TBuiltInResource Resources{};
|
||||
init_resources(Resources);
|
||||
InitShaderResources(Resources);
|
||||
|
||||
int defaultVersion = 0;
|
||||
EShMessages messages;
|
||||
|
@ -162,6 +162,3 @@ enum {
|
||||
|
||||
ATTR_COUNT,
|
||||
};
|
||||
|
||||
struct TBuiltInResource;
|
||||
void init_resources(TBuiltInResource &Resources);
|
||||
|
Loading…
Reference in New Issue
Block a user