From 4dd85f86a89338ff84d05a3981c14f6de1be4606 Mon Sep 17 00:00:00 2001 From: Feng Chen Date: Fri, 19 Nov 2021 15:32:53 +0800 Subject: Implement convert legacy to generic --- src/video_core/renderer_opengl/gl_shader_cache.cpp | 3 +++ src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 42ef67628..310cda6d8 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -44,6 +44,7 @@ using Shader::Backend::GLSL::EmitGLSL; using Shader::Backend::SPIRV::EmitSPIRV; using Shader::Maxwell::MergeDualVertexPrograms; using Shader::Maxwell::TranslateProgram; +using Shader::Maxwell::ConvertLegacyToGeneric; using VideoCommon::ComputeEnvironment; using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; @@ -462,12 +463,14 @@ std::unique_ptr ShaderCache::CreateGraphicsPipeline( MakeRuntimeInfo(key, program, previous_program, glasm_use_storage_buffers, use_glasm)}; switch (device.GetShaderBackend()) { case Settings::ShaderBackend::GLSL: + ConvertLegacyToGeneric(program, runtime_info); sources[stage_index] = EmitGLSL(profile, runtime_info, program, binding); break; case Settings::ShaderBackend::GLASM: sources[stage_index] = EmitGLASM(profile, runtime_info, program, binding); break; case Settings::ShaderBackend::SPIRV: + ConvertLegacyToGeneric(program, runtime_info); sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding); break; } diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index eb8b4e08b..5efa4feb4 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -50,6 +50,7 @@ namespace { using Shader::Backend::SPIRV::EmitSPIRV; using Shader::Maxwell::MergeDualVertexPrograms; using Shader::Maxwell::TranslateProgram; +using Shader::Maxwell::ConvertLegacyToGeneric; using VideoCommon::ComputeEnvironment; using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; @@ -543,6 +544,7 @@ std::unique_ptr PipelineCache::CreateGraphicsPipeline( infos[stage_index] = &program.info; const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)}; + ConvertLegacyToGeneric(program, runtime_info); const std::vector code{EmitSPIRV(profile, runtime_info, program, binding)}; device.SaveShader(code); modules[stage_index] = BuildShader(device, code); -- cgit v1.2.3 From 4908a07c20f98f4b7dd604d1fc6865b47bc5c182 Mon Sep 17 00:00:00 2001 From: vonchenplus Date: Sat, 18 Dec 2021 14:15:34 +0800 Subject: Address format clang --- src/video_core/renderer_opengl/gl_shader_cache.cpp | 2 +- src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 310cda6d8..29c6e1a5f 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -42,9 +42,9 @@ namespace { using Shader::Backend::GLASM::EmitGLASM; using Shader::Backend::GLSL::EmitGLSL; using Shader::Backend::SPIRV::EmitSPIRV; +using Shader::Maxwell::ConvertLegacyToGeneric; using Shader::Maxwell::MergeDualVertexPrograms; using Shader::Maxwell::TranslateProgram; -using Shader::Maxwell::ConvertLegacyToGeneric; using VideoCommon::ComputeEnvironment; using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 5efa4feb4..2728353c8 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -48,9 +48,9 @@ MICROPROFILE_DECLARE(Vulkan_PipelineCache); namespace { using Shader::Backend::SPIRV::EmitSPIRV; +using Shader::Maxwell::ConvertLegacyToGeneric; using Shader::Maxwell::MergeDualVertexPrograms; using Shader::Maxwell::TranslateProgram; -using Shader::Maxwell::ConvertLegacyToGeneric; using VideoCommon::ComputeEnvironment; using VideoCommon::FileEnvironment; using VideoCommon::GenericEnvironment; -- cgit v1.2.3