Skip to content
Permalink
Browse files

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.
  • Loading branch information...
mkrautz committed Nov 26, 2015
1 parent 3762ad0 commit 53a529cb9206dafbecb175de8f59d20addb35200
Showing with 106 additions and 3 deletions.
  1. +4 −0 .gitignore
  2. +14 −3 overlay/overlay-shared.pro
  3. +49 −0 overlay/overlay11-common.hlsl
  4. BIN overlay/overlay11.ps
  5. +39 −0 overlay/overlay11.vs
@@ -20,7 +20,11 @@ ui_*.h
*.pb.*
installer/Mumble.exe
overlay/*.hex
overlay/*.ps.h
overlay/*.vs.h
overlay_winx64/*.hex
overlay_winx64/*.ps.h
overlay_winx64/*.vs.h
scripts/Murmur.ice
scripts/murmur.ini.*
src/murmur/murmur_ice/Murmur.h
@@ -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
@@ -0,0 +1,49 @@
/* Copyright (C) 2011-2013, Nye Liu <nyet@nyet.org>
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;
};
BIN +1.71 KB overlay/overlay11.ps
Binary file not shown.
@@ -0,0 +1,39 @@
/* Copyright (C) 2011-2013, Nye Liu <nyet@nyet.org>

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;
}

0 comments on commit 53a529c

Please sign in to comment.
You can’t perform that action at this time.