diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-20 01:55:14 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-03-20 05:07:30 +0100 |
commit | d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd (patch) | |
tree | d11bb0678d38a6d24718f24befe23f04a30afb81 | |
parent | renderer_gl: Port over gl_shader_decompiler module from Citra. (diff) | |
download | yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar.gz yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar.bz2 yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar.lz yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar.xz yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.tar.zst yuzu-d7b1ebe4a8a11cb1ac23b084e8014fae9cc6b7dd.zip |
-rw-r--r-- | src/video_core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 20 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.h | 66 |
3 files changed, 88 insertions, 0 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index cce29231f..df4368f52 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -18,6 +18,8 @@ add_library(video_core STATIC renderer_opengl/gl_resource_manager.h renderer_opengl/gl_shader_decompiler.cpp renderer_opengl/gl_shader_decompiler.h + renderer_opengl/gl_shader_gen.cpp + renderer_opengl/gl_shader_gen.h renderer_opengl/gl_shader_util.cpp renderer_opengl/gl_shader_util.h renderer_opengl/gl_state.cpp diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp new file mode 100644 index 000000000..f242bce1d --- /dev/null +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -0,0 +1,20 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/assert.h" +#include "video_core/renderer_opengl/gl_shader_gen.h" + +namespace GLShader { + +std::string GenerateVertexShader(const MaxwellVSConfig& config) { + UNIMPLEMENTED(); + return {}; +} + +std::string GenerateFragmentShader(const MaxwellFSConfig& config) { + UNIMPLEMENTED(); + return {}; +} + +} // namespace GLShader diff --git a/src/video_core/renderer_opengl/gl_shader_gen.h b/src/video_core/renderer_opengl/gl_shader_gen.h new file mode 100644 index 000000000..5101e7d30 --- /dev/null +++ b/src/video_core/renderer_opengl/gl_shader_gen.h @@ -0,0 +1,66 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <cstring> +#include <string> +#include <type_traits> +#include "common/hash.h" + +namespace GLShader { + +enum Attributes { + ATTRIBUTE_POSITION, + ATTRIBUTE_COLOR, + ATTRIBUTE_TEXCOORD0, + ATTRIBUTE_TEXCOORD1, + ATTRIBUTE_TEXCOORD2, + ATTRIBUTE_TEXCOORD0_W, + ATTRIBUTE_NORMQUAT, + ATTRIBUTE_VIEW, +}; + +struct MaxwellShaderConfigCommon { + explicit MaxwellShaderConfigCommon(){}; +}; + +struct MaxwellVSConfig : MaxwellShaderConfigCommon { + explicit MaxwellVSConfig() : MaxwellShaderConfigCommon() {} + + bool operator==(const MaxwellVSConfig& o) const { + return std::memcmp(this, &o, sizeof(MaxwellVSConfig)) == 0; + }; +}; + +struct MaxwellFSConfig : MaxwellShaderConfigCommon { + explicit MaxwellFSConfig() : MaxwellShaderConfigCommon() {} + + bool operator==(const MaxwellFSConfig& o) const { + return std::memcmp(this, &o, sizeof(MaxwellFSConfig)) == 0; + }; +}; + +std::string GenerateVertexShader(const MaxwellVSConfig& config); +std::string GenerateFragmentShader(const MaxwellFSConfig& config); + +} // namespace GLShader + +namespace std { + +template <> +struct hash<GLShader::MaxwellVSConfig> { + size_t operator()(const GLShader::MaxwellVSConfig& k) const { + return Common::ComputeHash64(&k, sizeof(GLShader::MaxwellVSConfig)); + } +}; + +template <> +struct hash<GLShader::MaxwellFSConfig> { + size_t operator()(const GLShader::MaxwellFSConfig& k) const { + return Common::ComputeHash64(&k, sizeof(GLShader::MaxwellFSConfig)); + } +}; + +} // namespace std |