diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2015-11-02 11:41:43 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2015-11-02 11:41:43 +0100 |
| commit | 89f645151357f652a8e5bfef996b611a2992245e (patch) | |
| tree | e3af8cbfbadf076220b0eb2e26a025ef574702b1 /Source/Core/VideoCommon/VertexShaderGen.cpp | |
| parent | baf438fc9fb3558f78eb1439471727dfdb0084fb (diff) | |
| parent | 983978ee66cc15c010b2af6703aab866f3a41dcf (diff) | |
Merge pull request #3218 from Tilka/components
VideoCommon: flush vertex manager if components change
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderGen.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 7a23cf1080..f00a6d760c 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -9,14 +9,16 @@ #include "VideoCommon/DriverDetails.h" #include "VideoCommon/LightingShaderGen.h" #include "VideoCommon/NativeVertexFormat.h" +#include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexShaderGen.h" #include "VideoCommon/VideoConfig.h" static char text[16768]; template<class T> -static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_type) +static inline void GenerateVertexShader(T& out, API_TYPE api_type) { + const u32 components = VertexLoaderManager::g_current_components; // Non-uid template parameters will write to the dummy data (=> gets optimized out) vertex_shader_uid_data dummy_data; vertex_shader_uid_data* uid_data = out.template GetUidData<vertex_shader_uid_data>(); @@ -394,12 +396,12 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ } } -void GetVertexShaderUid(VertexShaderUid& object, u32 components, API_TYPE api_type) +void GetVertexShaderUid(VertexShaderUid& object, API_TYPE api_type) { - GenerateVertexShader<VertexShaderUid>(object, components, api_type); + GenerateVertexShader<VertexShaderUid>(object, api_type); } -void GenerateVertexShaderCode(ShaderCode& object, u32 components, API_TYPE api_type) +void GenerateVertexShaderCode(ShaderCode& object, API_TYPE api_type) { - GenerateVertexShader<ShaderCode>(object, components, api_type); + GenerateVertexShader<ShaderCode>(object, api_type); } |
