From 753af8e981236689836c3fe6444de3c5f88245a1 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Mon, 14 Mar 2016 17:22:07 +0300 Subject: [WinRenderer] speed up a bit configuring renderer. --- system/shaders/testshader.fx | 32 ---------------------- .../VideoRenderers/VideoShaders/WinVideoFilter.cpp | 20 ++++++++++++-- 2 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 system/shaders/testshader.fx 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 - * . - * - */ - -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; -- cgit v1.2.3