diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-15 21:29:25 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-15 22:38:25 +0200 |
commit | 56bca83bde9432bbc98b00f3fb3caf31b41f1da1 (patch) | |
tree | c8c42506a9ddaa93a0a69f985903d14678ffe1f1 | |
parent | gl_shader_cache: Address CI issues (diff) | |
download | yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar.gz yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar.bz2 yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar.lz yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar.xz yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.tar.zst yuzu-56bca83bde9432bbc98b00f3fb3caf31b41f1da1.zip |
4 files changed, 12 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index f4728f50c..9cd4cf7b8 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -727,6 +727,8 @@ void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) { SetupComputeConstBuffers(kernel); SetupComputeGlobalMemory(kernel); + // TODO(Rodrigo): Bind images and samplers + buffer_cache.Unmap(); bind_ubo_pushbuffer.Bind(); diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 2b30fb522..4890d4a73 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -123,9 +123,6 @@ ProgramType GetProgramType(Maxwell::ShaderProgram program) { /// Calculates the size of a program stream std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { - if (program.empty()) { - return 0; - } constexpr std::size_t start_offset = 10; // This is the encoded version of BRA that jumps to itself. All Nvidia // shaders end with one. @@ -299,8 +296,8 @@ CachedShader::CachedShader(const ShaderParameters& params, ProgramType program_t Shader CachedShader::CreateStageFromMemory(const ShaderParameters& params, Maxwell::ShaderProgram program_type, - const ProgramCode& program_code, - const ProgramCode& program_code_b) { + ProgramCode&& program_code, + ProgramCode&& program_code_b) { const auto code_size{CalculateProgramSize(program_code)}; const auto code_size_b{CalculateProgramSize(program_code_b)}; auto result{ @@ -327,7 +324,7 @@ Shader CachedShader::CreateStageFromCache(const ShaderParameters& params, } Shader CachedShader::CreateKernelFromMemory(const ShaderParameters& params, - const ProgramCode& code) { + ProgramCode&& code) { auto result{CreateProgram(params.device, ProgramType::Compute, code, {})}; const auto code_size{CalculateProgramSize(code)}; @@ -683,7 +680,7 @@ Shader ShaderCacheOpenGL::GetComputeKernel(GPUVAddr code_addr) { } // No kernel found - create a new one - const auto code{GetShaderCode(memory_manager, code_addr, host_ptr)}; + auto code{GetShaderCode(memory_manager, code_addr, host_ptr)}; const auto unique_identifier{GetUniqueIdentifier(ProgramType::Compute, code, {})}; const auto cpu_addr{*memory_manager.GpuToCpuAddress(code_addr)}; const ShaderParameters params{disk_cache, precompiled_programs, device, cpu_addr, diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 7d84ffbab..5e86c6648 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -55,14 +55,14 @@ class CachedShader final : public RasterizerCacheObject { public: static Shader CreateStageFromMemory(const ShaderParameters& params, Maxwell::ShaderProgram program_type, - const ProgramCode& program_code, - const ProgramCode& program_code_b); + ProgramCode&& program_code, + ProgramCode&& program_code_b); static Shader CreateStageFromCache(const ShaderParameters& params, Maxwell::ShaderProgram program_type, GLShader::ProgramResult result); - static Shader CreateKernelFromMemory(const ShaderParameters& params, const ProgramCode& code); + static Shader CreateKernelFromMemory(const ShaderParameters& params, ProgramCode&& code); static Shader CreateKernelFromCache(const ShaderParameters& params, GLShader::ProgramResult result); diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index bab7d1a49..9e74eda0d 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -11,7 +11,7 @@ namespace OpenGL::GLShader { namespace { -constexpr const char* GetStageDebugName(GLenum type) { +const char* GetStageDebugName(GLenum type) { switch (type) { case GL_VERTEX_SHADER: return "vertex"; @@ -21,9 +21,9 @@ constexpr const char* GetStageDebugName(GLenum type) { return "fragment"; case GL_COMPUTE_SHADER: return "compute"; - default: - UNREACHABLE(); } + UNIMPLEMENTED(); + return "unknown"; } } // Anonymous namespace |