mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
Limit shaderlog writing behind log_programs setting
This commit is contained in:
parent
f2cac26154
commit
ef587d4cdc
@ -129,8 +129,8 @@ struct D3D12Traits
|
||||
fragmentProgramData.FragmentConstantOffsetCache.push_back(offset);
|
||||
}
|
||||
}
|
||||
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(ID) + ".hlsl", fs::rewrite).write(shader);
|
||||
if (g_cfg.video.log_programs)
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(ID) + ".hlsl", fs::rewrite).write(shader);
|
||||
fragmentProgramData.id = (u32)ID;
|
||||
}
|
||||
|
||||
@ -141,7 +141,8 @@ struct D3D12Traits
|
||||
std::string shaderCode = VS.Decompile();
|
||||
vertexProgramData.Compile(shaderCode, Shader::SHADER_TYPE::SHADER_TYPE_VERTEX);
|
||||
vertexProgramData.vertex_shader_input_count = RSXVP.rsx_vertex_inputs.size();
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(ID) + ".hlsl", fs::rewrite).write(shaderCode);
|
||||
if (g_cfg.video.log_programs)
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(ID) + ".hlsl", fs::rewrite).write(shaderCode);
|
||||
vertexProgramData.id = (u32)ID;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "../GCM.h"
|
||||
#include "../Common/TextureUtils.h"
|
||||
|
||||
#include "Emu/System.h"
|
||||
#include "Utilities/geometry.h"
|
||||
|
||||
#define GL_FRAGMENT_TEXTURES_START 0
|
||||
@ -2421,7 +2422,7 @@ public:
|
||||
{
|
||||
const char* str = src.c_str();
|
||||
const GLint length = (GLint)src.length();
|
||||
|
||||
if (g_cfg.video.log_programs)
|
||||
{
|
||||
std::string base_name;
|
||||
switch (shader_type)
|
||||
|
@ -358,7 +358,8 @@ void GLVertexProgram::Compile()
|
||||
const char* str = shader.c_str();
|
||||
const int strlen = ::narrow<int>(shader.length());
|
||||
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".glsl", fs::rewrite).write(str);
|
||||
if (g_cfg.video.log_programs)
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".glsl", fs::rewrite).write(str);
|
||||
|
||||
glShaderSource(id, 1, &str, &strlen);
|
||||
glCompileShader(id);
|
||||
|
@ -455,7 +455,8 @@ void VKFragmentProgram::Decompile(const RSXFragmentProgram& prog)
|
||||
|
||||
void VKFragmentProgram::Compile()
|
||||
{
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
|
||||
if (g_cfg.video.log_programs)
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
|
||||
handle = shader.compile();
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,8 @@ void VKVertexProgram::Decompile(const RSXVertexProgram& prog)
|
||||
|
||||
void VKVertexProgram::Compile()
|
||||
{
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
|
||||
if (g_cfg.video.log_programs)
|
||||
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
|
||||
handle = shader.compile();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user