aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Fedchin <anightik@gmail.com>2016-03-14 17:22:07 +0300
committerAnton Fedchin <afedchin@ruswizards.com>2016-03-20 19:57:21 +0300
commit753af8e981236689836c3fe6444de3c5f88245a1 (patch)
treebcb27ba8d9d13693fe549b57d15d93239c1c3d66
parenta7caa16680f09810b730e88b3368f221465c9eee (diff)
[WinRenderer] speed up a bit configuring renderer.
-rw-r--r--system/shaders/testshader.fx32
-rw-r--r--xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp20
2 files changed, 17 insertions, 35 deletions
diff --git a/system/shaders/testshader.fx b/system/shaders/testshader.fx
deleted file mode 100644
index cefee8c983..0000000000
--- a/system/shaders/testshader.fx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-float4 TEST() : SV_TARGET
-{
- return float4(0.0, 0.0, 0.0, 0.0);
-}
-
-technique11 TEST_T
-{
- pass P0
- {
- SetPixelShader( CompileShader( ps_4_0_level_9_1, TEST() ) );
- }
-};
diff --git a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
index 55ac58676c..3bf9bd50fe 100644
--- a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
+++ b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
@@ -897,14 +897,28 @@ void CConvolutionShaderSeparable::SetStepParams(UINT iPass)
}
//==========================================================
+#define SHADER_SOURCE(...) #__VA_ARGS__
bool CTestShader::Create()
{
- std::string effectString = "special://xbmc/system/shaders/testshader.fx";
+ std::string strShader = SHADER_SOURCE(
+ float4 TEST() : SV_TARGET
+ {
+ return float4(0.0, 0.0, 0.0, 0.0);
+ }
- if(!LoadEffect(effectString, nullptr))
+ technique11 TEST_T
+ {
+ pass P0
+ {
+ SetPixelShader(CompileShader(ps_4_0_level_9_1, TEST()));
+ }
+ };
+ );
+
+ if (!m_effect.Create(strShader, nullptr))
{
- CLog::Log(LOGERROR, __FUNCTION__": Failed to load shader %s.", effectString.c_str());
+ CLog::Log(LOGERROR, __FUNCTION__": Failed to create test shader: %s", strShader.c_str());
return false;
}
return true;