diff options
| author | 2021-05-19 21:58:32 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | eaff1030de07f3739794207403ea833ee91c0034 (patch) | |
| tree | c2e6650ba13f55854b5cba9a79d9afc01528eb96 /src/video_core | |
| parent | spirv: Reduce log severity of mismatching denorm rules (diff) | |
| download | yuzu-eaff1030de07f3739794207403ea833ee91c0034.tar.gz yuzu-eaff1030de07f3739794207403ea833ee91c0034.tar.xz yuzu-eaff1030de07f3739794207403ea833ee91c0034.zip | |
glsl: Initial backend
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 9391a4cd9..4387532ab 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include "core/core.h" | 19 | #include "core/core.h" |
| 20 | #include "core/frontend/emu_window.h" | 20 | #include "core/frontend/emu_window.h" |
| 21 | #include "shader_recompiler/backend/glasm/emit_glasm.h" | 21 | #include "shader_recompiler/backend/glasm/emit_glasm.h" |
| 22 | #include "shader_recompiler/backend/glsl/emit_glsl.h" | ||
| 22 | #include "shader_recompiler/backend/spirv/emit_spirv.h" | 23 | #include "shader_recompiler/backend/spirv/emit_spirv.h" |
| 23 | #include "shader_recompiler/frontend/ir/program.h" | 24 | #include "shader_recompiler/frontend/ir/program.h" |
| 24 | #include "shader_recompiler/frontend/maxwell/control_flow.h" | 25 | #include "shader_recompiler/frontend/maxwell/control_flow.h" |
| @@ -40,6 +41,7 @@ | |||
| 40 | namespace OpenGL { | 41 | namespace OpenGL { |
| 41 | namespace { | 42 | namespace { |
| 42 | using Shader::Backend::GLASM::EmitGLASM; | 43 | using Shader::Backend::GLASM::EmitGLASM; |
| 44 | using Shader::Backend::GLSL::EmitGLSL; | ||
| 43 | using Shader::Backend::SPIRV::EmitSPIRV; | 45 | using Shader::Backend::SPIRV::EmitSPIRV; |
| 44 | using Shader::Maxwell::MergeDualVertexPrograms; | 46 | using Shader::Maxwell::MergeDualVertexPrograms; |
| 45 | using Shader::Maxwell::TranslateProgram; | 47 | using Shader::Maxwell::TranslateProgram; |
| @@ -435,7 +437,8 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline( | |||
| 435 | const std::string code{EmitGLASM(profile, runtime_info, program, binding)}; | 437 | const std::string code{EmitGLASM(profile, runtime_info, program, binding)}; |
| 436 | assembly_programs[stage_index] = CompileProgram(code, AssemblyStage(stage_index)); | 438 | assembly_programs[stage_index] = CompileProgram(code, AssemblyStage(stage_index)); |
| 437 | } else { | 439 | } else { |
| 438 | const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding)}; | 440 | const auto code{EmitGLSL(profile, program, binding)}; |
| 441 | OGLShader shader; | ||
| 439 | AttachShader(Stage(stage_index), source_program.handle, code); | 442 | AttachShader(Stage(stage_index), source_program.handle, code); |
| 440 | } | 443 | } |
| 441 | } | 444 | } |
| @@ -489,7 +492,7 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(ShaderPools& | |||
| 489 | const std::string code{EmitGLASM(profile, info, program)}; | 492 | const std::string code{EmitGLASM(profile, info, program)}; |
| 490 | asm_program = CompileProgram(code, GL_COMPUTE_PROGRAM_NV); | 493 | asm_program = CompileProgram(code, GL_COMPUTE_PROGRAM_NV); |
| 491 | } else { | 494 | } else { |
| 492 | const std::vector<u32> code{EmitSPIRV(profile, program)}; | 495 | const auto code{EmitGLSL(profile, program)}; |
| 493 | source_program.handle = glCreateProgram(); | 496 | source_program.handle = glCreateProgram(); |
| 494 | AttachShader(GL_COMPUTE_SHADER, source_program.handle, code); | 497 | AttachShader(GL_COMPUTE_SHADER, source_program.handle, code); |
| 495 | LinkProgram(source_program.handle); | 498 | LinkProgram(source_program.handle); |