diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-12-17 08:21:26 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-01-26 03:53:23 +0100 |
commit | dd4a1672a77830a53de61cf0554b34e9e17a2905 (patch) | |
tree | 63b1b64e3858aca34c0828dbd9fec6f5ebc1f887 /src/video_core/shader/shader.h | |
parent | VideoCore/Shader: Add constness to methods (diff) | |
download | yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar.gz yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar.bz2 yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar.lz yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar.xz yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.tar.zst yuzu-dd4a1672a77830a53de61cf0554b34e9e17a2905.zip |
Diffstat (limited to 'src/video_core/shader/shader.h')
-rw-r--r-- | src/video_core/shader/shader.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index 44b9861e9..899fb2607 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h @@ -156,7 +156,6 @@ struct UnitState { void ClearCache(); struct ShaderSetup { - struct { // The float uniforms are accessed by the shader JIT using SSE instructions, and are // therefore required to be 16-byte aligned. @@ -180,18 +179,23 @@ struct ShaderSetup { std::array<u32, 1024> program_code; std::array<u32, 1024> swizzle_data; +}; + +class ShaderEngine { +public: + virtual ~ShaderEngine() = default; /** * Performs any shader unit setup that only needs to happen once per shader (as opposed to once * per vertex, which would happen within the `Run` function). */ - void Setup(); + virtual void SetupBatch(const ShaderSetup* setup) = 0; /** * Runs the currently setup shader * @param state Shader unit state, must be setup per shader and per shader unit */ - void Run(UnitState& state, unsigned int entry_point) const; + virtual void Run(UnitState& state, unsigned int entry_point) const = 0; /** * Produce debug information based on the given shader and input vertex @@ -200,10 +204,13 @@ struct ShaderSetup { * @param config Configuration object for the shader pipeline * @return Debug information for this shader with regards to the given vertex */ - DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, - unsigned int entry_point) const; + virtual DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, + unsigned int entry_point) const = 0; }; +// TODO(yuriks): Remove and make it non-global state somewhere +ShaderEngine* GetEngine(); + } // namespace Shader } // namespace Pica |