diff options
Diffstat (limited to 'src')
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) { | |||
| 727 | SetupComputeConstBuffers(kernel); | 727 | SetupComputeConstBuffers(kernel); |
| 728 | SetupComputeGlobalMemory(kernel); | 728 | SetupComputeGlobalMemory(kernel); |
| 729 | 729 | ||
| 730 | // TODO(Rodrigo): Bind images and samplers | ||
| 731 | |||
| 730 | buffer_cache.Unmap(); | 732 | buffer_cache.Unmap(); |
| 731 | 733 | ||
| 732 | bind_ubo_pushbuffer.Bind(); | 734 | 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) { | |||
| 123 | 123 | ||
| 124 | /// Calculates the size of a program stream | 124 | /// Calculates the size of a program stream |
| 125 | std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { | 125 | std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { |
| 126 | if (program.empty()) { | ||
| 127 | return 0; | ||
| 128 | } | ||
| 129 | constexpr std::size_t start_offset = 10; | 126 | constexpr std::size_t start_offset = 10; |
| 130 | // This is the encoded version of BRA that jumps to itself. All Nvidia | 127 | // This is the encoded version of BRA that jumps to itself. All Nvidia |
| 131 | // shaders end with one. | 128 | // shaders end with one. |
| @@ -299,8 +296,8 @@ CachedShader::CachedShader(const ShaderParameters& params, ProgramType program_t | |||
| 299 | 296 | ||
| 300 | Shader CachedShader::CreateStageFromMemory(const ShaderParameters& params, | 297 | Shader CachedShader::CreateStageFromMemory(const ShaderParameters& params, |
| 301 | Maxwell::ShaderProgram program_type, | 298 | Maxwell::ShaderProgram program_type, |
| 302 | const ProgramCode& program_code, | 299 | ProgramCode&& program_code, |
| 303 | const ProgramCode& program_code_b) { | 300 | ProgramCode&& program_code_b) { |
| 304 | const auto code_size{CalculateProgramSize(program_code)}; | 301 | const auto code_size{CalculateProgramSize(program_code)}; |
| 305 | const auto code_size_b{CalculateProgramSize(program_code_b)}; | 302 | const auto code_size_b{CalculateProgramSize(program_code_b)}; |
| 306 | auto result{ | 303 | auto result{ |
| @@ -327,7 +324,7 @@ Shader CachedShader::CreateStageFromCache(const ShaderParameters& params, | |||
| 327 | } | 324 | } |
| 328 | 325 | ||
| 329 | Shader CachedShader::CreateKernelFromMemory(const ShaderParameters& params, | 326 | Shader CachedShader::CreateKernelFromMemory(const ShaderParameters& params, |
| 330 | const ProgramCode& code) { | 327 | ProgramCode&& code) { |
| 331 | auto result{CreateProgram(params.device, ProgramType::Compute, code, {})}; | 328 | auto result{CreateProgram(params.device, ProgramType::Compute, code, {})}; |
| 332 | 329 | ||
| 333 | const auto code_size{CalculateProgramSize(code)}; | 330 | const auto code_size{CalculateProgramSize(code)}; |
| @@ -683,7 +680,7 @@ Shader ShaderCacheOpenGL::GetComputeKernel(GPUVAddr code_addr) { | |||
| 683 | } | 680 | } |
| 684 | 681 | ||
| 685 | // No kernel found - create a new one | 682 | // No kernel found - create a new one |
| 686 | const auto code{GetShaderCode(memory_manager, code_addr, host_ptr)}; | 683 | auto code{GetShaderCode(memory_manager, code_addr, host_ptr)}; |
| 687 | const auto unique_identifier{GetUniqueIdentifier(ProgramType::Compute, code, {})}; | 684 | const auto unique_identifier{GetUniqueIdentifier(ProgramType::Compute, code, {})}; |
| 688 | const auto cpu_addr{*memory_manager.GpuToCpuAddress(code_addr)}; | 685 | const auto cpu_addr{*memory_manager.GpuToCpuAddress(code_addr)}; |
| 689 | const ShaderParameters params{disk_cache, precompiled_programs, device, cpu_addr, | 686 | 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 { | |||
| 55 | public: | 55 | public: |
| 56 | static Shader CreateStageFromMemory(const ShaderParameters& params, | 56 | static Shader CreateStageFromMemory(const ShaderParameters& params, |
| 57 | Maxwell::ShaderProgram program_type, | 57 | Maxwell::ShaderProgram program_type, |
| 58 | const ProgramCode& program_code, | 58 | ProgramCode&& program_code, |
| 59 | const ProgramCode& program_code_b); | 59 | ProgramCode&& program_code_b); |
| 60 | 60 | ||
| 61 | static Shader CreateStageFromCache(const ShaderParameters& params, | 61 | static Shader CreateStageFromCache(const ShaderParameters& params, |
| 62 | Maxwell::ShaderProgram program_type, | 62 | Maxwell::ShaderProgram program_type, |
| 63 | GLShader::ProgramResult result); | 63 | GLShader::ProgramResult result); |
| 64 | 64 | ||
| 65 | static Shader CreateKernelFromMemory(const ShaderParameters& params, const ProgramCode& code); | 65 | static Shader CreateKernelFromMemory(const ShaderParameters& params, ProgramCode&& code); |
| 66 | 66 | ||
| 67 | static Shader CreateKernelFromCache(const ShaderParameters& params, | 67 | static Shader CreateKernelFromCache(const ShaderParameters& params, |
| 68 | GLShader::ProgramResult result); | 68 | 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 @@ | |||
| 11 | namespace OpenGL::GLShader { | 11 | namespace OpenGL::GLShader { |
| 12 | 12 | ||
| 13 | namespace { | 13 | namespace { |
| 14 | constexpr const char* GetStageDebugName(GLenum type) { | 14 | const char* GetStageDebugName(GLenum type) { |
| 15 | switch (type) { | 15 | switch (type) { |
| 16 | case GL_VERTEX_SHADER: | 16 | case GL_VERTEX_SHADER: |
| 17 | return "vertex"; | 17 | return "vertex"; |
| @@ -21,9 +21,9 @@ constexpr const char* GetStageDebugName(GLenum type) { | |||
| 21 | return "fragment"; | 21 | return "fragment"; |
| 22 | case GL_COMPUTE_SHADER: | 22 | case GL_COMPUTE_SHADER: |
| 23 | return "compute"; | 23 | return "compute"; |
| 24 | default: | ||
| 25 | UNREACHABLE(); | ||
| 26 | } | 24 | } |
| 25 | UNIMPLEMENTED(); | ||
| 26 | return "unknown"; | ||
| 27 | } | 27 | } |
| 28 | } // Anonymous namespace | 28 | } // Anonymous namespace |
| 29 | 29 | ||