diff options
| author | degasus <wickmarkus@web.de> | 2013-10-07 17:19:47 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2013-10-12 20:29:56 +0200 |
| commit | 7c14463d11f816b1dd0cd2efd9bbe018f4d64a4a (patch) | |
| tree | 9a3202f6a6dc7396b295f8f03bf72ba129a04e39 /Source/Core/VideoCommon | |
| parent | 437761843850ce32974fd4729d7b8d7d0405a04f (diff) | |
ogl: implement useful constant buffer upload
this will remove the additional memcpy introduced in my last commit
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.h | 13 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderGen.h | 11 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoCommon.h | 5 |
5 files changed, 2 insertions, 37 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.h b/Source/Core/VideoCommon/Src/PixelShaderGen.h index d9ce8c5874..b73b17168c 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.h +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.h @@ -43,19 +43,6 @@ enum DSTALPHA_MODE DSTALPHA_DUAL_SOURCE_BLEND // Use dual-source blending }; -// Annoying sure, can be removed once we get up to GLSL ~1.3 -const s_svar PSVar_Loc[] = { {C_COLORS, 4 }, - {C_KCOLORS, 4 }, - {C_ALPHA, 1 }, - {C_TEXDIMS, 8 }, - {C_ZBIAS, 2 }, - {C_INDTEXSCALE, 2 }, - {C_INDTEXMTX, 6 }, - {C_FOG, 3 }, - {C_PLIGHTS, 40 }, - {C_PMATERIALS, 4 }, - }; - #pragma pack(1) struct pixel_shader_uid_data { diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index 3a13e287aa..970bdb6e58 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -95,9 +95,6 @@ void PixelShaderManager::Shutdown() void PixelShaderManager::SetConstants(u32 components) { - if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) - dirty = true; - for (int i = 0; i < 2; ++i) { if (s_nColorsChanged[i]) @@ -359,7 +356,7 @@ void PixelShaderManager::SetConstants(u32 components) } } - if(dirty) + if(dirty && g_ActiveConfig.backend_info.APIType != API_OPENGL) { g_renderer->SetMultiPSConstant4fv(0, sizeof(constants)/16, (float*) &constants); dirty = false; diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.h b/Source/Core/VideoCommon/Src/VertexShaderGen.h index c5f32c741d..667df311c2 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.h +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.h @@ -53,17 +53,6 @@ #define C_DEPTHPARAMS (C_POSTTRANSFORMMATRICES + 64) #define C_VENVCONST_END (C_DEPTHPARAMS + 1) -const s_svar VSVar_Loc[] = { {C_POSNORMALMATRIX, 6 }, - {C_PROJECTION, 4 }, - {C_MATERIALS, 4 }, - {C_LIGHTS, 40 }, - {C_TEXMATRICES, 24 }, - {C_TRANSFORMMATRICES, 64 }, - {C_NORMALMATRICES, 32 }, - {C_POSTTRANSFORMMATRICES, 64 }, - {C_DEPTHPARAMS, 1 }, - }; - #pragma pack(1) struct vertex_shader_uid_data diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 016fb517e4..20c4994cf8 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -225,9 +225,6 @@ void VertexShaderManager::Dirty() // TODO: A cleaner way to control the matrices without making a mess in the parameters field void VertexShaderManager::SetConstants() { - if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) - dirty = true; - if (nTransformMatricesChanged[0] >= 0) { int startn = nTransformMatricesChanged[0] / 4; @@ -521,7 +518,7 @@ void VertexShaderManager::SetConstants() } } - if(dirty) + if(dirty && g_ActiveConfig.backend_info.APIType != API_OPENGL) { dirty = false; g_renderer->SetMultiVSConstant4fv(0, sizeof(constants)/16, (float*) &constants); diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index 54a2504631..ef36b1fed6 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -132,10 +132,5 @@ inline unsigned int GetPow2(unsigned int val) ++ret; return ret; } -struct s_svar -{ - const unsigned int reg; - const unsigned int size; -}; #endif // _VIDEOCOMMON_H |
