From 53a529cb9206dafbecb175de8f59d20addb35200 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Thu, 26 Nov 2015 23:18:04 +0100 Subject: overlay: split the shaders in overlay.fx out into separate HLSL files. We want to get rid of our bundled Effects11 library, as well as our dependency the D3DCompiler DLLs (which Effects11 pulls in). This is the first step. --- overlay/overlay-shared.pro | 17 ++++++++++++--- overlay/overlay11-common.hlsl | 49 +++++++++++++++++++++++++++++++++++++++++++ overlay/overlay11.ps | 36 +++++++++++++++++++++++++++++++ overlay/overlay11.vs | 39 ++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 overlay/overlay11-common.hlsl create mode 100644 overlay/overlay11.ps create mode 100644 overlay/overlay11.vs (limited to 'overlay') diff --git a/overlay/overlay-shared.pro b/overlay/overlay-shared.pro index fe1af59ff..de55bf0fa 100644 --- a/overlay/overlay-shared.pro +++ b/overlay/overlay-shared.pro @@ -11,9 +11,9 @@ RC_FILE = mumble_ol.rc SOURCES = lib.cpp d3d9.cpp dxgi.cpp d3d10.cpp d3d11.cpp ods.cpp opengl.cpp HardHook.cpp D11StateBlock.cpp HEADERS = lib.h ods.h HardHook.h overlay_blacklist.h D11StateBlock.h ../3rdparty/GL/glext.h EFFECTS = overlay.fx +DX11_PIXEL_SHADERS = overlay11.ps +DX11_VERTEX_SHADERS = overlay11.vs DIST = overlay.h overlay.fx HardHook.h -FX11DIR = "../3rdparty/fx11-src" -FX11DIR_BUILD = $$replace(FX11DIR,-src,-build) DEFINES -= UNICODE @@ -30,7 +30,6 @@ LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ld3dx9 -ld3dx10 -ld3dx11 -ldxgi CONFIG(force-x86_64-toolchain) { LIBS *= -leffects11_x64 - DEFINES += USE_MINHOOK INCLUDEPATH *= ../3rdparty/minhook-src/include LIBS *= -lminhook @@ -69,3 +68,15 @@ fxc11.commands = $${FXC} /Tfx_5_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} fxc11.input = EFFECTS fxc11.CONFIG *= no_link target_predeps QMAKE_EXTRA_COMPILERS *= fxc11 + +vs11.output = ${QMAKE_FILE_BASE}.ps.h +vs11.commands = $${FXC} /Tvs_5_0 /O3 /Vng_vertex_shader /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} +vs11.input = DX11_VERTEX_SHADERS +vs11.CONFIG *= no_link target_predeps +QMAKE_EXTRA_COMPILERS *= vs11 + +ps11.output = ${QMAKE_FILE_BASE}.vs.h +ps11.commands = $${FXC} /Tps_5_0 /O3 /Vng_pixel_shader /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} +ps11.input = DX11_PIXEL_SHADERS +ps11.CONFIG *= no_link target_predeps +QMAKE_EXTRA_COMPILERS *= ps11 diff --git a/overlay/overlay11-common.hlsl b/overlay/overlay11-common.hlsl new file mode 100644 index 000000000..4fddc081f --- /dev/null +++ b/overlay/overlay11-common.hlsl @@ -0,0 +1,49 @@ +/* Copyright (C) 2011-2013, Nye Liu + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +Texture2D txDiffuse; +SamplerState samLinear +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = Wrap; + AddressV = Wrap; +}; + +struct VS_INPUT +{ + float4 Pos : POSITION; + float2 Tex : TEXCOORD; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float2 Tex : TEXCOORD0; +}; diff --git a/overlay/overlay11.ps b/overlay/overlay11.ps new file mode 100644 index 000000000..c0b6f5755 --- /dev/null +++ b/overlay/overlay11.ps @@ -0,0 +1,36 @@ +/* Copyright (C) 2011-2013, Nye Liu + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "overlay11-common.hlsl" + +float4 main( PS_INPUT input ) : SV_Target +{ + return txDiffuse.Sample(samLinear, input.Tex).bgra; +} \ No newline at end of file diff --git a/overlay/overlay11.vs b/overlay/overlay11.vs new file mode 100644 index 000000000..365c2e35d --- /dev/null +++ b/overlay/overlay11.vs @@ -0,0 +1,39 @@ +/* Copyright (C) 2011-2013, Nye Liu + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + - Neither the name of the Mumble Developers nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "overlay11-common.hlsl" + +PS_INPUT main( VS_INPUT input ) +{ + PS_INPUT output = (PS_INPUT)0; + output.Pos = input.Pos; + output.Tex = input.Tex; + return output; +} -- cgit v1.2.3