summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-11-13 16:17:42 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2013-11-13 16:17:42 -0600
commit2a23bdde6f76c0bff0906bbbee298480b52ba0c2 (patch)
tree22a7bccfb1cb25d4c9f247ca3d43904a4a6d79dc /Source/Core/VideoBackends
parent3c7613fc83981f9ef8efa2e4ac478af9fe23bdec (diff)
parent63a9dff3bb8c88cdc5b941db1f3813843c7a8564 (diff)
Merge branch 'master' into android-new-control-input-overlay
Conflicts: Source/Core/DolphinWX/Src/Android/ButtonManager.h
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/D3D/D3D.vcxproj131
-rw-r--r--Source/Core/VideoBackends/D3D/D3D.vcxproj.filters82
-rw-r--r--Source/Core/VideoBackends/D3D/Src/D3DBase.cpp63
-rw-r--r--Source/Core/VideoBackends/D3D/Src/D3DBase.h38
-rw-r--r--Source/Core/VideoBackends/D3D/Src/D3DShader.cpp19
-rw-r--r--Source/Core/VideoBackends/D3D/Src/D3DTexture.cpp126
-rw-r--r--Source/Core/VideoBackends/D3D/Src/D3DTexture.h1
-rw-r--r--Source/Core/VideoBackends/D3D/Src/FramebufferManager.cpp4
-rw-r--r--Source/Core/VideoBackends/D3D/Src/LineGeometryShader.cpp2
-rw-r--r--Source/Core/VideoBackends/D3D/Src/NativeVertexFormat.cpp4
-rw-r--r--Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.cpp64
-rw-r--r--Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.h4
-rw-r--r--Source/Core/VideoBackends/D3D/Src/PerfQuery.cpp4
-rw-r--r--Source/Core/VideoBackends/D3D/Src/PixelShaderCache.cpp12
-rw-r--r--Source/Core/VideoBackends/D3D/Src/PointGeometryShader.cpp2
-rw-r--r--Source/Core/VideoBackends/D3D/Src/Render.cpp115
-rw-r--r--Source/Core/VideoBackends/D3D/Src/Render.h2
-rw-r--r--Source/Core/VideoBackends/D3D/Src/Television.cpp2
-rw-r--r--Source/Core/VideoBackends/D3D/Src/TextureCache.cpp34
-rw-r--r--Source/Core/VideoBackends/D3D/Src/VertexManager.cpp20
-rw-r--r--Source/Core/VideoBackends/D3D/Src/VertexManager.h2
-rw-r--r--Source/Core/VideoBackends/D3D/Src/VertexShaderCache.cpp6
-rw-r--r--Source/Core/VideoBackends/D3D/Src/VertexShaderCache.h4
-rw-r--r--Source/Core/VideoBackends/D3D/Src/main.cpp1
-rw-r--r--Source/Core/VideoBackends/D3D/Src/stdafx.h2
-rw-r--r--Source/Core/VideoBackends/OGL/OGL.vcxproj144
-rw-r--r--Source/Core/VideoBackends/OGL/OGL.vcxproj.filters58
-rw-r--r--Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp46
-rw-r--r--Source/Core/VideoBackends/OGL/Src/FramebufferManager.h18
-rw-r--r--Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp4
-rw-r--r--Source/Core/VideoBackends/OGL/Src/GLUtil.cpp11
-rw-r--r--Source/Core/VideoBackends/OGL/Src/GLUtil.h9
-rw-r--r--Source/Core/VideoBackends/OGL/Src/NativeVertexFormat.cpp10
-rw-r--r--Source/Core/VideoBackends/OGL/Src/PerfQuery.cpp18
-rw-r--r--Source/Core/VideoBackends/OGL/Src/PerfQuery.h10
-rw-r--r--Source/Core/VideoBackends/OGL/Src/PostProcessing.cpp48
-rw-r--r--Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp98
-rw-r--r--Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.h8
-rw-r--r--Source/Core/VideoBackends/OGL/Src/RasterFont.cpp204
-rw-r--r--Source/Core/VideoBackends/OGL/Src/RasterFont.h2
-rw-r--r--Source/Core/VideoBackends/OGL/Src/Render.cpp209
-rw-r--r--Source/Core/VideoBackends/OGL/Src/Render.h49
-rw-r--r--Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp22
-rw-r--r--Source/Core/VideoBackends/OGL/Src/SamplerCache.h22
-rw-r--r--Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp34
-rw-r--r--Source/Core/VideoBackends/OGL/Src/StreamBuffer.h8
-rw-r--r--Source/Core/VideoBackends/OGL/Src/TextureCache.cpp41
-rw-r--r--Source/Core/VideoBackends/OGL/Src/TextureCache.h10
-rw-r--r--Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp40
-rw-r--r--Source/Core/VideoBackends/OGL/Src/VertexManager.cpp44
-rw-r--r--Source/Core/VideoBackends/OGL/Src/VertexManager.h18
-rw-r--r--Source/Core/VideoBackends/OGL/Src/VideoBackend.h18
-rw-r--r--Source/Core/VideoBackends/OGL/Src/main.cpp19
-rw-r--r--Source/Core/VideoBackends/OGL/Src/stdafx.h2
-rw-r--r--Source/Core/VideoBackends/Software/Software.vcxproj160
-rw-r--r--Source/Core/VideoBackends/Software/Software.vcxproj.filters67
-rw-r--r--Source/Core/VideoBackends/Software/Src/BPMemLoader.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/Clipper.cpp28
-rw-r--r--Source/Core/VideoBackends/Software/Src/DebugUtil.h2
-rw-r--r--Source/Core/VideoBackends/Software/Src/EfbCopy.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/EfbInterface.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Src/HwRasterizer.cpp6
-rw-r--r--Source/Core/VideoBackends/Software/Src/HwRasterizer.h10
-rw-r--r--Source/Core/VideoBackends/Software/Src/NativeVertexFormat.h8
-rw-r--r--Source/Core/VideoBackends/Software/Src/OpcodeDecoder.cpp12
-rw-r--r--Source/Core/VideoBackends/Software/Src/Rasterizer.cpp8
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWCommandProcessor.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWPixelEngine.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWPixelEngine.h12
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWRenderer.cpp14
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWVertexLoader.cpp10
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWVideoConfig.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWVideoConfig.h2
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWmain.cpp12
-rw-r--r--Source/Core/VideoBackends/Software/Src/SetupUnit.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/Tev.cpp12
-rw-r--r--Source/Core/VideoBackends/Software/Src/Tev.h4
-rw-r--r--Source/Core/VideoBackends/Software/Src/TextureEncoder.cpp24
-rw-r--r--Source/Core/VideoBackends/Software/Src/TextureSampler.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/TransformUnit.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Src/Vec3.h6
-rw-r--r--Source/Core/VideoBackends/Software/Src/VideoBackend.h68
-rw-r--r--Source/Core/VideoBackends/Software/Src/VideoConfigDialog.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Src/XFMemLoader.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Src/XFMemLoader.h4
-rw-r--r--Source/Core/VideoBackends/Software/Src/stdafx.h2
86 files changed, 1066 insertions, 1405 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3D.vcxproj b/Source/Core/VideoBackends/D3D/D3D.vcxproj
index a4e8563fc4..a4177f6909 100644
--- a/Source/Core/VideoBackends/D3D/D3D.vcxproj
+++ b/Source/Core/VideoBackends/D3D/D3D.vcxproj
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="DebugFast|Win32">
- <Configuration>DebugFast</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="DebugFast|x64">
- <Configuration>DebugFast</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -27,124 +19,29 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{9A4C733C-BADE-4AC6-B58A-6E274395E90E}</ProjectGuid>
- <RootNamespace>VideoD3D</RootNamespace>
- <ProjectName>VideoD3D</ProjectName>
+ <ProjectGuid>{96020103-4BA5-4FD2-B4AA-5B6D24492D4E}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
+ <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
<Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Src\D3DBase.cpp" />
<ClCompile Include="Src\D3DBlob.cpp" />
@@ -162,12 +59,7 @@
<ClCompile Include="Src\PSTextureEncoder.cpp" />
<ClCompile Include="Src\Render.cpp" />
<ClCompile Include="Src\stdafx.cpp">
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Src\Television.cpp" />
<ClCompile Include="Src\TextureCache.cpp" />
@@ -201,8 +93,11 @@
<ClInclude Include="Src\XFBEncoder.h" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\VideoCommon\VideoCommon.vcxproj">
- <Project>{3e5c4e02-1ba9-4776-bdbe-e3f91ffa34cf}</Project>
+ <ProjectReference Include="..\..\..\..\Externals\wxWidgets3\build\msw\wx_base.vcxproj">
+ <Project>{1c8436c9-dbaf-42be-83bc-cf3ec9175abe}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Core\VideoCommon\VideoCommon.vcxproj">
+ <Project>{3de9ee35-3e91-4f27-a014-2866ad8c3fe3}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/Source/Core/VideoBackends/D3D/D3D.vcxproj.filters b/Source/Core/VideoBackends/D3D/D3D.vcxproj.filters
index 4b8efac92b..efd5c46a08 100644
--- a/Source/Core/VideoBackends/D3D/D3D.vcxproj.filters
+++ b/Source/Core/VideoBackends/D3D/D3D.vcxproj.filters
@@ -1,8 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <ClCompile Include="Src\main.cpp" />
- <ClCompile Include="Src\stdafx.cpp" />
+ <Filter Include="D3D">
+ <UniqueIdentifier>{ae700f7e-33c8-45b5-b7ee-a0ded3630549}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Render">
+ <UniqueIdentifier>{3683d29b-19f6-4e7a-803f-4ac70b1d49fd}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="Src\D3DBase.cpp">
<Filter>D3D</Filter>
</ClCompile>
@@ -24,51 +30,46 @@
<ClCompile Include="Src\FramebufferManager.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\NativeVertexFormat.cpp">
- <Filter>Render</Filter>
- </ClCompile>
- <ClCompile Include="Src\PixelShaderCache.cpp">
+ <ClCompile Include="Src\LineGeometryShader.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\Render.cpp">
+ <ClCompile Include="Src\NativeVertexFormat.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\TextureCache.cpp">
+ <ClCompile Include="Src\PerfQuery.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\VertexManager.cpp">
+ <ClCompile Include="Src\PixelShaderCache.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\VertexShaderCache.cpp">
+ <ClCompile Include="Src\PointGeometryShader.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="Src\PSTextureEncoder.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\XFBEncoder.cpp">
+ <ClCompile Include="Src\Render.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="Src\Television.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\LineGeometryShader.cpp">
+ <ClCompile Include="Src\TextureCache.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\PointGeometryShader.cpp">
+ <ClCompile Include="Src\VertexManager.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\PerfQuery.cpp">
+ <ClCompile Include="Src\VertexShaderCache.cpp">
<Filter>Render</Filter>
</ClCompile>
+ <ClCompile Include="Src\XFBEncoder.cpp">
+ <Filter>Render</Filter>
+ </ClCompile>
+ <ClCompile Include="Src\main.cpp" />
+ <ClCompile Include="Src\stdafx.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="Src\Globals.h" />
- <ClInclude Include="Src\main.h" />
- <ClInclude Include="Src\stdafx.h" />
- <ClInclude Include="Src\VideoBackend.h" />
- <ClInclude Include="Src\D3DUtil.h">
- <Filter>D3D</Filter>
- </ClInclude>
<ClInclude Include="Src\D3DBase.h">
<Filter>D3D</Filter>
</ClInclude>
@@ -81,55 +82,54 @@
<ClInclude Include="Src\D3DTexture.h">
<Filter>D3D</Filter>
</ClInclude>
+ <ClInclude Include="Src\D3DUtil.h">
+ <Filter>D3D</Filter>
+ </ClInclude>
<ClInclude Include="Src\GfxState.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="Src\FramebufferManager.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\Render.h">
+ <ClInclude Include="Src\LineGeometryShader.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\PixelShaderCache.h">
+ <ClInclude Include="Src\PerfQuery.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\VertexShaderCache.h">
+ <ClInclude Include="Src\PixelShaderCache.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\TextureCache.h">
+ <ClInclude Include="Src\PointGeometryShader.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\VertexManager.h">
+ <ClInclude Include="Src\PSTextureEncoder.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\PSTextureEncoder.h">
+ <ClInclude Include="Src\Render.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\TextureEncoder.h">
+ <ClInclude Include="Src\Television.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\XFBEncoder.h">
+ <ClInclude Include="Src\TextureCache.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\Television.h">
+ <ClInclude Include="Src\TextureEncoder.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\LineGeometryShader.h">
+ <ClInclude Include="Src\VertexManager.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\PointGeometryShader.h">
+ <ClInclude Include="Src\VertexShaderCache.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\PerfQuery.h">
+ <ClInclude Include="Src\XFBEncoder.h">
<Filter>Render</Filter>
</ClInclude>
- </ItemGroup>
- <ItemGroup>
- <Filter Include="D3D">
- <UniqueIdentifier>{8dda993d-a0ed-4c2e-9651-c13c743e3e27}</UniqueIdentifier>
- </Filter>
- <Filter Include="Render">
- <UniqueIdentifier>{41d3f9d1-16f3-4a48-a486-292b1593dc92}</UniqueIdentifier>
- </Filter>
+ <ClInclude Include="Src\Globals.h" />
+ <ClInclude Include="Src\main.h" />
+ <ClInclude Include="Src\VideoBackend.h" />
+ <ClInclude Include="Src\stdafx.h" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Source/Core/VideoBackends/D3D/Src/D3DBase.cpp b/Source/Core/VideoBackends/D3D/Src/D3DBase.cpp
index 0bd9a14ed8..5434354f37 100644
--- a/Source/Core/VideoBackends/D3D/Src/D3DBase.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/D3DBase.cpp
@@ -14,15 +14,9 @@ namespace DX11
HINSTANCE hD3DCompilerDll = NULL;
D3DREFLECT PD3DReflect = NULL;
+pD3DCompile PD3DCompile = NULL;
int d3dcompiler_dll_ref = 0;
-HINSTANCE hD3DXDll = NULL;
-D3DX11COMPILEFROMMEMORYTYPE PD3DX11CompileFromMemory = NULL;
-D3DX11FILTERTEXTURETYPE PD3DX11FilterTexture = NULL;
-D3DX11SAVETEXTURETOFILEATYPE PD3DX11SaveTextureToFileA = NULL;
-D3DX11SAVETEXTURETOFILEWTYPE PD3DX11SaveTextureToFileW = NULL;
-int d3dx_dll_ref = 0;
-
CREATEDXGIFACTORY PCreateDXGIFactory = NULL;
HINSTANCE hDXGIDll = NULL;
int dxgi_dll_ref = 0;
@@ -97,44 +91,6 @@ HRESULT LoadD3D()
return S_OK;
}
-HRESULT LoadD3DX()
-{
- if (d3dx_dll_ref++ > 0) return S_OK;
- if (hD3DXDll) return S_OK;
-
- // try to load D3DX11 first to check whether we have proper runtime support
- // try to use the dll the backend was compiled against first - don't bother about debug runtimes
- hD3DXDll = LoadLibraryA(D3DX11_DLL_A);
- if (!hD3DXDll)
- {
- // if that fails, use the dll which should be available in every SDK which officially supports DX11.
- hD3DXDll = LoadLibraryA("d3dx11_42.dll");
- if (!hD3DXDll)
- {
- MessageBoxA(NULL, "Failed to load d3dx11_42.dll, update your DX11 runtime, please", "Critical error", MB_OK | MB_ICONERROR);
- return E_FAIL;
- }
- else
- {
- NOTICE_LOG(VIDEO, "Successfully loaded d3dx11_42.dll. If you're having trouble, try updating your DX runtime first.");
- }
- }
-
- PD3DX11CompileFromMemory = (D3DX11COMPILEFROMMEMORYTYPE)GetProcAddress(hD3DXDll, "D3DX11CompileFromMemory");
- if (PD3DX11CompileFromMemory == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11CompileFromMemory!", "Critical error", MB_OK | MB_ICONERROR);
-
- PD3DX11FilterTexture = (D3DX11FILTERTEXTURETYPE)GetProcAddress(hD3DXDll, "D3DX11FilterTexture");
- if (PD3DX11FilterTexture == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11FilterTexture!", "Critical error", MB_OK | MB_ICONERROR);
-
- PD3DX11SaveTextureToFileA = (D3DX11SAVETEXTURETOFILEATYPE)GetProcAddress(hD3DXDll, "D3DX11SaveTextureToFileA");
- if (PD3DX11SaveTextureToFileA == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11SaveTextureToFileA!", "Critical error", MB_OK | MB_ICONERROR);
-
- PD3DX11SaveTextureToFileW = (D3DX11SAVETEXTURETOFILEWTYPE)GetProcAddress(hD3DXDll, "D3DX11SaveTextureToFileW");
- if (PD3DX11SaveTextureToFileW == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11SaveTextureToFileW!", "Critical error", MB_OK | MB_ICONERROR);
-
- return S_OK;
-}
-
HRESULT LoadD3DCompiler()
{
if (d3dcompiler_dll_ref++ > 0) return S_OK;
@@ -160,6 +116,8 @@ HRESULT LoadD3DCompiler()
PD3DReflect = (D3DREFLECT)GetProcAddress(hD3DCompilerDll, "D3DReflect");
if (PD3DReflect == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DReflect!", "Critical error", MB_OK | MB_ICONERROR);
+ PD3DCompile = (pD3DCompile)GetProcAddress(hD3DCompilerDll, "D3DCompile");
+ if (PD3DCompile == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DCompile!", "Critical error", MB_OK | MB_ICONERROR);
return S_OK;
}
@@ -174,18 +132,6 @@ void UnloadDXGI()
PCreateDXGIFactory = NULL;
}
-void UnloadD3DX()
-{
- if (!d3dx_dll_ref) return;
- if (--d3dx_dll_ref != 0) return;
-
- if(hD3DXDll) FreeLibrary(hD3DXDll);
- hD3DXDll = NULL;
- PD3DX11FilterTexture = NULL;
- PD3DX11SaveTextureToFileA = NULL;
- PD3DX11SaveTextureToFileW = NULL;
-}
-
void UnloadD3D()
{
if (!d3d_dll_ref) return;
@@ -269,13 +215,11 @@ HRESULT Create(HWND wnd)
hr = LoadDXGI();
if (SUCCEEDED(hr)) hr = LoadD3D();
- if (SUCCEEDED(hr)) hr = LoadD3DX();
if (SUCCEEDED(hr)) hr = LoadD3DCompiler();
if (FAILED(hr))
{
UnloadDXGI();
UnloadD3D();
- UnloadD3DX();
UnloadD3DCompiler();
return hr;
}
@@ -416,7 +360,6 @@ void Close()
device = NULL;
// unload DLLs
- UnloadD3DX();
UnloadD3D();
UnloadDXGI();
}
diff --git a/Source/Core/VideoBackends/D3D/Src/D3DBase.h b/Source/Core/VideoBackends/D3D/Src/D3DBase.h
index 03c1ed9d13..7f26cbd3cc 100644
--- a/Source/Core/VideoBackends/D3D/Src/D3DBase.h
+++ b/Source/Core/VideoBackends/D3D/Src/D3DBase.h
@@ -4,12 +4,13 @@
#pragma once
-#include <D3DX11.h>
-#include <D3Dcompiler.h>
+#include <dxgi.h>
+#include <d3d11.h>
+#include <d3dcompiler.h>
#include "Common.h"
#include <vector>
-namespace DX11
+namespace DX11
{
#define SAFE_RELEASE(x) { if (x) (x)->Release(); (x) = NULL; }
@@ -24,11 +25,9 @@ namespace D3D
HRESULT LoadDXGI();
HRESULT LoadD3D();
-HRESULT LoadD3DX();
HRESULT LoadD3DCompiler();
void UnloadDXGI();
void UnloadD3D();
-void UnloadD3DX();
void UnloadD3DCompiler();
D3D_FEATURE_LEVEL GetFeatureLevel(IDXGIAdapter* adapter);
@@ -71,36 +70,15 @@ void SetDebugObjectName(T resource, const char* name)
#endif
}
-} // namespace
+} // namespace D3D
-
-// Used to not require the SDK and runtime versions to match:
-// Linking with d3dx11.lib makes the most recent d3dx11_xx.dll of the
-// compiler's SDK a requirement, but this backend works with DX11 runtimes
-// back to August 2009 even if the backend was built with June 2010.
-// Add any d3dx11 functions which you want to use here and load them in Create()
-typedef HRESULT (WINAPI* D3DX11COMPILEFROMMEMORYTYPE)(LPCSTR, SIZE_T, LPCSTR, const D3D10_SHADER_MACRO*, LPD3D10INCLUDE, LPCSTR, LPCSTR, UINT, UINT, ID3DX11ThreadPump*, ID3D10Blob**, ID3D10Blob**, HRESULT*);
-typedef HRESULT (WINAPI* D3DX11FILTERTEXTURETYPE)(ID3D11DeviceContext*, ID3D11Resource*, UINT, UINT);
-typedef HRESULT (WINAPI* D3DX11SAVETEXTURETOFILEATYPE)(ID3D11DeviceContext*, ID3D11Resource*, D3DX11_IMAGE_FILE_FORMAT, LPCSTR);
-typedef HRESULT (WINAPI* D3DX11SAVETEXTURETOFILEWTYPE)(ID3D11DeviceContext*, ID3D11Resource*, D3DX11_IMAGE_FILE_FORMAT, LPCWSTR);
-
-extern D3DX11COMPILEFROMMEMORYTYPE PD3DX11CompileFromMemory;
-extern D3DX11FILTERTEXTURETYPE PD3DX11FilterTexture;
-extern D3DX11SAVETEXTURETOFILEATYPE PD3DX11SaveTextureToFileA;
-extern D3DX11SAVETEXTURETOFILEWTYPE PD3DX11SaveTextureToFileW;
-
-#ifdef UNICODE
-#define PD3DX11SaveTextureToFile PD3DX11SaveTextureToFileW
-#else
-#define PD3DX11SaveTextureToFile PD3DX11SaveTextureToFileA
-#endif
-
-typedef HRESULT (WINAPI* CREATEDXGIFACTORY)(REFIID, void**);
+typedef HRESULT (WINAPI *CREATEDXGIFACTORY)(REFIID, void**);
extern CREATEDXGIFACTORY PCreateDXGIFactory;
-typedef HRESULT (WINAPI* D3D11CREATEDEVICE)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**);
+typedef HRESULT (WINAPI *D3D11CREATEDEVICE)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**);
extern D3D11CREATEDEVICE PD3D11CreateDevice;
typedef HRESULT (WINAPI *D3DREFLECT)(LPCVOID, SIZE_T, REFIID, void**);
extern D3DREFLECT PD3DReflect;
+extern pD3DCompile PD3DCompile;
} // namespace DX11
diff --git a/Source/Core/VideoBackends/D3D/Src/D3DShader.cpp b/Source/Core/VideoBackends/D3D/Src/D3DShader.cpp
index 602dcf9807..51a51b7233 100644
--- a/Source/Core/VideoBackends/D3D/Src/D3DShader.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/D3DShader.cpp
@@ -37,9 +37,8 @@ bool CompileVertexShader(const char* code, unsigned int len, D3DBlob** blob)
#else
UINT flags = D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY|D3D10_SHADER_OPTIMIZATION_LEVEL3|D3D10_SHADER_SKIP_VALIDATION;
#endif
- HRESULT hr = PD3DX11CompileFromMemory(code, len, NULL, NULL, NULL, "main", D3D::VertexShaderVersionString(),
- flags, 0, NULL, &shaderBuffer, &errorBuffer, NULL);
-
+ HRESULT hr = PD3DCompile(code, len, NULL, NULL, NULL, "main", D3D::VertexShaderVersionString(),
+ flags, 0, &shaderBuffer, &errorBuffer);
if (errorBuffer)
{
INFO_LOG(VIDEO, "Vertex shader compiler messages:\n%s\n",
@@ -95,9 +94,9 @@ bool CompileGeometryShader(const char* code, unsigned int len, D3DBlob** blob,
#else
UINT flags = D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY|D3D10_SHADER_OPTIMIZATION_LEVEL3|D3D10_SHADER_SKIP_VALIDATION;
#endif
- HRESULT hr = PD3DX11CompileFromMemory(code, len, NULL, pDefines, NULL, "main", D3D::GeometryShaderVersionString(),
- flags, 0, NULL, &shaderBuffer, &errorBuffer, NULL);
-
+ HRESULT hr = PD3DCompile(code, len, NULL, pDefines, NULL, "main", D3D::GeometryShaderVersionString(),
+ flags, 0, &shaderBuffer, &errorBuffer);
+
if (errorBuffer)
{
INFO_LOG(VIDEO, "Geometry shader compiler messages:\n%s\n",
@@ -155,9 +154,9 @@ bool CompilePixelShader(const char* code, unsigned int len, D3DBlob** blob,
#else
UINT flags = D3D10_SHADER_OPTIMIZATION_LEVEL3;
#endif
- HRESULT hr = PD3DX11CompileFromMemory(code, len, NULL, pDefines, NULL, "main", D3D::PixelShaderVersionString(),
- flags, 0, NULL, &shaderBuffer, &errorBuffer, NULL);
-
+ HRESULT hr = PD3DCompile(code, len, NULL, pDefines, NULL, "main", D3D::PixelShaderVersionString(),
+ flags, 0, &shaderBuffer, &errorBuffer);
+
if (errorBuffer)
{
INFO_LOG(VIDEO, "Pixel shader compiler messages:\n%s",
@@ -233,4 +232,4 @@ ID3D11PixelShader* CompileAndCreatePixelShader(const char* code,
} // namespace
-} // namespace DX11 \ No newline at end of file
+} // namespace DX11
diff --git a/Source/Core/VideoBackends/D3D/Src/D3DTexture.cpp b/Source/Core/VideoBackends/D3D/Src/D3DTexture.cpp
index abf34b3cca..94d778d17b 100644
--- a/Source/Core/VideoBackends/D3D/Src/D3DTexture.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/D3DTexture.cpp
@@ -5,12 +5,138 @@
#include "D3DBase.h"
#include "D3DTexture.h"
+#include <atlbase.h>
+#include <wincodec.h>
+#include <wincodecsdk.h>
+#pragma comment(lib, "WindowsCodecs.lib")
+
namespace DX11
{
namespace D3D
{
+HRESULT TextureToPng(D3D11_MAPPED_SUBRESOURCE &map, LPCWSTR wzFilename, int width, int height, bool saveAlpha)
+{
+ IWICImagingFactory *piFactory = NULL;
+ IWICBitmapEncoder *piEncoder = NULL;
+ IWICBitmapFrameEncode *piBitmapFrame = NULL;
+ IPropertyBag2 *pPropertybag = NULL;
+
+ IWICStream *piStream = NULL;
+
+ HRESULT hr = CoCreateInstance(
+ CLSID_WICImagingFactory,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ IID_IWICImagingFactory,
+ (LPVOID*)&piFactory);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piFactory->CreateStream(&piStream);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piStream->InitializeFromFilename(wzFilename, GENERIC_WRITE);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piFactory->CreateEncoder(GUID_ContainerFormatPng, NULL, &piEncoder);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piEncoder->Initialize(piStream, WICBitmapEncoderNoCache);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piEncoder->CreateNewFrame(&piBitmapFrame, &pPropertybag);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ if (SUCCEEDED(hr))
+ {
+ hr = piBitmapFrame->Initialize(pPropertybag);
+ }
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piBitmapFrame->SetSize(width, height);
+ }
+
+ WICPixelFormatGUID formatGUID = GUID_WICPixelFormat32bppBGRA;
+ if (SUCCEEDED(hr))
+ {
+ hr = piBitmapFrame->SetPixelFormat(&formatGUID);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ // We're expecting to write out 32bppBGRA. Fail if the encoder cannot do it.
+ hr = IsEqualGUID(formatGUID, GUID_WICPixelFormat32bppBGRA) ? S_OK : E_FAIL;
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ if (map.pData != NULL)
+ {
+ for (int y = 0; y < height; ++y)
+ {
+ u8* ptr = (u8*)map.pData + y * map.RowPitch;
+ for (unsigned int x = 0; x < map.RowPitch/4; ++x)
+ {
+ u8 r = ptr[0];
+ u8 g = ptr[1];
+ u8 b = ptr[2];
+ ptr[0] = b;
+ ptr[1] = g;
+ ptr[2] = r;
+ if (!saveAlpha)
+ ptr[3] = 0xff;
+
+
+ ptr += 4;
+ }
+ }
+ hr = piBitmapFrame->WritePixels(height, map.RowPitch, height * map.RowPitch, (BYTE*)map.pData);
+ }
+ else
+ {
+ hr = E_OUTOFMEMORY;
+ }
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piBitmapFrame->Commit();
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = piEncoder->Commit();
+ }
+
+ if (piFactory)
+ piFactory->Release();
+
+ if (piBitmapFrame)
+ piBitmapFrame->Release();
+
+ if (piEncoder)
+ piEncoder->Release();
+
+ if (piStream)
+ piStream->Release();
+
+ return hr;
+}
+
void ReplaceRGBATexture2D(ID3D11Texture2D* pTexture, const u8* buffer, unsigned int width, unsigned int height, unsigned int pitch, unsigned int level, D3D11_USAGE usage)
{
if (usage == D3D11_USAGE_DYNAMIC || usage == D3D11_USAGE_STAGING)
diff --git a/Source/Core/VideoBackends/D3D/Src/D3DTexture.h b/Source/Core/VideoBackends/D3D/Src/D3DTexture.h
index 5c2aa57f4a..d047d3f249 100644
--- a/Source/Core/VideoBackends/D3D/Src/D3DTexture.h
+++ b/Source/Core/VideoBackends/D3D/Src/D3DTexture.h
@@ -11,6 +11,7 @@ namespace DX11
namespace D3D
{
+ HRESULT TextureToPng(D3D11_MAPPED_SUBRESOURCE& map, LPCWSTR wzFilename, int width, int height, bool saveAlpha = true);
void ReplaceRGBATexture2D(ID3D11Texture2D* pTexture, const u8* buffer, unsigned int width, unsigned int height, unsigned int pitch, unsigned int level, D3D11_USAGE usage);
}
diff --git a/Source/Core/VideoBackends/D3D/Src/FramebufferManager.cpp b/Source/Core/VideoBackends/D3D/Src/FramebufferManager.cpp
index 2e72380603..973cf38181 100644
--- a/Source/Core/VideoBackends/D3D/Src/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/FramebufferManager.cpp
@@ -196,7 +196,7 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void XFBSource::CopyEFB(float Gamma)
{
g_renderer->ResetAPIState(); // reset any game specific settings
-
+
// Copy EFB data to XFB and restore render target again
const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)texWidth, (float)texHeight);
@@ -211,7 +211,7 @@ void XFBSource::CopyEFB(float Gamma)
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(),
FramebufferManager::GetEFBDepthTexture()->GetDSV());
-
+
g_renderer->RestoreAPIState();
}
diff --git a/Source/Core/VideoBackends/D3D/Src/LineGeometryShader.cpp b/Source/Core/VideoBackends/D3D/Src/LineGeometryShader.cpp
index 4b96953a3a..a68dadaabb 100644
--- a/Source/Core/VideoBackends/D3D/Src/LineGeometryShader.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/LineGeometryShader.cpp
@@ -177,7 +177,7 @@ bool LineGeometryShader::SetShader(u32 components, float lineWidth,
std::stringstream numTexCoordsStream;
numTexCoordsStream << xfregs.numTexGen.numTexGens;
-
+
INFO_LOG(VIDEO, "Compiling line geometry shader for components 0x%.08X (num texcoords %d)",
components, xfregs.numTexGen.numTexGens);
diff --git a/Source/Core/VideoBackends/D3D/Src/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/Src/NativeVertexFormat.cpp
index 373026bcd3..4c6332dedd 100644
--- a/Source/Core/VideoBackends/D3D/Src/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/NativeVertexFormat.cpp
@@ -76,7 +76,7 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
for (int i = 0; i < 3; i++)
{
- if (_vtx_decl.normal_offset[i] > 0)
+ if (_vtx_decl.normal_offset[i] > 0)
{
m_elems[m_num_elems].SemanticName = "NORMAL";
m_elems[m_num_elems].SemanticIndex = i;
@@ -89,7 +89,7 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
for (int i = 0; i < 2; i++)
{
- if (_vtx_decl.color_offset[i] > 0)
+ if (_vtx_decl.color_offset[i] > 0)
{
m_elems[m_num_elems].SemanticName = "COLOR";
m_elems[m_num_elems].SemanticIndex = i;
diff --git a/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.cpp
index 5282c4cbb7..82e95d2bf0 100644
--- a/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.cpp
@@ -31,7 +31,7 @@
namespace DX11
{
-
+
union EFBEncodeParams
{
struct
@@ -384,7 +384,7 @@ static const char EFB_ENCODE_PS[] =
"sample[y*8+x] = SampleEFB(subBlockUL+float2(x,y));\n"
"}\n"
"}\n"
-
+
"uint dw[4];\n"
"for (uint i = 0; i < 4; ++i) {\n"
"dw[i] = UINT_44444444_BE(\n"
@@ -433,7 +433,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample2.r, sample6.r, sampleA.r, sampleE.r),\n"
"255*float4(sample3.r, sample7.r, sampleB.r, sampleF.r)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -444,7 +444,7 @@ static const char EFB_ENCODE_PS[] =
"float2 blockUL = blockCoord * float2(8,4);\n"
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
-
+
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
@@ -486,7 +486,7 @@ static const char EFB_ENCODE_PS[] =
"Float8ToUint4(sampleE.a), Float8ToUint4(sampleE.r),\n"
"Float8ToUint4(sampleF.a), Float8ToUint4(sampleF.r)\n"
");\n"
-
+
"return uint4(dw0, dw1, dw2, dw3);\n"
"}\n"
@@ -513,7 +513,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample1.a, sample3.a, sample5.a, sample7.a),\n"
"255*float4(sample1.r, sample3.r, sample5.r, sample7.r)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -532,7 +532,7 @@ static const char EFB_ENCODE_PS[] =
"float4 sample5 = SampleEFB(subBlockUL+float2(1,1));\n"
"float4 sample6 = SampleEFB(subBlockUL+float2(2,1));\n"
"float4 sample7 = SampleEFB(subBlockUL+float2(3,1));\n"
-
+
"uint dw0 = UINT_1616(EncodeRGB565(sample0), EncodeRGB565(sample1));\n"
"uint dw1 = UINT_1616(EncodeRGB565(sample2), EncodeRGB565(sample3));\n"
"uint dw2 = UINT_1616(EncodeRGB565(sample4), EncodeRGB565(sample5));\n"
@@ -556,12 +556,12 @@ static const char EFB_ENCODE_PS[] =
"float4 sample5 = SampleEFB(subBlockUL+float2(1,1));\n"
"float4 sample6 = SampleEFB(subBlockUL+float2(2,1));\n"
"float4 sample7 = SampleEFB(subBlockUL+float2(3,1));\n"
-
+
"uint dw0 = UINT_1616(EncodeRGB5A3(sample0), EncodeRGB5A3(sample1));\n"
"uint dw1 = UINT_1616(EncodeRGB5A3(sample2), EncodeRGB5A3(sample3));\n"
"uint dw2 = UINT_1616(EncodeRGB5A3(sample4), EncodeRGB5A3(sample5));\n"
"uint dw3 = UINT_1616(EncodeRGB5A3(sample6), EncodeRGB5A3(sample7));\n"
-
+
"return Swap4_32(uint4(dw0, dw1, dw2, dw3));\n"
"}\n"
@@ -602,7 +602,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample1.b, sample3.b, sample5.b, sample7.b)\n"
");\n"
"}\n"
-
+
"return dw4;\n"
"}\n"
@@ -612,7 +612,7 @@ static const char EFB_ENCODE_PS[] =
"float2 blockUL = blockCoord * float2(8,4);\n"
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
-
+
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
@@ -636,7 +636,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample2.a, sample6.a, sampleA.a, sampleE.a),\n"
"255*float4(sample3.a, sample7.a, sampleB.a, sampleF.a)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -670,7 +670,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample2.r, sample6.r, sampleA.r, sampleE.r),\n"
"255*float4(sample3.r, sample7.r, sampleB.r, sampleF.r)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -705,7 +705,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample2.g, sample6.g, sampleA.g, sampleE.g),\n"
"255*float4(sample3.g, sample7.g, sampleB.g, sampleF.g)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -715,7 +715,7 @@ static const char EFB_ENCODE_PS[] =
"float2 blockUL = blockCoord * float2(8,4);\n"
"float2 subBlockUL = blockUL + float2(0, 2*(cacheCoord.x%2));\n"
-
+
"float4 sample0 = SampleEFB(subBlockUL+float2(0,0));\n"
"float4 sample1 = SampleEFB(subBlockUL+float2(1,0));\n"
"float4 sample2 = SampleEFB(subBlockUL+float2(2,0));\n"
@@ -739,7 +739,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample2.b, sample6.b, sampleA.b, sampleE.b),\n"
"255*float4(sample3.b, sample7.b, sampleB.b, sampleF.b)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -765,7 +765,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample1.g, sample3.g, sample5.g, sample7.g),\n"
"255*float4(sample1.r, sample3.r, sample5.r, sample7.r)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -792,7 +792,7 @@ static const char EFB_ENCODE_PS[] =
"255*float4(sample1.b, sample3.b, sample5.b, sample7.b),\n"
"255*float4(sample1.g, sample3.g, sample5.g, sample7.g)\n"
");\n"
-
+
"return dw4;\n"
"}\n"
@@ -902,7 +902,7 @@ void PSTextureEncoder::Init()
D3D::SetDebugObjectName(m_outRTV, "efb encoder output rtv");
// Create output staging buffer
-
+
t2dd.Usage = D3D11_USAGE_STAGING;
t2dd.BindFlags = 0;
t2dd.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
@@ -998,7 +998,7 @@ void PSTextureEncoder::Init()
void PSTextureEncoder::Shutdown()
{
m_ready = false;
-
+
for (size_t i = 0; i < 4; ++i)
SAFE_RELEASE(m_fetchClass[i]);
for (size_t i = 0; i < 2; ++i)
@@ -1008,7 +1008,7 @@ void PSTextureEncoder::Shutdown()
for (size_t i = 0; i < 16; ++i)
SAFE_RELEASE(m_generatorClass[i]);
m_linkageArray.clear();
-
+
SAFE_RELEASE(m_classLinkage);
SAFE_RELEASE(m_dynamicShader);
@@ -1073,13 +1073,13 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
_assert_msg_(VIDEO, totalCacheLines*32 <= MAX_BYTES_PER_ENCODE, "total encode size sanity check");
size_t encodeSize = 0;
-
+
// Reset API
g_renderer->ResetAPIState();
// Set up all the state for EFB encoding
-
+
#ifdef USE_DYNAMIC_MODE
if (SetDynamicShader(dstFormat, srcFormat, isIntensity, scaleByHalf))
#else
@@ -1092,7 +1092,7 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
D3D::stateman->PushDepthState(m_efbEncodeDepthState);
D3D::stateman->PushRasterizerState(m_efbEncodeRastState);
D3D::stateman->Apply();
-
+
D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, FLOAT(cacheLinesPerRow*2), FLOAT(numBlocksY));
D3D::context->RSSetViewports(1, &vp);
@@ -1101,14 +1101,14 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
UINT stride = sizeof(QuadVertex);
UINT offset = 0;
D3D::context->IASetVertexBuffers(0, 1, &m_quad, &stride, &offset);
-
+
EFBRectangle fullSrcRect;
fullSrcRect.left = 0;
fullSrcRect.top = 0;
fullSrcRect.right = EFB_WIDTH;
fullSrcRect.bottom = EFB_HEIGHT;
TargetRectangle targetRect = g_renderer->ConvertEFBRectangle(fullSrcRect);
-
+
EFBEncodeParams params = { 0 };
params.NumHalfCacheLinesX = FLOAT(cacheLinesPerRow*2);
params.NumBlocksY = FLOAT(numBlocksY);
@@ -1121,7 +1121,7 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
D3D::context->UpdateSubresource(m_encodeParams, 0, NULL, &params, 0, 0);
D3D::context->VSSetConstantBuffers(0, 1, &m_encodeParams);
-
+
D3D::context->OMSetRenderTargets(1, &m_outRTV, NULL);
ID3D11ShaderResourceView* pEFB = (srcFormat == PIXELFMT_Z24) ?
@@ -1145,17 +1145,17 @@ size_t PSTextureEncoder::Encode(u8* dst, unsigned int dstFormat,
D3D::context->CopySubresourceRegion(m_outStage, 0, 0, 0, 0, m_out, 0, &srcBox);
// Clean up state
-
+
IUnknown* nullDummy = NULL;
D3D::context->PSSetSamplers(0, 1, (ID3D11SamplerState**)&nullDummy);
D3D::context->PSSetShaderResources(0, 1, (ID3D11ShaderResourceView**)&nullDummy);
D3D::context->PSSetConstantBuffers(0, 1, (ID3D11Buffer**)&nullDummy);
-
+
D3D::context->OMSetRenderTargets(0, NULL, NULL);
D3D::context->VSSetConstantBuffers(0, 1, (ID3D11Buffer**)&nullDummy);
-
+
D3D::stateman->PopRasterizerState();
D3D::stateman->PopDepthState();
D3D::stateman->PopBlendState();
@@ -1312,7 +1312,7 @@ bool PSTextureEncoder::InitDynamicMode()
hr = D3D::device->CreatePixelShader(bytecode->Data(), bytecode->Size(), m_classLinkage, &m_dynamicShader);
CHECK(SUCCEEDED(hr), "create efb encode pixel shader");
D3D::SetDebugObjectName(m_dynamicShader, "efb encoder pixel shader");
-
+
// Use D3DReflect
ID3D11ShaderReflection* reflect = NULL;
@@ -1438,7 +1438,7 @@ bool PSTextureEncoder::SetDynamicShader(unsigned int dstFormat,
m_linkageArray[m_intensitySlot] = m_intensityClass[intensityNum];
if (m_generatorSlot != UINT(-1))
m_linkageArray[m_generatorSlot] = m_generatorClass[generatorNum];
-
+
D3D::context->PSSetShader(m_dynamicShader,
m_linkageArray.empty() ? NULL : &m_linkageArray[0],
(UINT)m_linkageArray.size());
diff --git a/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.h b/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.h
index 14cdfa8bae..ff33e22c0a 100644
--- a/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.h
+++ b/Source/Core/VideoBackends/D3D/Src/PSTextureEncoder.h
@@ -37,7 +37,7 @@ public:
bool scaleByHalf);
private:
-
+
bool m_ready;
ID3D11Texture2D* m_out;
@@ -73,7 +73,7 @@ private:
// Stuff only used for dynamic-linking mode (SM5.0+, available as soon as
// Microsoft fixes their bloody HLSL compiler)
-
+
bool InitDynamicMode();
bool SetDynamicShader(unsigned int dstFormat, unsigned int srcFormat,
bool isIntensity, bool scaleByHalf);
diff --git a/Source/Core/VideoBackends/D3D/Src/PerfQuery.cpp b/Source/Core/VideoBackends/D3D/Src/PerfQuery.cpp
index 1bcd314291..b2c77a876e 100644
--- a/Source/Core/VideoBackends/D3D/Src/PerfQuery.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/PerfQuery.cpp
@@ -116,7 +116,7 @@ void PerfQuery::FlushOne()
}
// NOTE: Reported pixel metrics should be referenced to native resolution
- m_results[entry.query_type] += (u64)result * EFB_WIDTH / g_renderer->GetTargetWidth() * EFB_HEIGHT / g_renderer->GetTargetHeight();
+ m_results[entry.query_type] += (u32)(result * EFB_WIDTH / g_renderer->GetTargetWidth() * EFB_HEIGHT / g_renderer->GetTargetHeight());
m_query_read_pos = (m_query_read_pos + 1) % ArraySize(m_query_buffer);
--m_query_count;
@@ -147,7 +147,7 @@ void PerfQuery::WeakFlush()
if (hr == S_OK)
{
// NOTE: Reported pixel metrics should be referenced to native resolution
- m_results[entry.query_type] += (u64)result * EFB_WIDTH / g_renderer->GetTargetWidth() * EFB_HEIGHT / g_renderer->GetTargetHeight();
+ m_results[entry.query_type] += (u32)(result * EFB_WIDTH / g_renderer->GetTargetWidth() * EFB_HEIGHT / g_renderer->GetTargetHeight());
m_query_read_pos = (m_query_read_pos + 1) % ArraySize(m_query_buffer);
--m_query_count;
diff --git a/Source/Core/VideoBackends/D3D/Src/PixelShaderCache.cpp b/Source/Core/VideoBackends/D3D/Src/PixelShaderCache.cpp
index 04a1722d04..d8716c85f2 100644
--- a/Source/Core/VideoBackends/D3D/Src/PixelShaderCache.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/PixelShaderCache.cpp
@@ -80,7 +80,7 @@ const char color_matrix_program_code[] = {
"sampler samp0 : register(s0);\n"
"Texture2D Tex0 : register(t0);\n"
"uniform float4 cColMatrix[7] : register(c0);\n"
- "void main(\n"
+ "void main(\n"
"out float4 ocol0 : SV_Target,\n"
"in float4 pos : SV_Position,\n"
" in float2 uv0 : TEXCOORD0){\n"
@@ -94,7 +94,7 @@ const char color_matrix_program_code_msaa[] = {
"sampler samp0 : register(s0);\n"
"Texture2DMS<float4, %d> Tex0 : register(t0);\n"
"uniform float4 cColMatrix[7] : register(c0);\n"
- "void main(\n"
+ "void main(\n"
"out float4 ocol0 : SV_Target,\n"
"in float4 pos : SV_Position,\n"
" in float2 uv0 : TEXCOORD0){\n"
@@ -343,7 +343,7 @@ ID3D11Buffer* &PixelShaderCache::GetConstantBuffer()
memcpy(map.pData, &PixelShaderManager::constants, sizeof(PixelShaderConstants));
D3D::context->Unmap(pscbuf, 0);
PixelShaderManager::dirty = false;
-
+
ADDSTAT(stats.thisFrame.bytesUniformStreamed, sizeof(PixelShaderConstants));
}
return pscbuf;
@@ -368,7 +368,7 @@ void PixelShaderCache::Init()
D3D::SetDebugObjectName((ID3D11DeviceChild*)pscbuf, "pixel shader constant buffer used to emulate the GX pipeline");
// used when drawing clear quads
- s_ClearProgram = D3D::CompileAndCreatePixelShader(clear_program_code, sizeof(clear_program_code));
+ s_ClearProgram = D3D::CompileAndCreatePixelShader(clear_program_code, sizeof(clear_program_code));
CHECK(s_ClearProgram!=NULL, "Create clear pixel shader");
D3D::SetDebugObjectName((ID3D11DeviceChild*)s_ClearProgram, "clear pixel shader");
@@ -441,7 +441,7 @@ void PixelShaderCache::Shutdown()
SAFE_RELEASE(s_rgba6_to_rgb8[i]);
SAFE_RELEASE(s_rgb8_to_rgba6[i]);
}
-
+
Clear();
g_ps_disk_cache.Sync();
g_ps_disk_cache.Close();
@@ -477,7 +477,7 @@ bool PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components)
{
const PSCacheEntry &entry = iter->second;
last_entry = &entry;
-
+
GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE,true);
return (entry.shader != NULL);
}
diff --git a/Source/Core/VideoBackends/D3D/Src/PointGeometryShader.cpp b/Source/Core/VideoBackends/D3D/Src/PointGeometryShader.cpp
index f33d7444a2..30e4434521 100644
--- a/Source/Core/VideoBackends/D3D/Src/PointGeometryShader.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/PointGeometryShader.cpp
@@ -168,7 +168,7 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
code.SetBuffer(buffer);
GenerateVSOutputStructForGS(code, components, API_D3D);
code.Write("\n%s", POINT_GS_COMMON);
-
+
std::stringstream numTexCoordsStream;
numTexCoordsStream << xfregs.numTexGen.numTexGens;
diff --git a/Source/Core/VideoBackends/D3D/Src/Render.cpp b/Source/Core/VideoBackends/D3D/Src/Render.cpp
index d58cc59e98..33528359c5 100644
--- a/Source/Core/VideoBackends/D3D/Src/Render.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/Render.cpp
@@ -2,7 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include <math.h>
+#include <cinttypes>
+#include <cmath>
#include "Timer.h"
@@ -293,7 +294,7 @@ bool Renderer::CheckForResize()
// Sanity check
if ((client_width != Renderer::GetBackbufferWidth() ||
- client_height != Renderer::GetBackbufferHeight()) &&
+ client_height != Renderer::GetBackbufferHeight()) &&
client_width >= 4 && client_height >= 4)
{
return true;
@@ -449,7 +450,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
else if (bpmem.zcontrol.pixel_format == PIXELFMT_RGB565_Z16)
{
ret = RGBA8ToRGB565ToRGBA8(ret);
- }
+ }
if(bpmem.zcontrol.pixel_format != PIXELFMT_RGBA6_Z24)
{
ret |= 0xFF000000;
@@ -477,30 +478,9 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
}
}
-// Viewport correction:
-// Say you want a viewport at (ix, iy) with size (iw, ih),
-// but your viewport must be clamped at (ax, ay) with size (aw, ah).
-// Just multiply the projection matrix with the following to get the same
-// effect:
-// [ (iw/aw) 0 0 ((iw - 2*(ax-ix)) / aw - 1) ]
-// [ 0 (ih/ah) 0 ((-ih + 2*(ay-iy)) / ah + 1) ]
-// [ 0 0 1 0 ]
-// [ 0 0 0 1 ]
-static void ViewportCorrectionMatrix(Matrix44& result,
- float ix, float iy, float iw, float ih, // Intended viewport (x, y, width, height)
- float ax, float ay, float aw, float ah) // Actual viewport (x, y, width, height)
-{
- Matrix44::LoadIdentity(result);
- if (aw == 0.f || ah == 0.f)
- return;
- result.data[4*0+0] = iw / aw;
- result.data[4*0+3] = (iw - 2.f * (ax - ix)) / aw - 1.f;
- result.data[4*1+1] = ih / ah;
- result.data[4*1+3] = (-ih + 2.f * (ay - iy)) / ah + 1.f;
-}
// Called from VertexShaderManager
-void Renderer::UpdateViewport(Matrix44& vpCorrection)
+void Renderer::UpdateViewport()
{
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
// [0] = width/2
@@ -513,50 +493,30 @@ void Renderer::UpdateViewport(Matrix44& vpCorrection)
int scissorXOff = bpmem.scissorOffset.x * 2;
int scissorYOff = bpmem.scissorOffset.y * 2;
- // TODO: ceil, floor or just cast to int?
- // TODO: Directly use the floats instead of rounding them?
- int intendedX = Renderer::EFBToScaledX((int)ceil(xfregs.viewport.xOrig - xfregs.viewport.wd - scissorXOff));
- int intendedY = Renderer::EFBToScaledY((int)ceil(xfregs.viewport.yOrig + xfregs.viewport.ht - scissorYOff));
- int intendedWd = Renderer::EFBToScaledX((int)ceil(2.0f * xfregs.viewport.wd));
- int intendedHt = Renderer::EFBToScaledY((int)ceil(-2.0f * xfregs.viewport.ht));
- if (intendedWd < 0)
+ float X = Renderer::EFBToScaledXf(xfregs.viewport.xOrig - xfregs.viewport.wd - scissorXOff);
+ float Y = Renderer::EFBToScaledYf(xfregs.viewport.yOrig + xfregs.viewport.ht - scissorYOff);
+ float Wd = Renderer::EFBToScaledXf(2.0f * xfregs.viewport.wd);
+ float Ht = Renderer::EFBToScaledYf(-2.0f * xfregs.viewport.ht);
+ if (Wd < 0.0f)
{
- intendedX += intendedWd;
- intendedWd = -intendedWd;
+ X += Wd;
+ Wd = -Wd;
}
- if (intendedHt < 0)
+ if (Ht < 0.0f)
{
- intendedY += intendedHt;
- intendedHt = -intendedHt;
+ Y += Ht;
+ Ht = -Ht;
}
// In D3D, the viewport rectangle must fit within the render target.
- int X = intendedX;
- if (X < 0)
- X = 0;
-
- int Y = intendedY;
- if (Y < 0)
- Y = 0;
-
- int Wd = intendedWd;
- if (X + Wd > GetTargetWidth())
- Wd = GetTargetWidth() - X;
- int Ht = intendedHt;
- if (Y + Ht > GetTargetHeight())
- Ht = GetTargetHeight() - Y;
-
- // If GX viewport is off the render target, we must clamp our viewport
- // within the bounds. Use the correction matrix to compensate.
- ViewportCorrectionMatrix(vpCorrection,
- (float)intendedX, (float)intendedY,
- (float)intendedWd, (float)intendedHt,
- (float)X, (float)Y,
- (float)Wd, (float)Ht);
+ X = (X >= 0.f) ? X : 0.f;
+ Y = (Y >= 0.f) ? Y : 0.f;
+ Wd = (X + Wd <= GetTargetWidth()) ? Wd : (GetTargetWidth() - X);
+ Ht = (Y + Ht <= GetTargetHeight()) ? Ht : (GetTargetHeight() - Y);
// Some games set invalid values for z-min and z-max so fix them to the max and min allowed and let the shaders do this work
- D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)X, (float)Y,
- (float)Wd, (float)Ht,
+ D3D11_VIEWPORT vp = CD3D11_VIEWPORT(X, Y,
+ Wd, Ht,
0.f, // (xfregs.viewport.farZ - xfregs.viewport.zRange) / 16777216.0f;
1.f); // xfregs.viewport.farZ / 16777216.0f;
D3D::context->RSSetViewports(1, &vp);
@@ -578,7 +538,7 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
// Update the view port for clearing the picture
TargetRectangle targetRc = Renderer::ConvertEFBRectangle(rc);
- D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)targetRc.left, (float)targetRc.top, (float)targetRc.GetWidth(), (float)targetRc.GetHeight(), 0.f, 1.f);
+ D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)targetRc.left, (float)targetRc.top, (float)targetRc.GetWidth(), (float)targetRc.GetHeight(), 0.f, 1.f);
D3D::context->RSSetViewports(1, &vp);
// Color is passed in bgra mode so we need to convert it to rgba
@@ -730,22 +690,13 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
D3D11_BOX box = CD3D11_BOX(rc.left, rc.top, 0, rc.right, rc.bottom, 1);
D3D::context->CopySubresourceRegion(s_screenshot_texture, 0, 0, 0, 0, (ID3D11Resource*)D3D::GetBackBuffer()->GetTex(), 0, &box);
- // D3DX11SaveTextureToFileA doesn't allow us to ignore the alpha channel, so we need to strip it out ourselves
D3D11_MAPPED_SUBRESOURCE map;
D3D::context->Map(s_screenshot_texture, 0, D3D11_MAP_READ_WRITE, 0, &map);
- for (unsigned int y = 0; y < rc.GetHeight(); ++y)
- {
- u8* ptr = (u8*)map.pData + y * map.RowPitch + 3;
- for (unsigned int x = 0; x < rc.GetWidth(); ++x)
- {
- *ptr = 0xFF;
- ptr += 4;
- }
- }
- D3D::context->Unmap(s_screenshot_texture, 0);
// ready to be saved
- HRESULT hr = PD3DX11SaveTextureToFileA(D3D::context, s_screenshot_texture, D3DX11_IFF_PNG, filename.c_str());
+ HRESULT hr = D3D::TextureToPng(map, UTF8ToUTF16(filename.c_str()).c_str(), rc.GetWidth(), rc.GetHeight(), false);
+ D3D::context->Unmap(s_screenshot_texture, 0);
+
if (SUCCEEDED(hr))
{
OSD::AddMessage(StringFromFormat("Saved %i x %i %s", rc.GetWidth(),
@@ -842,7 +793,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
{
xfbSource = xfbSourceList[i];
MathUtil::Rectangle<float> sourceRc;
-
+
sourceRc.left = 0;
sourceRc.top = 0;
sourceRc.right = (float)xfbSource->texWidth;
@@ -969,7 +920,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
if (SConfig::GetInstance().m_ShowLag)
{
char lag[10];
- StringCchPrintfA(lag, 10, "Lag: %llu\n", Movie::g_currentLagCount);
+ StringCchPrintfA(lag, 10, "Lag: %" PRIu64 "\n", Movie::g_currentLagCount);
D3D::font.DrawTextScaled(0, 18, 20, 0.0f, 0xFF00FFFF, lag);
}
@@ -1067,10 +1018,10 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
}
// begin next frame
- Renderer::RestoreAPIState();
+ RestoreAPIState();
D3D::BeginFrame();
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
- VertexShaderManager::SetViewportChanged();
+ UpdateViewport();
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
XFBWrited = false;
@@ -1090,7 +1041,7 @@ void Renderer::RestoreAPIState()
D3D::stateman->PopBlendState();
D3D::stateman->PopDepthState();
D3D::stateman->PopRasterizerState();
- VertexShaderManager::SetViewportChanged();
+ UpdateViewport();
BPFunctions::SetScissor();
}
@@ -1300,7 +1251,7 @@ void Renderer::SetLogicOpMode()
D3D11_BLEND_INV_DEST_COLOR,//10
D3D11_BLEND_ONE,//11
D3D11_BLEND_INV_SRC_COLOR,//12
- D3D11_BLEND_INV_SRC_COLOR,//13
+ D3D11_BLEND_INV_SRC_COLOR,//13
D3D11_BLEND_INV_DEST_COLOR,//14
D3D11_BLEND_ONE//15
};
@@ -1319,7 +1270,7 @@ void Renderer::SetLogicOpMode()
D3D11_BLEND_INV_DEST_COLOR,//10
D3D11_BLEND_INV_DEST_COLOR,//11
D3D11_BLEND_INV_SRC_COLOR,//12
- D3D11_BLEND_ONE,//13
+ D3D11_BLEND_ONE,//13
D3D11_BLEND_INV_SRC_COLOR,//14
D3D11_BLEND_ONE//15
};
@@ -1370,7 +1321,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
const FourTexUnits &tex = bpmem.tex[texindex];
const TexMode0 &tm0 = tex.texMode0[stage];
const TexMode1 &tm1 = tex.texMode1[stage];
-
+
unsigned int mip = d3dMipFilters[tm0.min_filter & 3];
if (texindex) stage += 4;
diff --git a/Source/Core/VideoBackends/D3D/Src/Render.h b/Source/Core/VideoBackends/D3D/Src/Render.h
index 39b5b90d81..12e5b595d3 100644
--- a/Source/Core/VideoBackends/D3D/Src/Render.h
+++ b/Source/Core/VideoBackends/D3D/Src/Render.h
@@ -46,7 +46,7 @@ public:
void ReinterpretPixelData(unsigned int convtype);
- void UpdateViewport(Matrix44& vpCorrection);
+ void UpdateViewport();
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
diff --git a/Source/Core/VideoBackends/D3D/Src/Television.cpp b/Source/Core/VideoBackends/D3D/Src/Television.cpp
index daabf6d8b3..029ba9ce9f 100644
--- a/Source/Core/VideoBackends/D3D/Src/Television.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/Television.cpp
@@ -103,7 +103,7 @@ void Television::Init()
D3D::SetDebugObjectName(m_pShader, "yuyv decoder pixel shader");
// Create sampler state and set border color
- //
+ //
// The default sampler border color of { 0.f, 0.f, 0.f, 0.f }
// creates a green border around the image - see issue 6483
// (remember, the XFB is being interpreted as YUYV, and 0,0,0,0
diff --git a/Source/Core/VideoBackends/D3D/Src/TextureCache.cpp b/Source/Core/VideoBackends/D3D/Src/TextureCache.cpp
index e803f4a8f2..9d1e28b9b0 100644
--- a/Source/Core/VideoBackends/D3D/Src/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/TextureCache.cpp
@@ -42,7 +42,33 @@ bool TextureCache::TCacheEntry::Save(const char filename[], unsigned int level)
warn_once = false;
return false;
}
- return SUCCEEDED(PD3DX11SaveTextureToFileA(D3D::context, texture->GetTex(), D3DX11_IFF_PNG, filename));
+
+ ID3D11Texture2D* pNewTexture = NULL;
+ ID3D11Texture2D* pSurface = texture->GetTex();
+ D3D11_TEXTURE2D_DESC desc;
+ pSurface->GetDesc(&desc);
+
+ desc.BindFlags = 0;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
+ desc.Usage = D3D11_USAGE_STAGING;
+
+ HRESULT hr = D3D::device->CreateTexture2D(&desc, NULL, &pNewTexture);
+
+ if (SUCCEEDED(hr) && pNewTexture)
+ {
+ D3D::context->CopyResource(pNewTexture, pSurface);
+
+ D3D11_MAPPED_SUBRESOURCE map;
+ HRESULT hr = D3D::context->Map(pNewTexture, 0, D3D11_MAP_READ_WRITE, 0, &map);
+ if (SUCCEEDED(hr))
+ {
+ hr = D3D::TextureToPng(map, UTF8ToUTF16(filename).c_str(), desc.Width, desc.Height);
+ D3D::context->Unmap(pNewTexture, 0);
+ }
+ SAFE_RELEASE(pNewTexture);
+ }
+
+ return SUCCEEDED(hr);
}
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
@@ -82,10 +108,10 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
// TODO: better debug names
D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetTex(), "a texture of the TextureCache");
- D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetSRV(), "shader resource view of a texture of the TextureCache");
+ D3D::SetDebugObjectName((ID3D11DeviceChild*)entry->texture->GetSRV(), "shader resource view of a texture of the TextureCache");
SAFE_RELEASE(pTexture);
-
+
if (tex_levels != 1)
entry->Load(width, height, expanded_width, 0);
@@ -137,7 +163,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout());
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
-
+
g_renderer->RestoreAPIState();
}
diff --git a/Source/Core/VideoBackends/D3D/Src/VertexManager.cpp b/Source/Core/VideoBackends/D3D/Src/VertexManager.cpp
index b16a91ad95..b951a7464f 100644
--- a/Source/Core/VideoBackends/D3D/Src/VertexManager.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/VertexManager.cpp
@@ -40,7 +40,7 @@ void VertexManager::CreateDeviceObjects()
m_line_draw_index = 0;
m_point_draw_index = 0;
m_index_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
- m_vertex_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
+ m_vertex_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
for (m_current_index_buffer = 0; m_current_index_buffer < MAX_VBUFFER_COUNT; m_current_index_buffer++)
{
m_index_buffers[m_current_index_buffer] = NULL;
@@ -74,7 +74,7 @@ void VertexManager::DestroyDeviceObjects()
SAFE_RELEASE(m_vertex_buffers[m_current_vertex_buffer]);
SAFE_RELEASE(m_index_buffers[m_current_vertex_buffer]);
}
-
+
}
VertexManager::VertexManager()
@@ -96,7 +96,7 @@ void VertexManager::PrepareDrawBuffers()
if (m_vertex_buffer_cursor + vSize >= VBUFFER_SIZE)
{
// Wrap around
- m_current_vertex_buffer = (m_current_vertex_buffer + 1) % MAX_VBUFFER_COUNT;
+ m_current_vertex_buffer = (m_current_vertex_buffer + 1) % MAX_VBUFFER_COUNT;
m_vertex_buffer_cursor = 0;
MapType = D3D11_MAP_WRITE_DISCARD;
}
@@ -114,7 +114,7 @@ void VertexManager::PrepareDrawBuffers()
if (m_index_buffer_cursor + iCount >= (IBUFFER_SIZE / sizeof(u16)))
{
// Wrap around
- m_current_index_buffer = (m_current_index_buffer + 1) % MAX_VBUFFER_COUNT;
+ m_current_index_buffer = (m_current_index_buffer + 1) % MAX_VBUFFER_COUNT;
m_index_buffer_cursor = 0;
MapType = D3D11_MAP_WRITE_DISCARD;
}
@@ -128,7 +128,7 @@ void VertexManager::PrepareDrawBuffers()
memcpy((u16*)map.pData + m_point_draw_index, GetPointIndexBuffer(), sizeof(u16) * IndexGenerator::GetPointindexLen());
D3D::context->Unmap(m_index_buffers[m_current_index_buffer], 0);
m_index_buffer_cursor += iCount;
-
+
ADDSTAT(stats.thisFrame.bytesVertexStreamed, vSize);
ADDSTAT(stats.thisFrame.bytesIndexStreamed, iCount*sizeof(u16));
}
@@ -141,7 +141,7 @@ void VertexManager::Draw(UINT stride)
{
D3D::context->IASetVertexBuffers(0, 1, &m_vertex_buffers[m_current_vertex_buffer], &stride, &m_vertex_draw_offset);
D3D::context->IASetIndexBuffer(m_index_buffers[m_current_index_buffer], DXGI_FORMAT_R16_UINT, 0);
-
+
if (IndexGenerator::GetNumTriangles() > 0)
{
D3D::context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
@@ -217,14 +217,14 @@ void VertexManager::vFlush()
{
g_renderer->SetSamplerState(i & 3, i >> 2);
const FourTexUnits &tex = bpmem.tex[i >> 2];
- const TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
+ const TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
(tex.texImage3[i&3].image_base/* & 0x1FFFFF*/) << 5,
tex.texImage0[i&3].width + 1, tex.texImage0[i&3].height + 1,
- tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
+ tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
tex.texTlut[i&3].tlut_format,
- (tex.texMode0[i&3].min_filter & 3),
+ ((tex.texMode0[i&3].min_filter & 3) != 0),
(tex.texMode1[i&3].max_lod + 0xf) / 0x10,
- tex.texImage1[i&3].image_type);
+ (tex.texImage1[i&3].image_type != 0));
if (tentry)
{
diff --git a/Source/Core/VideoBackends/D3D/Src/VertexManager.h b/Source/Core/VideoBackends/D3D/Src/VertexManager.h
index 889c2ee0eb..b4b7aa0ef4 100644
--- a/Source/Core/VideoBackends/D3D/Src/VertexManager.h
+++ b/Source/Core/VideoBackends/D3D/Src/VertexManager.h
@@ -23,7 +23,7 @@ public:
void DestroyDeviceObjects();
private:
-
+
void PrepareDrawBuffers();
void Draw(u32 stride);
// temp
diff --git a/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.cpp b/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.cpp
index 28a03b3bca..e17f273a85 100644
--- a/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.cpp
@@ -47,7 +47,7 @@ ID3D11Buffer* &VertexShaderCache::GetConstantBuffer()
memcpy(map.pData, &VertexShaderManager::constants, sizeof(VertexShaderConstants));
D3D::context->Unmap(vscbuf, 0);
VertexShaderManager::dirty = false;
-
+
ADDSTAT(stats.thisFrame.bytesUniformStreamed, sizeof(VertexShaderConstants));
}
return vscbuf;
@@ -87,7 +87,7 @@ const char clear_shader_code[] = {
"struct VSOUTPUT\n"
"{\n"
"float4 vPosition : POSITION;\n"
- "float4 vColor0 : COLOR0;\n"
+ "float4 vColor0 : COLOR0;\n"
"};\n"
"VSOUTPUT main(float4 inPosition : POSITION,float4 inColor0: COLOR0)\n"
"{\n"
@@ -104,7 +104,7 @@ void VertexShaderCache::Init()
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
-
+
};
const D3D11_INPUT_ELEMENT_DESC clearelems[2] =
{
diff --git a/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.h b/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.h
index b80dbcd7b1..5fe81a11d5 100644
--- a/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.h
+++ b/Source/Core/VideoBackends/D3D/Src/VertexShaderCache.h
@@ -35,7 +35,7 @@ public:
private:
struct VSCacheEntry
- {
+ {
ID3D11VertexShader* shader;
D3DBlob* bytecode; // needed to initialize the input layout
@@ -55,7 +55,7 @@ private:
}
};
typedef std::map<VertexShaderUid, VSCacheEntry> VSCache;
-
+
static VSCache vshaders;
static const VSCacheEntry* last_entry;
static VertexShaderUid last_uid;
diff --git a/Source/Core/VideoBackends/D3D/Src/main.cpp b/Source/Core/VideoBackends/D3D/Src/main.cpp
index 989fb2ef91..0514106da5 100644
--- a/Source/Core/VideoBackends/D3D/Src/main.cpp
+++ b/Source/Core/VideoBackends/D3D/Src/main.cpp
@@ -90,6 +90,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsFormatReinterpretation = true;
g_Config.backend_info.bSupportsPixelLighting = true;
g_Config.backend_info.bSupportsPrimitiveRestart = true;
+ g_Config.backend_info.bSupportsOversizedViewports = false;
IDXGIFactory* factory;
IDXGIAdapter* ad;
diff --git a/Source/Core/VideoBackends/D3D/Src/stdafx.h b/Source/Core/VideoBackends/D3D/Src/stdafx.h
index 2431184aaf..81bb44dc19 100644
--- a/Source/Core/VideoBackends/D3D/Src/stdafx.h
+++ b/Source/Core/VideoBackends/D3D/Src/stdafx.h
@@ -9,4 +9,4 @@
#endif
#include <tchar.h>
-#include <windows.h>
+#include <windows.h>
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj b/Source/Core/VideoBackends/OGL/OGL.vcxproj
index 46113f53ce..a0c804a051 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="DebugFast|Win32">
- <Configuration>DebugFast</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="DebugFast|x64">
- <Configuration>DebugFast</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -27,124 +19,29 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{1909CD2D-1707-456F-86CA-0DF42A727C99}</ProjectGuid>
- <RootNamespace>VideoOGL</RootNamespace>
- <ProjectName>VideoOGL</ProjectName>
+ <ProjectGuid>{EC1A314C-5588-4506-9C1E-2E58E5817F75}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\VSProps\Base.props" />
<Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" />
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\include;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Src\FramebufferManager.cpp" />
<ClCompile Include="Src\GLUtil.cpp" />
@@ -156,15 +53,10 @@
<ClCompile Include="Src\RasterFont.cpp" />
<ClCompile Include="Src\Render.cpp" />
<ClCompile Include="Src\SamplerCache.cpp" />
- <ClCompile Include="Src\StreamBuffer.cpp" />
<ClCompile Include="Src\stdafx.cpp">
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="Src\StreamBuffer.cpp" />
<ClCompile Include="Src\TextureCache.cpp" />
<ClCompile Include="Src\TextureConverter.cpp" />
<ClCompile Include="Src\VertexManager.cpp" />
@@ -180,25 +72,31 @@
<ClInclude Include="Src\RasterFont.h" />
<ClInclude Include="Src\Render.h" />
<ClInclude Include="Src\SamplerCache.h" />
- <ClInclude Include="Src\StreamBuffer.h" />
<ClInclude Include="Src\stdafx.h" />
+ <ClInclude Include="Src\StreamBuffer.h" />
<ClInclude Include="Src\TextureCache.h" />
<ClInclude Include="Src\TextureConverter.h" />
<ClInclude Include="Src\VertexManager.h" />
<ClInclude Include="Src\VideoBackend.h" />
</ItemGroup>
<ItemGroup>
- <None Include="CMakeLists.txt" />
+ <Text Include="CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\..\..\Externals\GLew\glew.vcxproj">
+ <Project>{2a3f751d-69e9-45f2-9199-9a00bfb6cc72}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\..\Externals\wxWidgets3\build\msw\wx_base.vcxproj">
+ <Project>{1c8436c9-dbaf-42be-83bc-cf3ec9175abe}</Project>
+ </ProjectReference>
<ProjectReference Include="..\..\..\..\Externals\zlib\zlib.vcxproj">
- <Project>{3e1339f5-9311-4122-9442-369702e8fcad}</Project>
+ <Project>{ff213b23-2c26-4214-9f88-85271e557e87}</Project>
</ProjectReference>
- <ProjectReference Include="..\..\VideoCommon\VideoCommon.vcxproj">
- <Project>{3e5c4e02-1ba9-4776-bdbe-e3f91ffa34cf}</Project>
+ <ProjectReference Include="..\..\..\Core\VideoCommon\VideoCommon.vcxproj">
+ <Project>{3de9ee35-3e91-4f27-a014-2866ad8c3fe3}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
index bf498a83e0..c284f425dd 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
@@ -1,8 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <ClCompile Include="Src\main.cpp" />
- <ClCompile Include="Src\stdafx.cpp" />
+ <Filter Include="Decoder">
+ <UniqueIdentifier>{f29f8e7f-21ba-49da-8044-e5279a091c8f}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="GLUtil">
+ <UniqueIdentifier>{5bfec41c-1031-4925-8f98-38c7b49b1924}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Logging">
+ <UniqueIdentifier>{00dadfd8-a906-4b0c-b415-d42a69cf3ca7}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Render">
+ <UniqueIdentifier>{696df73b-378e-4399-8f21-999b65d78dcd}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="Src\NativeVertexFormat.cpp">
<Filter>Decoder</Filter>
</ClCompile>
@@ -21,7 +33,7 @@
<ClCompile Include="Src\FramebufferManager.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\PixelShaderCache.cpp">
+ <ClCompile Include="Src\PerfQuery.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="Src\PostProcessing.cpp">
@@ -39,19 +51,11 @@
<ClCompile Include="Src\TextureCache.cpp">
<Filter>Render</Filter>
</ClCompile>
- <ClCompile Include="Src\VertexShaderCache.cpp">
- <Filter>Render</Filter>
- </ClCompile>
- <ClCompile Include="Src\PerfQuery.cpp">
- <Filter>Render</Filter>
- </ClCompile>
+ <ClCompile Include="Src\main.cpp" />
<ClCompile Include="Src\SamplerCache.cpp" />
+ <ClCompile Include="Src\stdafx.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="Src\Globals.h" />
- <ClInclude Include="Src\main.h" />
- <ClInclude Include="Src\stdafx.h" />
- <ClInclude Include="Src\VideoBackend.h" />
<ClInclude Include="Src\VertexManager.h">
<Filter>Decoder</Filter>
</ClInclude>
@@ -67,6 +71,9 @@
<ClInclude Include="Src\FramebufferManager.h">
<Filter>Render</Filter>
</ClInclude>
+ <ClInclude Include="Src\PerfQuery.h">
+ <Filter>Render</Filter>
+ </ClInclude>
<ClInclude Include="Src\PostProcessing.h">
<Filter>Render</Filter>
</ClInclude>
@@ -76,30 +83,19 @@
<ClInclude Include="Src\Render.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\TextureCache.h">
+ <ClInclude Include="Src\StreamBuffer.h">
<Filter>Render</Filter>
</ClInclude>
- <ClInclude Include="Src\PerfQuery.h">
+ <ClInclude Include="Src\TextureCache.h">
<Filter>Render</Filter>
</ClInclude>
+ <ClInclude Include="Src\Globals.h" />
+ <ClInclude Include="Src\main.h" />
<ClInclude Include="Src\SamplerCache.h" />
- <ClInclude Include="Src\StreamBuffer.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="CMakeLists.txt" />
+ <ClInclude Include="Src\VideoBackend.h" />
+ <ClInclude Include="Src\stdafx.h" />
</ItemGroup>
<ItemGroup>
- <Filter Include="Decoder">
- <UniqueIdentifier>{a0bb3390-6085-4d10-af48-b60eb4c920e7}</UniqueIdentifier>
- </Filter>
- <Filter Include="GLUtil">
- <UniqueIdentifier>{5b16573b-fb79-4a51-aa7a-d760df844128}</UniqueIdentifier>
- </Filter>
- <Filter Include="Logging">
- <UniqueIdentifier>{14fca297-ab2f-4686-855f-65ab18602248}</UniqueIdentifier>
- </Filter>
- <Filter Include="Render">
- <UniqueIdentifier>{aaa16061-dca9-4155-be44-f77538e839fc}</UniqueIdentifier>
- </Filter>
+ <Text Include="CMakeLists.txt" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
index 4c395d7257..081c5e71d0 100644
--- a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
@@ -47,7 +47,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
m_resolvedColorTexture = 0;
m_resolvedDepthTexture = 0;
m_xfbFramebuffer = 0;
-
+
m_targetWidth = targetWidth;
m_targetHeight = targetHeight;
@@ -95,7 +95,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
glBindTexture(getFbType(), m_efbDepth);
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
glTexImage2D(getFbType(), 0, depthType, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
-
+
glBindTexture(getFbType(), m_resolvedColorTexture);
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
glTexImage2D(getFbType(), 0, GL_RGBA, m_targetWidth, m_targetHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
@@ -177,14 +177,14 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
// Create XFB framebuffer; targets will be created elsewhere.
glGenFramebuffers(1, &m_xfbFramebuffer);
-
+
// EFB framebuffer is currently bound, make sure to clear its alpha value to 1.f
glViewport(0, 0, m_targetWidth, m_targetHeight);
glScissor(0, 0, m_targetWidth, m_targetHeight);
glClearColor(0.f, 0.f, 0.f, 1.f);
glClearDepthf(1.0f);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-
+
// reinterpret pixel format
glGenBuffers(1, &m_pixel_format_vbo);
glGenVertexArrays(1, &m_pixel_format_vao);
@@ -192,7 +192,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
glBindBuffer(GL_ARRAY_BUFFER, m_pixel_format_vbo);
glEnableVertexAttribArray(SHADER_POSITION_ATTRIB);
glVertexAttribPointer(SHADER_POSITION_ATTRIB, 2, GL_FLOAT, 0, sizeof(GLfloat)*2, NULL);
-
+
float vertices[] = {
-1.0, -1.0,
1.0, -1.0,
@@ -200,14 +200,14 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
1.0, 1.0,
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
-
- char vs[] =
+
+ char vs[] =
"ATTRIN vec2 rawpos;\n"
"void main(void) {\n"
" gl_Position = vec4(rawpos,0,1);\n"
"}\n";
-
- char ps_rgba6_to_rgb8[] =
+
+ char ps_rgba6_to_rgb8[] =
"uniform sampler2DRect samp9;\n"
"COLOROUT(ocol0)\n"
"void main()\n"
@@ -220,8 +220,8 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
" dst8.a = 255;\n"
" ocol0 = float4(dst8) / 255.f;\n"
"}";
-
- char ps_rgb8_to_rgba6[] =
+
+ char ps_rgb8_to_rgba6[] =
"uniform sampler2DRect samp9;\n"
"COLOROUT(ocol0)\n"
"void main()\n"
@@ -234,11 +234,11 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
" dst6.a = src8.b & 0x3F;\n"
" ocol0 = float4(dst6) / 63.f;\n"
"}";
-
+
if(g_ogl_config.eSupportedGLSLVersion != GLSLES2)
{
// HACK: This shaders aren't glsles2 compatible as glsles2 don't support bit operations
- // it could be workaround by floor + frac + tons off additions, but I think it isn't worth
+ // it could be workaround by floor + frac + tons off additions, but I think it isn't worth
ProgramShaderCache::CompileShader(m_pixel_format_shaders[0], vs, ps_rgb8_to_rgba6);
ProgramShaderCache::CompileShader(m_pixel_format_shaders[1], vs, ps_rgba6_to_rgb8);
}
@@ -273,7 +273,7 @@ FramebufferManager::~FramebufferManager()
glDeleteRenderbuffers(2, glObj);
m_efbColor = 0;
m_efbDepth = 0;
-
+
// reinterpret pixel format
glDeleteVertexArrays(1, &m_pixel_format_vao);
glDeleteBuffers(1, &m_pixel_format_vbo);
@@ -386,9 +386,9 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
return;
}
g_renderer->ResetAPIState();
-
+
GLuint src_texture = 0;
-
+
if(m_msaaSamples > 1)
{
// MSAA mode, so resolve first
@@ -402,7 +402,7 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
// Return to EFB.
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_efbFramebuffer);
-
+
src_texture = m_resolvedColorTexture;
}
else
@@ -411,18 +411,18 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
src_texture = m_efbColor;
m_efbColor = m_resolvedColorTexture;
m_resolvedColorTexture = src_texture;
-
+
// also switch them on fbo
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, getFbType(), m_efbColor, 0);
}
glViewport(0,0, m_targetWidth, m_targetHeight);
glActiveTexture(GL_TEXTURE0 + 9);
glBindTexture(getFbType(), src_texture);
-
+
m_pixel_format_shaders[convtype ? 1 : 0].Bind();
glBindVertexArray(m_pixel_format_vao);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
+
g_renderer->RestoreAPIState();
}
@@ -452,7 +452,7 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void XFBSource::CopyEFB(float Gamma)
{
g_renderer->ResetAPIState();
-
+
// Copy EFB data to XFB and restore render target again
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer());
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
@@ -469,7 +469,7 @@ void XFBSource::CopyEFB(float Gamma)
// Return to EFB.
FramebufferManager::SetFramebuffer(0);
-
+
g_renderer->RestoreAPIState();
}
@@ -479,7 +479,7 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un
GLuint texture;
glGenTextures(1, &texture);
-
+
glActiveTexture(GL_TEXTURE0 + 9);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
diff --git a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.h b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.h
index 5b0d66f7f6..47c8b2048d 100644
--- a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.h
+++ b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.h
@@ -49,10 +49,10 @@ struct XFBSource : public XFBSourceBase
XFBSource(GLuint tex) : texture(tex) {}
~XFBSource();
- void CopyEFB(float Gamma);
- void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight);
+ void CopyEFB(float Gamma) override;
+ void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
void Draw(const MathUtil::Rectangle<float> &sourcerc,
- const MathUtil::Rectangle<float> &drawrc, int width, int height) const;
+ const MathUtil::Rectangle<float> &drawrc, int width, int height) const override;
const GLuint texture;
};
@@ -93,16 +93,16 @@ public:
// Same as above but for the depth Target.
// After calling this, before you render anything else, you MUST bind the framebuffer you want to draw to.
static GLuint ResolveAndGetDepthTarget(const EFBRectangle &rect);
-
- // Convert EFB content on pixel format change.
+
+ // Convert EFB content on pixel format change.
// convtype=0 -> rgb8->rgba6, convtype=2 -> rgba6->rgb8
static void ReinterpretPixelData(unsigned int convtype);
private:
- XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height);
- void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc);
+ XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height) override;
+ void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc) override;
- void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma);
+ void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma) override;
static int m_targetWidth;
static int m_targetHeight;
@@ -119,7 +119,7 @@ private:
static GLuint m_resolvedDepthTexture;
static GLuint m_xfbFramebuffer; // Only used in MSAA mode
-
+
// For pixel format draw
static GLuint m_pixel_format_vbo;
static GLuint m_pixel_format_vao;
diff --git a/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp b/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
index 598f336036..6ff264aebe 100644
--- a/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
@@ -120,11 +120,11 @@ namespace GLFunc
LoadFunction("glBindSampler", (void**)&glBindSampler);
LoadFunction("glDeleteSamplers", (void**)&glDeleteSamplers);
LoadFunction("glGenSamplers", (void**)&glGenSamplers);
-
+
LoadFunction("glGetProgramBinary", (void**)&glGetProgramBinary);
LoadFunction("glProgramBinary", (void**)&glProgramBinary);
LoadFunction("glProgramParameteri", (void**)&glProgramParameteri);
-
+
LoadFunction("glDrawRangeElements", (void**)&glDrawRangeElements);
LoadFunction("glRenderbufferStorageMultisample", (void**)&glRenderbufferStorageMultisample);
diff --git a/Source/Core/VideoBackends/OGL/Src/GLUtil.cpp b/Source/Core/VideoBackends/OGL/Src/GLUtil.cpp
index 256b30ace8..f2cf74acf2 100644
--- a/Source/Core/VideoBackends/OGL/Src/GLUtil.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/GLUtil.cpp
@@ -10,7 +10,6 @@
#include "ConfigManager.h"
#include "Render.h"
-#include "VertexShaderManager.h"
#include "GLUtil.h"
@@ -54,7 +53,7 @@ GLuint OpenGL_CompileProgram ( const char* vertexShader, const char* fragmentSha
GLuint vertexShaderID = glCreateShader(GL_VERTEX_SHADER);
GLuint fragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
GLuint programID = glCreateProgram();
-
+
// compile vertex shader
glShaderSource(vertexShaderID, 1, &vertexShader, NULL);
glCompileShader(vertexShaderID);
@@ -73,7 +72,7 @@ GLuint OpenGL_CompileProgram ( const char* vertexShader, const char* fragmentSha
}
bool shader_errors = !Result;
#endif
-
+
// compile fragment shader
glShaderSource(fragmentShaderID, 1, &fragmentShader, NULL);
glCompileShader(fragmentShaderID);
@@ -89,7 +88,7 @@ GLuint OpenGL_CompileProgram ( const char* vertexShader, const char* fragmentSha
}
shader_errors |= !Result;
#endif
-
+
// link them
glAttachShader(programID, vertexShaderID);
glAttachShader(programID, fragmentShaderID);
@@ -103,11 +102,11 @@ GLuint OpenGL_CompileProgram ( const char* vertexShader, const char* fragmentSha
ERROR_LOG(VIDEO, "GLSL linker error:\n%s%s%s", stringBuffer, vertexShader, fragmentShader);
}
#endif
-
+
// cleanup
glDeleteShader(vertexShaderID);
glDeleteShader(fragmentShaderID);
-
+
return programID;
}
diff --git a/Source/Core/VideoBackends/OGL/Src/GLUtil.h b/Source/Core/VideoBackends/OGL/Src/GLUtil.h
index 54a2ac5735..48466fe580 100644
--- a/Source/Core/VideoBackends/OGL/Src/GLUtil.h
+++ b/Source/Core/VideoBackends/OGL/Src/GLUtil.h
@@ -32,11 +32,12 @@
#define GL_BGRA GL_RGBA
#define glDrawElementsBaseVertex(...)
#define glDrawRangeElementsBaseVertex(...)
-#define glRenderbufferStorageMultisampleCoverageNV(...)
+#define glRenderbufferStorageMultisampleCoverageNV(...)
+#define glViewportIndexedf(...)
#endif
#else
#define TEX2D GL_TEXTURE_RECTANGLE_ARB
-#define PREC
+#define PREC
#define TEXTYPE "sampler2DRect"
#define TEXFUNC "texture2DRect"
#endif
@@ -70,14 +71,14 @@ __forceinline GLenum GL_REPORT_ERROR() { return GL_NO_ERROR; }
#endif
// this should be removed in future, but as long as glsl is unstable, we should really read this messages
-#if defined(_DEBUG) || defined(DEBUGFAST)
+#if defined(_DEBUG) || defined(DEBUGFAST)
#define DEBUG_GLSL 1
#else
#define DEBUG_GLSL 0
#endif
// Isn't defined if we aren't using GLEW 1.6
-#ifndef GL_ONE_MINUS_SRC1_ALPHA
+#ifndef GL_ONE_MINUS_SRC1_ALPHA
#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
#endif
diff --git a/Source/Core/VideoBackends/OGL/Src/NativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/Src/NativeVertexFormat.cpp
index 293e674cbb..c0112c4e9e 100644
--- a/Source/Core/VideoBackends/OGL/Src/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/NativeVertexFormat.cpp
@@ -48,21 +48,21 @@ void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
vertex_stride = vtx_decl.stride;
// We will not allow vertex components causing uneven strides.
- if (vertex_stride & 3)
+ if (vertex_stride & 3)
PanicAlert("Uneven vertex stride: %i", vertex_stride);
-
+
VertexManager *vm = (OGL::VertexManager*)g_vertex_manager;
-
+
glGenVertexArrays(1, &VAO);
glBindVertexArray(VAO);
-
+
// the element buffer is bound directly to the vao, so we must it set for every vao
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vm->m_index_buffers);
glBindBuffer(GL_ARRAY_BUFFER, vm->m_vertex_buffers);
glEnableVertexAttribArray(SHADER_POSITION_ATTRIB);
glVertexAttribPointer(SHADER_POSITION_ATTRIB, 3, GL_FLOAT, GL_FALSE, vtx_decl.stride, (u8*)NULL);
-
+
for (int i = 0; i < 3; i++) {
if (vtx_decl.num_normals > i) {
glEnableVertexAttribArray(SHADER_NORM0_ATTRIB+i);
diff --git a/Source/Core/VideoBackends/OGL/Src/PerfQuery.cpp b/Source/Core/VideoBackends/OGL/Src/PerfQuery.cpp
index f981a105e0..7cb408b62e 100644
--- a/Source/Core/VideoBackends/OGL/Src/PerfQuery.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/PerfQuery.cpp
@@ -11,7 +11,7 @@ PerfQuery::PerfQuery()
{
for (u32 i = 0; i != ArraySize(m_query_buffer); ++i)
glGenQueries(1, &m_query_buffer[i].query_id);
-
+
ResetQuery();
}
@@ -29,21 +29,21 @@ void PerfQuery::EnableQuery(PerfQueryGroup type)
// Is this sane?
if (m_query_count > ArraySize(m_query_buffer) / 2)
WeakFlush();
-
+
if (ArraySize(m_query_buffer) == m_query_count)
{
FlushOne();
//ERROR_LOG(VIDEO, "Flushed query buffer early!");
}
-
+
// start query
if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP)
{
auto& entry = m_query_buffer[(m_query_read_pos + m_query_count) % ArraySize(m_query_buffer)];
-
+
glBeginQuery(GL_SAMPLES_PASSED, entry.query_id);
entry.query_type = type;
-
+
++m_query_count;
}
}
@@ -103,10 +103,10 @@ void PerfQuery::WeakFlush()
while (!IsFlushed())
{
auto& entry = m_query_buffer[m_query_read_pos];
-
+
GLuint result = GL_FALSE;
glGetQueryObjectuiv(entry.query_id, GL_QUERY_RESULT_AVAILABLE, &result);
-
+
if (GL_TRUE == result)
{
FlushOne();
@@ -130,7 +130,7 @@ u32 PerfQuery::GetQueryResult(PerfQueryType type)
return 0;
u32 result = 0;
-
+
if (type == PQ_ZCOMP_INPUT_ZCOMPLOC || type == PQ_ZCOMP_OUTPUT_ZCOMPLOC)
{
result = m_results[PQG_ZCOMP_ZCOMPLOC];
@@ -147,7 +147,7 @@ u32 PerfQuery::GetQueryResult(PerfQueryType type)
{
result = m_results[PQG_EFB_COPY_CLOCKS];
}
-
+
return result / 4;
}
diff --git a/Source/Core/VideoBackends/OGL/Src/PerfQuery.h b/Source/Core/VideoBackends/OGL/Src/PerfQuery.h
index b96fe7a4a0..c47fa194d1 100644
--- a/Source/Core/VideoBackends/OGL/Src/PerfQuery.h
+++ b/Source/Core/VideoBackends/OGL/Src/PerfQuery.h
@@ -11,11 +11,11 @@ public:
PerfQuery();
~PerfQuery();
- void EnableQuery(PerfQueryGroup type);
- void DisableQuery(PerfQueryGroup type);
- void ResetQuery();
- u32 GetQueryResult(PerfQueryType type);
- void FlushResults();
+ void EnableQuery(PerfQueryGroup type) override;
+ void DisableQuery(PerfQueryGroup type) override;
+ void ResetQuery() override;
+ u32 GetQueryResult(PerfQueryType type) override;
+ void FlushResults() override;
bool IsFlushed() const;
private:
diff --git a/Source/Core/VideoBackends/OGL/Src/PostProcessing.cpp b/Source/Core/VideoBackends/OGL/Src/PostProcessing.cpp
index a748ab5085..84fb0c4d1c 100644
--- a/Source/Core/VideoBackends/OGL/Src/PostProcessing.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/PostProcessing.cpp
@@ -37,7 +37,7 @@ static char s_vertex_shader[] =
"void main(void) {\n"
" gl_Position = vec4(rawpos,0,1);\n"
" uv0 = tex0;\n"
- "}\n";
+ "}\n";
void Init()
{
@@ -45,7 +45,7 @@ void Init()
s_enable = 0;
s_width = 0;
s_height = 0;
-
+
glGenFramebuffers(1, &s_fbo);
glGenTextures(1, &s_texture);
glBindTexture(GL_TEXTURE_2D, s_texture);
@@ -56,17 +56,17 @@ void Init()
glBindFramebuffer(GL_FRAMEBUFFER, s_fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, s_texture, 0);
FramebufferManager::SetFramebuffer(0);
-
+
glGenBuffers(1, &s_vbo);
glBindBuffer(GL_ARRAY_BUFFER, s_vbo);
- GLfloat vertices[] = {
- -1.f, -1.f, 0.f, 0.f,
- -1.f, 1.f, 0.f, 1.f,
- 1.f, -1.f, 1.f, 0.f,
+ GLfloat vertices[] = {
+ -1.f, -1.f, 0.f, 0.f,
+ -1.f, 1.f, 0.f, 1.f,
+ 1.f, -1.f, 1.f, 0.f,
1.f, 1.f, 1.f, 1.f
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
-
+
glGenVertexArrays(1, &s_vao);
glBindVertexArray( s_vao );
glEnableVertexAttribArray(SHADER_POSITION_ATTRIB);
@@ -78,10 +78,10 @@ void Init()
void Shutdown()
{
s_shader.Destroy();
-
+
glDeleteFramebuffers(1, &s_vbo);
glDeleteTextures(1, &s_texture);
-
+
glDeleteBuffers(1, &s_vbo);
glDeleteVertexArrays(1, &s_vao);
}
@@ -99,22 +99,22 @@ void BindTargetFramebuffer ()
void BlitToScreen()
{
if(!s_enable) return;
-
+
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glViewport(0, 0, s_width, s_height);
-
+
glBindVertexArray(s_vao);
s_shader.Bind();
-
+
glUniform4f(s_uniform_resolution, (float)s_width, (float)s_height, 1.0f/(float)s_width, 1.0f/(float)s_height);
-
+
glActiveTexture(GL_TEXTURE0+9);
glBindTexture(GL_TEXTURE_2D, s_texture);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBindTexture(GL_TEXTURE_2D, 0);
-
+
/* glBindFramebuffer(GL_READ_FRAMEBUFFER, s_fbo);
-
+
glBlitFramebuffer(rc.left, rc.bottom, rc.right, rc.top,
rc.left, rc.bottom, rc.right, rc.top,
GL_COLOR_BUFFER_BIT, GL_NEAREST);*/
@@ -127,7 +127,7 @@ void Update ( u32 width, u32 height )
if(s_enable && (width != s_width || height != s_height)) {
s_width = width;
s_height = height;
-
+
// alloc texture for framebuffer
glActiveTexture(GL_TEXTURE0+9);
glBindTexture(GL_TEXTURE_2D, s_texture);
@@ -143,12 +143,12 @@ void ApplyShader()
s_currentShader = g_ActiveConfig.sPostProcessingShader;
s_enable = false;
s_shader.Destroy();
-
+
// shader disabled
if (g_ActiveConfig.sPostProcessingShader == "") return;
-
+
// so need to compile shader
-
+
// loading shader code
std::string code;
std::string path = File::GetUserPath(D_SHADERS_IDX) + g_ActiveConfig.sPostProcessingShader + ".glsl";
@@ -157,20 +157,20 @@ void ApplyShader()
// Fallback to shared user dir
path = File::GetSysDirectory() + SHADERS_DIR DIR_SEP + g_ActiveConfig.sPostProcessingShader + ".glsl";
}
- if(!File::ReadFileToString(true, path.c_str(), code)) {
+ if(!File::ReadFileToString(path.c_str(), code)) {
ERROR_LOG(VIDEO, "Post-processing shader not found: %s", path.c_str());
return;
}
-
+
// and compile it
if (!ProgramShaderCache::CompileShader(s_shader, s_vertex_shader, code.c_str())) {
ERROR_LOG(VIDEO, "Failed to compile post-processing shader %s", s_currentShader.c_str());
return;
}
-
+
// read uniform locations
s_uniform_resolution = glGetUniformLocation(s_shader.glprogid, "resolution");
-
+
// successful
s_enable = true;
}
diff --git a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
index 40eb206903..cc807b7952 100644
--- a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
@@ -94,19 +94,19 @@ void SHADER::SetProgramVariables()
{
// glsl shader must be bind to set samplers
Bind();
-
- // Bind UBO
+
+ // Bind UBO
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
{
GLint PSBlock_id = glGetUniformBlockIndex(glprogid, "PSBlock");
GLint VSBlock_id = glGetUniformBlockIndex(glprogid, "VSBlock");
-
+
if(PSBlock_id != -1)
glUniformBlockBinding(glprogid, PSBlock_id, 1);
if(VSBlock_id != -1)
glUniformBlockBinding(glprogid, VSBlock_id, 2);
}
-
+
// UBO workaround
for (int a = 0; a < NUM_UNIFORMS; ++a)
{
@@ -120,7 +120,7 @@ void SHADER::SetProgramVariables()
int max_uniforms = 0;
char name[50];
int size;
-
+
glGetProgramiv(glprogid, GL_ACTIVE_UNIFORMS, &max_uniforms);
for(int i=0; i<max_uniforms; i++)
{
@@ -142,7 +142,7 @@ void SHADER::SetProgramVariables()
{
char name[8];
snprintf(name, 8, "samp%d", a);
-
+
// Still need to get sampler locations since we aren't binding them statically in the shaders
int loc = glGetUniformLocation(glprogid, name);
if (loc != -1)
@@ -165,16 +165,16 @@ void SHADER::SetProgramBindings()
}
// Need to set some attribute locations
glBindAttribLocation(glprogid, SHADER_POSITION_ATTRIB, "rawpos");
-
+
glBindAttribLocation(glprogid, SHADER_POSMTX_ATTRIB, "fposmtx");
-
+
glBindAttribLocation(glprogid, SHADER_COLOR0_ATTRIB, "color0");
glBindAttribLocation(glprogid, SHADER_COLOR1_ATTRIB, "color1");
-
+
glBindAttribLocation(glprogid, SHADER_NORM0_ATTRIB, "rawnorm0");
glBindAttribLocation(glprogid, SHADER_NORM1_ATTRIB, "rawnorm1");
glBindAttribLocation(glprogid, SHADER_NORM2_ATTRIB, "rawnorm2");
-
+
for(int i=0; i<8; i++) {
char attrib_name[8];
snprintf(attrib_name, 8, "tex%d", i);
@@ -206,24 +206,24 @@ void ProgramShaderCache::UploadConstants()
memcpy(tmpbuffer, &PixelShaderManager::constants, sizeof(PixelShaderConstants));
memcpy(tmpbuffer+ROUND_UP(sizeof(PixelShaderConstants), s_ubo_align), &VertexShaderManager::constants, sizeof(VertexShaderConstants));
size_t offset = s_buffer->Upload(tmpbuffer, s_ubo_buffer_size);
- glBindBufferRange(GL_UNIFORM_BUFFER, 1,
+ glBindBufferRange(GL_UNIFORM_BUFFER, 1,
s_buffer->getBuffer(), offset, sizeof(PixelShaderConstants));
- glBindBufferRange(GL_UNIFORM_BUFFER, 2,
+ glBindBufferRange(GL_UNIFORM_BUFFER, 2,
s_buffer->getBuffer(), offset+ROUND_UP(sizeof(PixelShaderConstants), s_ubo_align), sizeof(VertexShaderConstants));
}
else
{
size_t offset = s_buffer->Upload((u8*)&PixelShaderManager::constants, ROUND_UP(sizeof(PixelShaderConstants), s_ubo_align));
- glBindBufferRange(GL_UNIFORM_BUFFER, 1,
+ glBindBufferRange(GL_UNIFORM_BUFFER, 1,
s_buffer->getBuffer(), offset, sizeof(PixelShaderConstants));
offset = s_buffer->Upload((u8*)&VertexShaderManager::constants, ROUND_UP(sizeof(VertexShaderConstants), s_ubo_align));
- glBindBufferRange(GL_UNIFORM_BUFFER, 2,
+ glBindBufferRange(GL_UNIFORM_BUFFER, 2,
s_buffer->getBuffer(), offset, sizeof(VertexShaderConstants));
}
PixelShaderManager::dirty = false;
VertexShaderManager::dirty = false;
-
+
ADDSTAT(stats.thisFrame.bytesUniformStreamed, s_ubo_buffer_size);
}
}
@@ -241,10 +241,10 @@ void ProgramShaderCache::UploadConstants()
if(last_entry->shader.UniformSize[a+10] > 0)
glUniform4fv(last_entry->shader.UniformLocations[a+10], last_entry->shader.UniformSize[a+10], (float*) &VertexShaderManager::constants + 4*VSVar_Loc[a]);
}
-
+
ADDSTAT(stats.thisFrame.bytesUniformStreamed, s_ubo_buffer_size);
}
-
+
}
GLuint ProgramShaderCache::GetCurrentProgram(void)
@@ -317,7 +317,7 @@ SHADER* ProgramShaderCache::SetShader ( DSTALPHA_MODE dstAlphaMode, u32 componen
INCSTAT(stats.numPixelShadersCreated);
SETSTAT(stats.numPixelShadersAlive, pshaders.size());
GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE, true);
-
+
last_entry->shader.Bind();
return &last_entry->shader;
}
@@ -333,9 +333,9 @@ bool ProgramShaderCache::CompileShader ( SHADER& shader, const char* vcode, cons
glDeleteShader(psid);
return false;
}
-
+
GLuint pid = shader.glprogid = glCreateProgram();;
-
+
glAttachShader(pid, vsid);
glAttachShader(pid, psid);
@@ -343,13 +343,13 @@ bool ProgramShaderCache::CompileShader ( SHADER& shader, const char* vcode, cons
glProgramParameteri(pid, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
shader.SetProgramBindings();
-
+
glLinkProgram(pid);
-
+
// original shaders aren't needed any more
glDeleteShader(vsid);
glDeleteShader(psid);
-
+
GLint linkStatus;
glGetProgramiv(pid, GL_LINK_STATUS, &linkStatus);
GLsizei length = 0;
@@ -366,7 +366,7 @@ bool ProgramShaderCache::CompileShader ( SHADER& shader, const char* vcode, cons
OpenFStream(file, szTemp, std::ios_base::out);
file << s_glsl_header << vcode << s_glsl_header << pcode << infoLog;
file.close();
-
+
if(linkStatus != GL_TRUE)
PanicAlert("Failed to link shaders!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s, %s, %s):\n%s",
szTemp,
@@ -374,7 +374,7 @@ bool ProgramShaderCache::CompileShader ( SHADER& shader, const char* vcode, cons
g_ogl_config.gl_renderer,
g_ogl_config.gl_version,
infoLog);
-
+
delete [] infoLog;
}
if (linkStatus != GL_TRUE)
@@ -388,7 +388,7 @@ bool ProgramShaderCache::CompileShader ( SHADER& shader, const char* vcode, cons
}
shader.SetProgramVariables();
-
+
return true;
}
@@ -397,7 +397,7 @@ GLuint ProgramShaderCache::CompileSingleShader (GLuint type, const char* code )
GLuint result = glCreateShader(type);
const char *src[] = {s_glsl_header, code};
-
+
glShaderSource(result, 2, src, NULL);
glCompileShader(result);
GLint compileStatus;
@@ -415,16 +415,16 @@ GLuint ProgramShaderCache::CompileSingleShader (GLuint type, const char* code )
glGetShaderInfoLog(result, length, &charsWritten, infoLog);
ERROR_LOG(VIDEO, "PS Shader info log:\n%s", infoLog);
char szTemp[MAX_PATH];
- sprintf(szTemp,
- "%sbad_%s_%04i.txt",
- File::GetUserPath(D_DUMP_IDX).c_str(),
- type==GL_VERTEX_SHADER ? "vs" : "ps",
+ sprintf(szTemp,
+ "%sbad_%s_%04i.txt",
+ File::GetUserPath(D_DUMP_IDX).c_str(),
+ type==GL_VERTEX_SHADER ? "vs" : "ps",
num_failures++);
std::ofstream file;
OpenFStream(file, szTemp, std::ios_base::out);
file << s_glsl_header << code << infoLog;
file.close();
-
+
if(compileStatus != GL_TRUE)
PanicAlert("Failed to compile %s shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%s, %s, %s):\n%s",
type==GL_VERTEX_SHADER ? "vertex" : "pixel",
@@ -433,7 +433,7 @@ GLuint ProgramShaderCache::CompileSingleShader (GLuint type, const char* code )
g_ogl_config.gl_renderer,
g_ogl_config.gl_version,
infoLog);
-
+
delete[] infoLog;
}
if (compileStatus != GL_TRUE)
@@ -502,19 +502,19 @@ void ProgramShaderCache::Init(void)
{
if (!File::Exists(File::GetUserPath(D_SHADERCACHE_IDX)))
File::CreateDir(File::GetUserPath(D_SHADERCACHE_IDX).c_str());
-
+
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%sogl-%s-shaders.cache", File::GetUserPath(D_SHADERCACHE_IDX).c_str(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
-
+
ProgramShaderCacheInserter inserter;
g_program_disk_cache.OpenAndRead(cache_filename, inserter);
}
SETSTAT(stats.numPixelShadersAlive, pshaders.size());
}
-
+
CreateHeader();
-
+
CurrentProgram = 0;
last_entry = NULL;
}
@@ -528,16 +528,16 @@ void ProgramShaderCache::Shutdown(void)
for (; iter != pshaders.end(); ++iter)
{
if(iter->second.in_cache) continue;
-
+
GLint binary_size;
glGetProgramiv(iter->second.shader.glprogid, GL_PROGRAM_BINARY_LENGTH, &binary_size);
if(!binary_size) continue;
-
+
u8 *data = new u8[binary_size+sizeof(GLenum)];
u8 *binary = data + sizeof(GLenum);
GLenum *prog_format = (GLenum*)data;
glGetProgramBinary(iter->second.shader.glprogid, binary_size, NULL, prog_format, binary);
-
+
g_program_disk_cache.Append(iter->first, data, binary_size+sizeof(GLenum));
delete [] data;
}
@@ -547,7 +547,7 @@ void ProgramShaderCache::Shutdown(void)
}
glUseProgram(0);
-
+
PCache::iterator iter = pshaders.begin();
for (; iter != pshaders.end(); ++iter)
iter->second.Destroy();
@@ -566,11 +566,11 @@ void ProgramShaderCache::Shutdown(void)
void ProgramShaderCache::CreateHeader ( void )
{
GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion;
- snprintf(s_glsl_header, sizeof(s_glsl_header),
+ snprintf(s_glsl_header, sizeof(s_glsl_header),
"%s\n"
"%s\n" // ubo
"%s\n" // early-z
-
+
// Precision defines for GLSLES2/3
"%s\n"
@@ -604,18 +604,18 @@ void ProgramShaderCache::CreateHeader ( void )
"%s\n"
"#define COLOROUT(name) %s\n"
-
+
, v==GLSLES2 ? "" : v==GLSLES3 ? "#version 300 es" : v==GLSL_130 ? "#version 130" : v==GLSL_140 ? "#version 140" : "#version 150"
, g_ActiveConfig.backend_info.bSupportsGLSLUBO && v<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, g_ActiveConfig.backend_info.bSupportsEarlyZ ? "#extension GL_ARB_shader_image_load_store : enable" : ""
-
+
, (v==GLSLES3 || v==GLSLES2) ? "precision highp float;" : ""
-
+
, v==GLSLES2 ? "attribute" : "in"
, v==GLSLES2 ? "attribute" : "out"
, v==GLSLES2 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "in" : "centroid in"
, v==GLSLES2 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "out" : "centroid out"
-
+
, v==GLSLES2 ? "#define texture2DRect texture2D" : v==GLSLES3 ? "" : v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture"
, v==GLSLES3 ? "#define texture2DRect(samp, uv) texelFetch(samp, ivec2(floor(uv)), 0)" : ""
, (v==GLSLES3 || v==GLSLES2) ? "#define sampler2DRect sampler2D" : ""
@@ -624,7 +624,7 @@ void ProgramShaderCache::CreateHeader ( void )
, v==GLSLES2 ? "#define round(x) floor((x)+0.5)" : ""
, v==GLSLES2 ? "#define out " : ""
, v==GLSLES2 ? "#define ocol0 gl_FragColor" : ""
- , v==GLSLES2 ? "#define ocol1 gl_FragColor" : ""
+ , v==GLSLES2 ? "#define ocol1 gl_FragColor" : ""
, DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) ? "#extension GL_NV_uniform_buffer_object : enable" : ""
, DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) ? "#extension GL_NV_fragdepth : enable" : ""
, v==GLSLES2 ? "" : "out vec4 name;"
@@ -637,7 +637,7 @@ void ProgramShaderCache::ProgramShaderCacheInserter::Read ( const SHADERUID& key
const u8 *binary = value+sizeof(GLenum);
GLenum *prog_format = (GLenum*)value;
GLint binary_size = value_size-sizeof(GLenum);
-
+
PCacheEntry entry;
entry.in_cache = 1;
entry.shader.glprogid = glCreateProgram();
diff --git a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.h b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.h
index d0c792aaa0..a7b21a929d 100644
--- a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.h
+++ b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.h
@@ -53,11 +53,11 @@ struct SHADER
glprogid = 0;
}
GLuint glprogid; // opengl program id
-
+
std::string strvprog, strpprog;
GLint UniformLocations[NUM_UNIFORMS];
u32 UniformSize[NUM_UNIFORMS];
-
+
void SetProgramVariables();
void SetProgramBindings();
void Bind();
@@ -84,7 +84,7 @@ public:
static GLuint GetCurrentProgram(void);
static SHADER* SetShader(DSTALPHA_MODE dstAlphaMode, u32 components);
static void GetShaderId(SHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 components);
-
+
static bool CompileShader(SHADER &shader, const char* vcode, const char* pcode);
static GLuint CompileSingleShader(GLuint type, const char *code);
static void UploadConstants();
@@ -97,7 +97,7 @@ private:
class ProgramShaderCacheInserter : public LinearDiskCacheReader<SHADERUID, u8>
{
public:
- void Read(const SHADERUID &key, const u8 *value, u32 value_size);
+ void Read(const SHADERUID &key, const u8 *value, u32 value_size) override;
};
static PCache pshaders;
diff --git a/Source/Core/VideoBackends/OGL/Src/RasterFont.cpp b/Source/Core/VideoBackends/OGL/Src/RasterFont.cpp
index 9e46a5eb86..c1817f3eeb 100644
--- a/Source/Core/VideoBackends/OGL/Src/RasterFont.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/RasterFont.cpp
@@ -16,104 +16,104 @@ static const u32 char_offset = 32;
static const u32 char_count = 95;
const u8 rasters[char_count][char_height] = {
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36},
- {0x00, 0x00, 0x00, 0x66, 0x66, 0xff, 0x66, 0x66, 0xff, 0x66, 0x66, 0x00, 0x00},
- {0x00, 0x00, 0x18, 0x7e, 0xff, 0x1b, 0x1f, 0x7e, 0xf8, 0xd8, 0xff, 0x7e, 0x18},
- {0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x6e, 0x30, 0x18, 0x0c, 0x76, 0xdb, 0xd8, 0x70},
- {0x00, 0x00, 0x7f, 0xc6, 0xcf, 0xd8, 0x70, 0x70, 0xd8, 0xcc, 0xcc, 0x6c, 0x38},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1c, 0x0c, 0x0e},
- {0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c},
- {0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30},
- {0x00, 0x00, 0x00, 0x00, 0x99, 0x5a, 0x3c, 0xff, 0x3c, 0x5a, 0x99, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00},
- {0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03},
- {0x00, 0x00, 0x3c, 0x66, 0xc3, 0xe3, 0xf3, 0xdb, 0xcf, 0xc7, 0xc3, 0x66, 0x3c},
- {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18},
- {0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0xe7, 0x7e},
- {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0x07, 0x03, 0x03, 0xe7, 0x7e},
- {0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xcc, 0x6c, 0x3c, 0x1c, 0x0c},
- {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xff},
- {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
- {0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 0xff},
- {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e},
- {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x03, 0x7f, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e},
- {0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06},
- {0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60},
- {0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0c, 0x06, 0x03, 0xc3, 0xc3, 0x7e},
- {0x00, 0x00, 0x3f, 0x60, 0xcf, 0xdb, 0xd3, 0xdd, 0xc3, 0x7e, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18},
- {0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
- {0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
- {0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc},
- {0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff},
- {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff},
- {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
- {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
- {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e},
- {0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06},
- {0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3},
- {0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0},
- {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3},
- {0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3},
- {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e},
- {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
- {0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c},
- {0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
- {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e},
- {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff},
- {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
- {0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
- {0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
- {0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3},
- {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3},
- {0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff},
- {0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c},
- {0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60},
- {0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18},
- {0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x30, 0x70},
- {0x00, 0x00, 0x7f, 0xc3, 0xc3, 0x7f, 0x03, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0},
- {0x00, 0x00, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x03, 0x03, 0x03, 0x03, 0x03},
- {0x00, 0x00, 0x7f, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x33, 0x1e},
- {0x7e, 0xc3, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0},
- {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00},
- {0x38, 0x6c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x00},
- {0x00, 0x00, 0xc6, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0},
- {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78},
- {0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xfe, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00},
- {0xc0, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00},
- {0x03, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xfe, 0x03, 0x03, 0x7e, 0xc0, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x1c, 0x36, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x00},
- {0x00, 0x00, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00},
- {0xc0, 0x60, 0x60, 0x30, 0x18, 0x3c, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0xff, 0x60, 0x30, 0x18, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x0f, 0x18, 0x18, 0x18, 0x38, 0xf0, 0x38, 0x18, 0x18, 0x18, 0x0f},
- {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18},
- {0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00}
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36},
+ {0x00, 0x00, 0x00, 0x66, 0x66, 0xff, 0x66, 0x66, 0xff, 0x66, 0x66, 0x00, 0x00},
+ {0x00, 0x00, 0x18, 0x7e, 0xff, 0x1b, 0x1f, 0x7e, 0xf8, 0xd8, 0xff, 0x7e, 0x18},
+ {0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x6e, 0x30, 0x18, 0x0c, 0x76, 0xdb, 0xd8, 0x70},
+ {0x00, 0x00, 0x7f, 0xc6, 0xcf, 0xd8, 0x70, 0x70, 0xd8, 0xcc, 0xcc, 0x6c, 0x38},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1c, 0x0c, 0x0e},
+ {0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c},
+ {0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30},
+ {0x00, 0x00, 0x00, 0x00, 0x99, 0x5a, 0x3c, 0xff, 0x3c, 0x5a, 0x99, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00},
+ {0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03},
+ {0x00, 0x00, 0x3c, 0x66, 0xc3, 0xe3, 0xf3, 0xdb, 0xcf, 0xc7, 0xc3, 0x66, 0x3c},
+ {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18},
+ {0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0xe7, 0x7e},
+ {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0x07, 0x03, 0x03, 0xe7, 0x7e},
+ {0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xcc, 0x6c, 0x3c, 0x1c, 0x0c},
+ {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xff},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
+ {0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 0xff},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e},
+ {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x03, 0x7f, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e},
+ {0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06},
+ {0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60},
+ {0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0c, 0x06, 0x03, 0xc3, 0xc3, 0x7e},
+ {0x00, 0x00, 0x3f, 0x60, 0xcf, 0xdb, 0xd3, 0xdd, 0xc3, 0x7e, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18},
+ {0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
+ {0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc},
+ {0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff},
+ {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e},
+ {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
+ {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e},
+ {0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06},
+ {0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3},
+ {0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0},
+ {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3},
+ {0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e},
+ {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
+ {0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c},
+ {0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe},
+ {0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e},
+ {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff},
+ {0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
+ {0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
+ {0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3},
+ {0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3},
+ {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3},
+ {0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff},
+ {0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c},
+ {0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60},
+ {0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18},
+ {0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x30, 0x70},
+ {0x00, 0x00, 0x7f, 0xc3, 0xc3, 0x7f, 0x03, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0},
+ {0x00, 0x00, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x03, 0x03, 0x03, 0x03, 0x03},
+ {0x00, 0x00, 0x7f, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x33, 0x1e},
+ {0x7e, 0xc3, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0},
+ {0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00},
+ {0x38, 0x6c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x00},
+ {0x00, 0x00, 0xc6, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0},
+ {0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78},
+ {0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xfe, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00},
+ {0xc0, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00},
+ {0x03, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xfe, 0x03, 0x03, 0x7e, 0xc0, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x1c, 0x36, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x00},
+ {0x00, 0x00, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00},
+ {0xc0, 0x60, 0x60, 0x30, 0x18, 0x3c, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0xff, 0x60, 0x30, 0x18, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x0f, 0x18, 0x18, 0x18, 0x38, 0xf0, 0x38, 0x18, 0x18, 0x18, 0x0f},
+ {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18},
+ {0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00}
};
-static const char *s_vertexShaderSrc =
+static const char *s_vertexShaderSrc =
"uniform vec2 charSize;\n"
"ATTRIN vec2 rawpos;\n"
"ATTRIN vec2 tex0;\n"
@@ -121,7 +121,7 @@ static const char *s_vertexShaderSrc =
"void main(void) {\n"
" gl_Position = vec4(rawpos,0,1);\n"
" uv0 = tex0 * charSize;\n"
- "}\n";
+ "}\n";
static const char *s_fragmentShaderSrc =
"uniform sampler2D samp8;\n"
@@ -131,9 +131,9 @@ static const char *s_fragmentShaderSrc =
"void main(void) {\n"
" ocol0 = texture(samp8,uv0) * color;\n"
"}\n";
-
+
static SHADER s_shader;
-
+
RasterFont::RasterFont()
{
// generate the texture
@@ -253,16 +253,16 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, usage*sizeof(GLfloat), vertices, GL_STREAM_DRAW);
-
+
delete [] vertices;
s_shader.Bind();
-
+
if(color != cached_color) {
glUniform4f(uniform_color_id, GLfloat((color>>16)&0xff)/255.f,GLfloat((color>>8)&0xff)/255.f,GLfloat((color>>0)&0xff)/255.f,GLfloat((color>>24)&0xff)/255.f);
cached_color = color;
}
-
+
glActiveTexture(GL_TEXTURE0+8);
glDrawArrays(GL_TRIANGLES, 0, usage/4);
}
diff --git a/Source/Core/VideoBackends/OGL/Src/RasterFont.h b/Source/Core/VideoBackends/OGL/Src/RasterFont.h
index 97ad877082..7f3cff1414 100644
--- a/Source/Core/VideoBackends/OGL/Src/RasterFont.h
+++ b/Source/Core/VideoBackends/OGL/Src/RasterFont.h
@@ -15,7 +15,7 @@ public:
void printMultilineText(const char *text, double x, double y, double z, int bbWidth, int bbHeight, u32 color);
private:
-
+
u32 VBO;
u32 VAO;
u32 texture;
diff --git a/Source/Core/VideoBackends/OGL/Src/Render.cpp b/Source/Core/VideoBackends/OGL/Src/Render.cpp
index 4dca112031..63f8a3db49 100644
--- a/Source/Core/VideoBackends/OGL/Src/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/Render.cpp
@@ -9,6 +9,7 @@
#include <vector>
#include <cmath>
#include <cstdio>
+#include <cinttypes>
#include "GLUtil.h"
#if defined(HAVE_WX) && HAVE_WX
@@ -33,7 +34,6 @@
#include "RasterFont.h"
#include "VertexShaderGen.h"
#include "DLCache.h"
-#include "PixelShaderManager.h"
#include "ProgramShaderCache.h"
#include "VertexShaderManager.h"
#include "VertexLoaderManager.h"
@@ -168,9 +168,9 @@ int GetNumMSAASamples(int MSAAMode)
default:
samples = 1;
}
-
+
if(samples <= g_ogl_config.max_samples) return samples;
-
+
// TODO: move this to InitBackendInfo
OSD::AddMessage(StringFromFormat("%d Anti Aliasing samples selected, but only %d supported by your GPU.", samples, g_ogl_config.max_samples), 10000);
return g_ogl_config.max_samples;
@@ -195,7 +195,7 @@ int GetNumMSAACoverageSamples(int MSAAMode)
samples = 0;
}
if(g_ogl_config.bSupportCoverageMSAA || samples == 0) return samples;
-
+
// TODO: move this to InitBackendInfo
OSD::AddMessage("CSAA Anti Aliasing isn't supported by your GPU.", 10000);
return 0;
@@ -279,7 +279,7 @@ void InitDriverInfo()
// Get the vendor first
if (svendor == "NVIDIA Corporation" && srenderer != "NVIDIA Tegra")
- vendor = DriverDetails::VENDOR_NVIDIA;
+ vendor = DriverDetails::VENDOR_NVIDIA;
else if (svendor == "ATI Technologies Inc." || svendor == "Advanced Micro Devices, Inc.")
vendor = DriverDetails::VENDOR_ATI;
else if (std::string::npos != sversion.find("Mesa"))
@@ -301,7 +301,7 @@ void InitDriverInfo()
vendor = DriverDetails::VENDOR_TEGRA;
else if (svendor == "Vivante Corporation")
vendor = DriverDetails::VENDOR_VIVANTE;
-
+
// Get device family and driver version...if we care about it
switch(vendor)
{
@@ -329,7 +329,7 @@ void InitDriverInfo()
driver = DriverDetails::DRIVER_I965;
else if(std::string::npos != srenderer.find("AMD") || std::string::npos != srenderer.find("ATI"))
driver = DriverDetails::DRIVER_R600;
-
+
int major = 0;
int minor = 0;
int release = 0;
@@ -361,7 +361,7 @@ Renderer::Renderer()
g_ogl_config.gl_renderer = (const char*)glGetString(GL_RENDERER);
g_ogl_config.gl_version = (const char*)glGetString(GL_VERSION);
g_ogl_config.glsl_version = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
-
+
InitDriverInfo();
// Init extension support.
@@ -371,21 +371,22 @@ Renderer::Renderer()
WARN_LOG(VIDEO, "Running the OpenGL ES 3 backend!");
g_Config.backend_info.bSupportsDualSourceBlend = false;
- g_Config.backend_info.bSupportsGLSLUBO = !DriverDetails::HasBug(DriverDetails::BUG_ANNIHILATEDUBOS);
- g_Config.backend_info.bSupportsPrimitiveRestart = true;
+ g_Config.backend_info.bSupportsGLSLUBO = !DriverDetails::HasBug(DriverDetails::BUG_ANNIHILATEDUBOS);
+ g_Config.backend_info.bSupportsPrimitiveRestart = true;
g_Config.backend_info.bSupportsEarlyZ = false;
-#ifdef ANDROID
- g_ogl_config.bSupportsGLSLCache = false;
+#ifdef ANDROID
+ g_ogl_config.bSupportsGLSLCache = false;
#else
- g_ogl_config.bSupportsGLSLCache = true;
+ g_ogl_config.bSupportsGLSLCache = true;
#endif
- g_ogl_config.bSupportsGLPinnedMemory = false;
- g_ogl_config.bSupportsGLSync = true;
- g_ogl_config.bSupportsGLBaseVertex = false;
+ g_ogl_config.bSupportsGLPinnedMemory = false;
+ g_ogl_config.bSupportsGLSync = true;
+ g_ogl_config.bSupportsGLBaseVertex = false;
g_ogl_config.bSupportCoverageMSAA = false; // XXX: GLES3 spec has MSAA
- g_ogl_config.bSupportSampleShading = false;
- g_ogl_config.bSupportOGL31 = false;
+ g_ogl_config.bSupportSampleShading = false;
+ g_ogl_config.bSupportOGL31 = false;
+ g_ogl_config.bSupportViewportFloat = false;
if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) || DriverDetails::HasBug(DriverDetails::BUG_ISPOWERVR))
g_ogl_config.eSupportedGLSLVersion = GLSLES2;
else
@@ -399,7 +400,7 @@ Renderer::Renderer()
PanicAlert("glewInit() failed! Does your video card support OpenGL 2.x?");
return;
}
-
+
// check for the max vertex attributes
GLint numvertexattribs = 0;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &numvertexattribs);
@@ -420,7 +421,7 @@ Renderer::Renderer()
max_texture_size);
bSuccess = false;
}
-
+
#if defined(_DEBUG) || defined(DEBUGFAST)
if (GLEW_ARB_debug_output)
{
@@ -454,7 +455,7 @@ Renderer::Renderer()
"GPU: Does your video card support OpenGL 3.0?");
bSuccess = false;
}
-
+
if (!GLEW_ARB_map_buffer_range)
{
// ogl3 buffer mapping for better streaming support.
@@ -473,7 +474,7 @@ Renderer::Renderer()
"Please report this issue, then there will be a workaround");
bSuccess = false;
}
-
+
// OpenGL 3 doesn't provide GLES like float functions for depth.
// They are in core in OpenGL 4.1, so almost every driver should support them.
// But for the oldest ones, we provide fallbacks to the old double functions.
@@ -481,14 +482,14 @@ Renderer::Renderer()
{
glDepthRangef = DepthRangef;
glClearDepthf = ClearDepthf;
-
+
}
-
+
g_Config.backend_info.bSupportsDualSourceBlend = GLEW_ARB_blend_func_extended;
g_Config.backend_info.bSupportsGLSLUBO = GLEW_ARB_uniform_buffer_object;
g_Config.backend_info.bSupportsPrimitiveRestart = GLEW_VERSION_3_1 || GLEW_NV_primitive_restart;
g_Config.backend_info.bSupportsEarlyZ = GLEW_ARB_shader_image_load_store;
-
+
g_ogl_config.bSupportsGLSLCache = GLEW_ARB_get_program_binary;
g_ogl_config.bSupportsGLPinnedMemory = GLEW_AMD_pinned_memory;
g_ogl_config.bSupportsGLSync = GLEW_ARB_sync;
@@ -496,6 +497,7 @@ Renderer::Renderer()
g_ogl_config.bSupportCoverageMSAA = GLEW_NV_framebuffer_multisample_coverage;
g_ogl_config.bSupportSampleShading = GLEW_ARB_sample_shading;
g_ogl_config.bSupportOGL31 = GLEW_VERSION_3_1;
+ g_ogl_config.bSupportViewportFloat = GLEW_ARB_viewport_array;
if(strstr(g_ogl_config.glsl_version, "1.00") || strstr(g_ogl_config.glsl_version, "1.10") || strstr(g_ogl_config.glsl_version, "1.20"))
{
@@ -519,17 +521,30 @@ Renderer::Renderer()
g_ogl_config.eSupportedGLSLVersion = GLSL_150;
}
#endif
+ int samples;
+ glGetIntegerv(GL_SAMPLES, &samples);
+ if(samples > 1)
+ {
+ // MSAA on default framebuffer isn't working because of glBlitFramebuffer.
+ // It also isn't useful as we don't render anything to the default framebuffer.
+ // We also try to get a non-msaa fb, so this only happens when forced by the driver.
+ PanicAlert("MSAA on default framebuffer isn't supported.\n"
+ "Please avoid forcing dolphin to use MSAA by the driver.\n"
+ "%d samples on default framebuffer found.", samples);
+ bSuccess = false;
+ }
+
if (!bSuccess)
{
// Not all needed extensions are supported, so we have to stop here.
// Else some of the next calls might crash.
return;
}
-
+
glGetIntegerv(GL_MAX_SAMPLES, &g_ogl_config.max_samples);
- if(g_ogl_config.max_samples < 1)
+ if(g_ogl_config.max_samples < 1)
g_ogl_config.max_samples = 1;
-
+
if(g_Config.backend_info.bSupportsGLSLUBO && DriverDetails::HasBug(DriverDetails::BUG_BROKENUBO))
{
g_Config.backend_info.bSupportsGLSLUBO = false;
@@ -537,14 +552,14 @@ Renderer::Renderer()
OSD::AddMessage("Major performance warning: Buggy GPU driver detected.", 20000);
OSD::AddMessage("Please either install the closed-source GPU driver or update your Mesa 3D version.", 20000);
}
-
+
UpdateActiveConfig();
OSD::AddMessage(StringFromFormat("Video Info: %s, %s, %s",
g_ogl_config.gl_vendor,
g_ogl_config.gl_renderer,
g_ogl_config.gl_version), 5000);
-
+
WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s",
g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "UniformBuffer ",
@@ -557,12 +572,12 @@ Renderer::Renderer()
g_ogl_config.bSupportCoverageMSAA ? "" : "CSAA ",
g_ogl_config.bSupportSampleShading ? "" : "SSAA "
);
-
+
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
ApplySSAASettings();
-
+
// Decide framebuffer size
s_backbuffer_width = (int)GLInterface->GetBackBufferWidth();
s_backbuffer_height = (int)GLInterface->GetBackBufferHeight();
@@ -583,7 +598,7 @@ Renderer::Renderer()
// Because of the fixed framebuffer size we need to disable the resolution
// options while running
g_Config.bRunning = true;
-
+
glStencilFunc(GL_ALWAYS, 0, 0);
glBlendFunc(GL_ONE, GL_ONE);
@@ -635,14 +650,14 @@ Renderer::~Renderer()
void Renderer::Shutdown()
{
delete g_framebuffer_manager;
-
+
g_Config.bRunning = false;
UpdateActiveConfig();
-
+
glDeleteBuffers(1, &s_ShowEFBCopyRegions_VBO);
glDeleteVertexArrays(1, &s_ShowEFBCopyRegions_VAO);
s_ShowEFBCopyRegions_VBO = 0;
-
+
delete s_pfont;
s_pfont = 0;
s_ShowEFBCopyRegions.Destroy();
@@ -653,10 +668,10 @@ void Renderer::Init()
// Initialize the FramebufferManager
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
s_MSAASamples, s_MSAACoverageSamples);
-
+
s_pfont = new RasterFont();
-
- ProgramShaderCache::CompileShader(s_ShowEFBCopyRegions,
+
+ ProgramShaderCache::CompileShader(s_ShowEFBCopyRegions,
"ATTRIN vec2 rawpos;\n"
"ATTRIN vec3 color0;\n"
"VARYOUT vec4 c;\n"
@@ -669,7 +684,7 @@ void Renderer::Init()
"void main(void) {\n"
" ocol0 = c;\n"
"}\n");
-
+
// creating buffers
glGenBuffers(1, &s_ShowEFBCopyRegions_VBO);
glGenVertexArrays(1, &s_ShowEFBCopyRegions_VAO);
@@ -695,7 +710,7 @@ void Renderer::DrawDebugInfo()
p+=sprintf(p, "FPS: %d\n", s_fps);
if (SConfig::GetInstance().m_ShowLag)
- p+=sprintf(p, "Lag: %llu\n", Movie::g_currentLagCount);
+ p+=sprintf(p, "Lag: %" PRIu64 "\n", Movie::g_currentLagCount);
if (g_ActiveConfig.bShowInputDisplay)
p+=sprintf(p, "%s", Movie::GetInputDisplay().c_str());
@@ -715,7 +730,7 @@ void Renderer::DrawDebugInfo()
// Draw EFB copy regions rectangles
int a = 0;
GLfloat color[3] = {0.0f, 1.0f, 1.0f};
-
+
for (std::vector<EFBRectangle>::const_iterator it = stats.efb_regions.begin();
it != stats.efb_regions.end(); ++it)
{
@@ -731,78 +746,78 @@ void Renderer::DrawDebugInfo()
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x2;
Vertices[a++] = y;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
-
+
+
Vertices[a++] = x2;
Vertices[a++] = y;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x2;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
-
+
+
Vertices[a++] = x2;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
-
+
+
Vertices[a++] = x;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x;
Vertices[a++] = y;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
-
+
+
Vertices[a++] = x;
Vertices[a++] = y;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x2;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
-
+
+
Vertices[a++] = x2;
Vertices[a++] = y;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
Vertices[a++] = x;
Vertices[a++] = y2;
Vertices[a++] = color[0];
Vertices[a++] = color[1];
Vertices[a++] = color[2];
-
+
// TO DO: build something nicer here
GLfloat temp = color[0];
color[0] = color[1];
@@ -810,7 +825,7 @@ void Renderer::DrawDebugInfo()
color[2] = temp;
}
glUnmapBuffer(GL_ARRAY_BUFFER);
-
+
s_ShowEFBCopyRegions.Bind();
glBindVertexArray( s_ShowEFBCopyRegions_VAO );
glDrawArrays(GL_LINES, 0, stats.efb_regions.size() * 2*6);
@@ -972,11 +987,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
if (s_MSAASamples > 1)
{
g_renderer->ResetAPIState();
-
+
// Resolve our rectangle.
FramebufferManager::GetEFBDepthTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
-
+
g_renderer->RestoreAPIState();
}
@@ -1025,11 +1040,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
if (s_MSAASamples > 1)
{
g_renderer->ResetAPIState();
-
+
// Resolve our rectangle.
FramebufferManager::GetEFBColorTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
-
+
g_renderer->RestoreAPIState();
}
@@ -1091,7 +1106,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
}
// Called from VertexShaderManager
-void Renderer::UpdateViewport(Matrix44& vpCorrection)
+void Renderer::UpdateViewport()
{
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
// [0] = width/2
@@ -1105,12 +1120,12 @@ void Renderer::UpdateViewport(Matrix44& vpCorrection)
int scissorYOff = bpmem.scissorOffset.y * 2;
// TODO: ceil, floor or just cast to int?
- int X = EFBToScaledX((int)ceil(xfregs.viewport.xOrig - xfregs.viewport.wd - (float)scissorXOff));
- int Y = EFBToScaledY((int)ceil((float)EFB_HEIGHT - xfregs.viewport.yOrig + xfregs.viewport.ht + (float)scissorYOff));
- int Width = EFBToScaledX((int)ceil(2.0f * xfregs.viewport.wd));
- int Height = EFBToScaledY((int)ceil(-2.0f * xfregs.viewport.ht));
- double GLNear = (xfregs.viewport.farZ - xfregs.viewport.zRange) / 16777216.0f;
- double GLFar = xfregs.viewport.farZ / 16777216.0f;
+ float X = EFBToScaledXf(xfregs.viewport.xOrig - xfregs.viewport.wd - (float)scissorXOff);
+ float Y = EFBToScaledYf((float)EFB_HEIGHT - xfregs.viewport.yOrig + xfregs.viewport.ht + (float)scissorYOff);
+ float Width = EFBToScaledXf(2.0f * xfregs.viewport.wd);
+ float Height = EFBToScaledYf(-2.0f * xfregs.viewport.ht);
+ float GLNear = (xfregs.viewport.farZ - xfregs.viewport.zRange) / 16777216.0f;
+ float GLFar = xfregs.viewport.farZ / 16777216.0f;
if (Width < 0)
{
X += Width;
@@ -1122,11 +1137,15 @@ void Renderer::UpdateViewport(Matrix44& vpCorrection)
Height *= -1;
}
- // OpenGL does not require any viewport correct
- Matrix44::LoadIdentity(vpCorrection);
-
// Update the view port
- glViewport(X, Y, Width, Height);
+ if(g_ogl_config.bSupportViewportFloat)
+ {
+ glViewportIndexedf(0, X, Y, Width, Height);
+ }
+ else
+ {
+ glViewport(ceil(X), ceil(Y), ceil(Width), ceil(Height));
+ }
glDepthRangef(GLNear, GLFar);
}
@@ -1182,10 +1201,10 @@ void Renderer::SetBlendMode(bool forceUpdate)
// Our render target always uses an alpha channel, so we need to override the blend functions to assume a destination alpha of 1 if the render target isn't supposed to have an alpha channel
// Example: D3DBLEND_DESTALPHA needs to be D3DBLEND_ONE since the result without an alpha channel is assumed to always be 1.
bool target_has_alpha = bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
-
+
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && target_has_alpha;
bool useDualSource = useDstAlpha && g_ActiveConfig.backend_info.bSupportsDualSourceBlend;
-
+
const GLenum glSrcFactors[8] =
{
GL_ZERO,
@@ -1239,7 +1258,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
// subtract enable change
GLenum equation = newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD;
GLenum equationAlpha = useDualSource ? GL_FUNC_ADD : equation;
-
+
glBlendEquationSeparate(equation, equationAlpha);
}
@@ -1255,7 +1274,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
{
srcidx = GX_BL_ONE;
dstidx = GX_BL_ZERO;
- }
+ }
else
{
// we can't use GL_DST_COLOR or GL_ONE_MINUS_DST_COLOR for source in alpha channel so use their alpha equivalent instead
@@ -1265,7 +1284,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
// we can't use GL_SRC_COLOR or GL_ONE_MINUS_SRC_COLOR for destination in alpha channel so use their alpha equivalent instead
if (dstidx == GX_BL_SRCCLR) dstidx = GX_BL_SRCALPHA;
if (dstidx == GX_BL_INVSRCCLR) dstidx = GX_BL_INVSRCALPHA;
- }
+ }
GLenum srcFactorAlpha = glSrcFactors[srcidx];
GLenum dstFactorAlpha = glDestFactors[dstidx];
// blend RGB change
@@ -1314,7 +1333,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
int tmp = flipped_trc.top;
flipped_trc.top = flipped_trc.bottom;
flipped_trc.bottom = tmp;
-
+
GL_REPORT_ERRORD();
// Copy the framebuffer to screen.
@@ -1325,7 +1344,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
{
// Render to the real/postprocessing buffer now.
PostProcessing::BindTargetFramebuffer();
-
+
// draw each xfb source
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
@@ -1348,12 +1367,12 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
int xfbHeight = xfbSource->srcHeight;
int xfbWidth = xfbSource->srcWidth;
int hOffset = ((s32)xfbSource->srcAddr - (s32)xfbAddr) / ((s32)fbWidth * 2);
-
+
drawRc.top = flipped_trc.top - hOffset * flipped_trc.GetHeight() / fbHeight;
drawRc.bottom = flipped_trc.top - (hOffset + xfbHeight) * flipped_trc.GetHeight() / fbHeight;
drawRc.left = flipped_trc.left + (flipped_trc.GetWidth() - xfbWidth * flipped_trc.GetWidth() / fbWidth)/2;
drawRc.right = flipped_trc.left + (flipped_trc.GetWidth() + xfbWidth * flipped_trc.GetWidth() / fbWidth)/2;
-
+
// The following code disables auto stretch. Kept for reference.
// scale draw area for a 1 to 1 pixel mapping with the draw target
//float vScale = (float)fbHeight / (float)flipped_trc.GetHeight();
@@ -1378,22 +1397,22 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
else
{
TargetRectangle targetRc = ConvertEFBRectangle(rc);
-
+
// for msaa mode, we must resolve the efb content to non-msaa
FramebufferManager::ResolveAndGetRenderTarget(rc);
-
+
// Render to the real/postprocessing buffer now. (resolve have changed this in msaa mode)
PostProcessing::BindTargetFramebuffer();
-
+
// always the non-msaa fbo
GLuint fb = s_MSAASamples>1?FramebufferManager::GetResolvedFramebuffer():FramebufferManager::GetEFBFramebuffer();
-
+
glBindFramebuffer(GL_READ_FRAMEBUFFER, fb);
glBlitFramebuffer(targetRc.left, targetRc.bottom, targetRc.right, targetRc.top,
flipped_trc.left, flipped_trc.bottom, flipped_trc.right, flipped_trc.top,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
-
+
PostProcessing::BlitToScreen();
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
@@ -1447,7 +1466,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
#ifndef _WIN32
FlipImageData(&frame_data[0], w, h);
#endif
-
+
AVIDump::AddFrame(&frame_data[0], w, h);
}
@@ -1546,7 +1565,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
ApplySSAASettings();
-
+
delete g_framebuffer_manager;
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
s_MSAASamples, s_MSAACoverageSamples);
@@ -1655,16 +1674,16 @@ void Renderer::RestoreAPIState()
SetDepthMode();
SetBlendMode(true);
SetLogicOpMode();
- VertexShaderManager::SetViewportChanged();
+ UpdateViewport();
#ifndef USE_GLES3
glPolygonMode(GL_FRONT_AND_BACK, g_ActiveConfig.bWireFrame ? GL_LINE : GL_FILL);
#endif
-
+
VertexManager *vm = (OGL::VertexManager*)g_vertex_manager;
glBindBuffer(GL_ARRAY_BUFFER, vm->m_vertex_buffers);
vm->m_last_vao = 0;
-
+
TextureCache::SetStage();
}
@@ -1772,7 +1791,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
auto const& tex = bpmem.tex[texindex];
auto const& tm0 = tex.texMode0[stage];
auto const& tm1 = tex.texMode1[stage];
-
+
g_sampler_cache->SetSamplerState((texindex * 4) + stage, tm0, tm1);
}
diff --git a/Source/Core/VideoBackends/OGL/Src/Render.h b/Source/Core/VideoBackends/OGL/Src/Render.h
index 8c6a8ca8f8..9b4838ee25 100644
--- a/Source/Core/VideoBackends/OGL/Src/Render.h
+++ b/Source/Core/VideoBackends/OGL/Src/Render.h
@@ -27,12 +27,13 @@ extern struct VideoConfig {
bool bSupportSampleShading;
GLSL_VERSION eSupportedGLSLVersion;
bool bSupportOGL31;
-
+ bool bSupportViewportFloat;
+
const char *gl_vendor;
const char *gl_renderer;
const char* gl_version;
const char* glsl_version;
-
+
s32 max_samples;
} g_ogl_config;
@@ -41,43 +42,43 @@ class Renderer : public ::Renderer
public:
Renderer();
~Renderer();
-
+
static void Init();
static void Shutdown();
- void SetColorMask();
- void SetBlendMode(bool forceUpdate);
- void SetScissorRect(const TargetRectangle& rc);
- void SetGenerationMode();
- void SetDepthMode();
- void SetLogicOpMode();
- void SetDitherMode();
- void SetLineWidth();
- void SetSamplerState(int stage,int texindex);
- void SetInterlacingMode();
+ void SetColorMask() override;
+ void SetBlendMode(bool forceUpdate) override;
+ void SetScissorRect(const TargetRectangle& rc) override;
+ void SetGenerationMode() override;
+ void SetDepthMode() override;
+ void SetLogicOpMode() override;
+ void SetDitherMode() override;
+ void SetLineWidth() override;
+ void SetSamplerState(int stage,int texindex) override;
+ void SetInterlacingMode() override;
// TODO: Implement and use these
- void ApplyState(bool bUseDstAlpha) {}
- void RestoreState() {}
+ void ApplyState(bool bUseDstAlpha) override {}
+ void RestoreState() override {}
- void RenderText(const char* pstr, int left, int top, u32 color);
+ void RenderText(const char* pstr, int left, int top, u32 color) override;
void DrawDebugInfo();
void FlipImageData(u8 *data, int w, int h);
- u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data);
+ u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
- void ResetAPIState();
- void RestoreAPIState();
+ void ResetAPIState() override;
+ void RestoreAPIState() override;
- TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc);
+ TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc) override;
- void Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc,float Gamma);
+ void Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc,float Gamma) override;
- void ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z);
+ void ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) override;
- void ReinterpretPixelData(unsigned int convtype);
+ void ReinterpretPixelData(unsigned int convtype) override;
- void UpdateViewport(Matrix44& vpCorrection);
+ void UpdateViewport() override;
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
diff --git a/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp b/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
index 713b0e21fa..8419777fae 100644
--- a/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
@@ -30,18 +30,18 @@ void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode
m_last_max_anisotropy = g_ActiveConfig.iMaxAnisotropy;
Clear();
}
-
+
Params params(tm0, tm1);
-
+
// take equivalent forced linear when bForceFiltering
if (g_ActiveConfig.bForceFiltering)
{
params.tm0.min_filter |= 0x4;
params.tm0.mag_filter |= 0x1;
}
-
+
// TODO: Should keep a circular buffer for each stage of recently used samplers.
-
+
auto& active_sampler = m_active_samplers[stage];
if (active_sampler.first != params || !active_sampler.second.sampler_id)
{
@@ -60,11 +60,11 @@ auto SamplerCache::GetEntry(const Params& params) -> Value&
// Sampler not found in cache, create it.
glGenSamplers(1, &val.sampler_id);
SetParameters(val.sampler_id, params);
-
+
// TODO: Maybe kill old samplers if the cache gets huge. It doesn't seem to get huge though.
//ERROR_LOG(VIDEO, "Sampler cache size is now %ld.", m_cache.size());
}
-
+
return val;
}
@@ -81,7 +81,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
GL_LINEAR_MIPMAP_LINEAR,
GL_LINEAR,
};
-
+
static const GLint wrap_settings[4] =
{
GL_CLAMP_TO_EDGE,
@@ -89,7 +89,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
GL_MIRRORED_REPEAT,
GL_REPEAT,
};
-
+
auto& tm0 = params.tm0;
auto& tm1 = params.tm1;
@@ -98,7 +98,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
glSamplerParameteri(sampler_id, GL_TEXTURE_WRAP_S, wrap_settings[tm0.wrap_s]);
glSamplerParameteri(sampler_id, GL_TEXTURE_WRAP_T, wrap_settings[tm0.wrap_t]);
-
+
glSamplerParameterf(sampler_id, GL_TEXTURE_MIN_LOD, tm1.min_lod / 16.f);
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_LOD, tm1.max_lod / 16.f);
@@ -112,9 +112,9 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
void SamplerCache::Clear()
{
- for (auto it = m_cache.begin(); it != m_cache.end(); ++it)
+ for (auto& p : m_cache)
{
- glDeleteSamplers(1, &it->second.sampler_id);
+ glDeleteSamplers(1, &p.second.sampler_id);
}
m_cache.clear();
}
diff --git a/Source/Core/VideoBackends/OGL/Src/SamplerCache.h b/Source/Core/VideoBackends/OGL/Src/SamplerCache.h
index 81180d2a7a..4de716b27d 100644
--- a/Source/Core/VideoBackends/OGL/Src/SamplerCache.h
+++ b/Source/Core/VideoBackends/OGL/Src/SamplerCache.h
@@ -15,10 +15,10 @@ class SamplerCache : NonCopyable
public:
SamplerCache();
~SamplerCache();
-
+
void SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1);
void Clear();
-
+
private:
struct Params
{
@@ -29,47 +29,47 @@ private:
TexMode0 tm0;
TexMode1 tm1;
};
-
+
u64 hex;
};
-
+
Params()
: hex()
{}
-
+
Params(const TexMode0& _tm0, const TexMode1& _tm1)
: tm0(_tm0)
, tm1(_tm1)
{
static_assert(sizeof(Params) == 8, "Assuming I can treat this as a 64bit int.");
}
-
+
bool operator<(const Params& other) const
{
return hex < other.hex;
}
-
+
bool operator!=(const Params& other) const
{
return hex != other.hex;
}
};
-
+
struct Value
{
Value()
: sampler_id()
{}
-
+
GLuint sampler_id;
};
-
+
void SetParameters(GLuint sampler_id, const Params& params);
Value& GetEntry(const Params& params);
std::map<Params, Value> m_cache;
std::pair<Params, Value> m_active_samplers[8];
-
+
int m_last_max_anisotropy;
};
diff --git a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp
index 59d8a1b3ca..9826033098 100644
--- a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.cpp
@@ -20,9 +20,9 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
: m_uploadtype(uploadType), m_buffertype(type), m_size(size)
{
glGenBuffers(1, &m_buffer);
-
+
bool nvidia = !strcmp(g_ogl_config.gl_vendor, "NVIDIA Corporation");
-
+
if(m_uploadtype & STREAM_DETECT)
{
// TODO: move this to InitBackendInfo
@@ -32,8 +32,8 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
g_ActiveConfig.bHackedBufferUpload = false;
g_Config.bHackedBufferUpload = false;
}
-
- if(!g_ogl_config.bSupportsGLBaseVertex && (m_uploadtype & BUFFERSUBDATA)
+
+ if(!g_ogl_config.bSupportsGLBaseVertex && (m_uploadtype & BUFFERSUBDATA)
&& !DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTREAM))
m_uploadtype = BUFFERSUBDATA;
else if(!g_ogl_config.bSupportsGLBaseVertex && (m_uploadtype & BUFFERDATA))
@@ -46,7 +46,7 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
m_uploadtype = BUFFERSUBDATA;
else if(g_ogl_config.bSupportsGLSync && (m_uploadtype & MAP_AND_SYNC))
m_uploadtype = MAP_AND_SYNC;
- else
+ else
m_uploadtype = MAP_AND_ORPHAN;
}
@@ -69,7 +69,7 @@ void StreamBuffer::Alloc ( size_t size, u32 stride )
m_iterator_aligned = m_iterator_aligned - (m_iterator_aligned % stride) + stride;
}
size_t iter_end = m_iterator_aligned + size;
-
+
switch(m_uploadtype) {
case MAP_AND_ORPHAN:
if(iter_end >= m_size) {
@@ -79,14 +79,14 @@ void StreamBuffer::Alloc ( size_t size, u32 stride )
break;
case MAP_AND_SYNC:
case PINNED_MEMORY:
-
+
// insert waiting slots for used memory
for(u32 i=SLOT(m_used_iterator); i<SLOT(m_iterator); i++)
{
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
}
m_used_iterator = m_iterator;
-
+
// wait for new slots to end of buffer
for(u32 i=SLOT(m_free_iterator)+1; i<=SLOT(iter_end) && i < SYNC_POINTS; i++)
{
@@ -94,18 +94,18 @@ void StreamBuffer::Alloc ( size_t size, u32 stride )
glDeleteSync(fences[i]);
}
m_free_iterator = iter_end;
-
+
// if buffer is full
if(iter_end >= m_size) {
-
+
// insert waiting slots in unused space at the end of the buffer
for(u32 i=SLOT(m_used_iterator); i < SYNC_POINTS; i++)
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
-
+
// move to the start
m_used_iterator = m_iterator_aligned = m_iterator = 0; // offset 0 is always aligned
iter_end = size;
-
+
// wait for space at the start
for(u32 i=0; i<=SLOT(iter_end); i++)
{
@@ -114,7 +114,7 @@ void StreamBuffer::Alloc ( size_t size, u32 stride )
}
m_free_iterator = iter_end;
}
-
+
break;
case MAP_AND_RISK:
if(iter_end >= m_size) {
@@ -170,13 +170,13 @@ void StreamBuffer::Init()
m_iterator = 0;
m_used_iterator = 0;
m_free_iterator = 0;
-
+
switch(m_uploadtype) {
case MAP_AND_SYNC:
fences = new GLsync[SYNC_POINTS];
for(u32 i=0; i<SYNC_POINTS; i++)
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
-
+
case MAP_AND_ORPHAN:
case BUFFERSUBDATA:
glBindBuffer(m_buffertype, m_buffer);
@@ -187,13 +187,13 @@ void StreamBuffer::Init()
fences = new GLsync[SYNC_POINTS];
for(u32 i=0; i<SYNC_POINTS; i++)
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
-
+
pointer = (u8*)AllocateAlignedMemory(ROUND_UP(m_size,ALIGN_PINNED_MEMORY), ALIGN_PINNED_MEMORY );
glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, m_buffer);
glBufferData(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, ROUND_UP(m_size,ALIGN_PINNED_MEMORY), pointer, GL_STREAM_COPY);
glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, 0);
glBindBuffer(m_buffertype, m_buffer);
-
+
// on error, switch to another backend. some old catalyst seems to have broken pinned memory support
if(glGetError() != GL_NO_ERROR) {
ERROR_LOG(VIDEO, "Pinned memory detected, but not working. Please report this: %s, %s, %s", g_ogl_config.gl_vendor, g_ogl_config.gl_renderer, g_ogl_config.gl_version);
diff --git a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.h b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.h
index c0d6efc574..37472dc28a 100644
--- a/Source/Core/VideoBackends/OGL/Src/StreamBuffer.h
+++ b/Source/Core/VideoBackends/OGL/Src/StreamBuffer.h
@@ -33,17 +33,17 @@ class StreamBuffer {
public:
StreamBuffer(u32 type, size_t size, StreamType uploadType = DETECT_MASK);
~StreamBuffer();
-
+
void Alloc(size_t size, u32 stride = 0);
size_t Upload(u8 *data, size_t size);
-
+
u32 getBuffer() { return m_buffer; }
-
+
private:
void Init();
void Shutdown();
void DeleteFences();
-
+
StreamType m_uploadtype;
u32 m_buffer;
u32 m_buffertype;
diff --git a/Source/Core/VideoBackends/OGL/Src/TextureCache.cpp b/Source/Core/VideoBackends/OGL/Src/TextureCache.cpp
index c3349f5f2c..41c52ec724 100644
--- a/Source/Core/VideoBackends/OGL/Src/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/TextureCache.cpp
@@ -30,14 +30,12 @@
#include "ImageWrite.h"
#include "MemoryUtil.h"
#include "ProgramShaderCache.h"
-#include "PixelShaderManager.h"
#include "Render.h"
#include "Statistics.h"
#include "StringUtil.h"
#include "TextureCache.h"
#include "TextureConverter.h"
#include "TextureDecoder.h"
-#include "VertexShaderManager.h"
#include "VideoConfig.h"
namespace OGL
@@ -90,9 +88,9 @@ TextureCache::TCacheEntry::~TCacheEntry()
{
if (texture)
{
- for(int i=0; i<8; i++)
- if(s_Textures[i] == texture)
- s_Textures[i] = 0;
+ for(auto& gtex : s_Textures)
+ if(gtex == texture)
+ gtex = 0;
glDeleteTextures(1, &texture);
texture = 0;
}
@@ -121,7 +119,7 @@ void TextureCache::TCacheEntry::Bind(unsigned int stage)
glActiveTexture(GL_TEXTURE0 + stage);
s_ActiveTexture = stage;
}
-
+
glBindTexture(GL_TEXTURE_2D, texture);
s_Textures[stage] = texture;
}
@@ -150,7 +148,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
{
default:
case PC_TEX_FMT_NONE:
- PanicAlert("Invalid PC texture format %i", pcfmt);
+ PanicAlert("Invalid PC texture format %i", pcfmt);
case PC_TEX_FMT_BGRA32:
gl_format = GL_BGRA;
gl_iformat = GL_RGBA;
@@ -202,7 +200,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
entry.pcfmt = pcfmt;
entry.m_tex_levels = tex_levels;
-
+
entry.Load(width, height, expanded_width, 0);
return &entry;
@@ -266,7 +264,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateRenderTargetTexture(
glTexImage2D(GL_TEXTURE_2D, 0, gl_iformat, scaled_tex_w, scaled_tex_h, 0, gl_format, gl_type, NULL);
glBindTexture(GL_TEXTURE_2D, 0);
-
+
glGenFramebuffers(1, &entry->framebuffer);
FramebufferManager::SetFramebuffer(entry->framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, entry->texture, 0);
@@ -357,7 +355,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
glBindBuffer(GL_ARRAY_BUFFER, vbo_it->second.vbo);
glBufferData(GL_ARRAY_BUFFER, 4*4*sizeof(GLfloat), vertices, GL_STREAM_DRAW);
-
+
vbo_it->second.targetSource = targetSource;
}
@@ -372,10 +370,10 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
int encoded_size = TextureConverter::EncodeToRamFromTexture(
addr,
read_texture,
- srcFormat == PIXELFMT_Z24,
- isIntensity,
- dstFormat,
- scaleByHalf,
+ srcFormat == PIXELFMT_Z24,
+ isIntensity,
+ dstFormat,
+ scaleByHalf,
srcRect);
u8* dst = Memory::GetPointer(addr);
@@ -391,7 +389,6 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
}
FramebufferManager::SetFramebuffer(0);
- VertexShaderManager::SetViewportChanged();
GL_REPORT_ERRORD();
@@ -407,7 +404,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
TextureCache::TextureCache()
{
- const char *pColorMatrixProg =
+ const char *pColorMatrixProg =
"uniform sampler2DRect samp9;\n"
"uniform vec4 colmat[7];\n"
"VARYIN vec2 uv0;\n"
@@ -452,8 +449,8 @@ TextureCache::TextureCache()
s_ActiveTexture = -1;
s_NextStage = -1;
- for(int i=0; i<8; i++)
- s_Textures[i] = -1;
+ for(auto& gtex : s_Textures)
+ gtex = -1;
}
@@ -461,10 +458,10 @@ TextureCache::~TextureCache()
{
s_ColorMatrixProgram.Destroy();
s_DepthMatrixProgram.Destroy();
-
- for(std::map<u64, VBOCache>::iterator it = s_VBO.begin(); it != s_VBO.end(); it++) {
- glDeleteBuffers(1, &it->second.vbo);
- glDeleteVertexArrays(1, &it->second.vao);
+
+ for(auto& cache : s_VBO) {
+ glDeleteBuffers(1, &cache.second.vbo);
+ glDeleteVertexArrays(1, &cache.second.vao);
}
s_VBO.clear();
}
diff --git a/Source/Core/VideoBackends/OGL/Src/TextureCache.h b/Source/Core/VideoBackends/OGL/Src/TextureCache.h
index 137d26704b..1c95d35f98 100644
--- a/Source/Core/VideoBackends/OGL/Src/TextureCache.h
+++ b/Source/Core/VideoBackends/OGL/Src/TextureCache.h
@@ -45,23 +45,23 @@ private:
~TCacheEntry();
void Load(unsigned int width, unsigned int height,
- unsigned int expanded_width, unsigned int level);
+ unsigned int expanded_width, unsigned int level) override;
void FromRenderTarget(u32 dstAddr, unsigned int dstFormat,
unsigned int srcFormat, const EFBRectangle& srcRect,
bool isIntensity, bool scaleByHalf, unsigned int cbufid,
- const float *colmat);
+ const float *colmat) override;
- void Bind(unsigned int stage);
+ void Bind(unsigned int stage) override;
bool Save(const char filename[], unsigned int level);
};
~TextureCache();
TCacheEntryBase* CreateTexture(unsigned int width, unsigned int height,
- unsigned int expanded_width, unsigned int tex_levels, PC_TexFormat pcfmt);
+ unsigned int expanded_width, unsigned int tex_levels, PC_TexFormat pcfmt) override;
- TCacheEntryBase* CreateRenderTargetTexture(unsigned int scaled_tex_w, unsigned int scaled_tex_h);
+ TCacheEntryBase* CreateRenderTargetTexture(unsigned int scaled_tex_w, unsigned int scaled_tex_h) override;
};
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int virtual_width, int virtual_height, unsigned int level);
diff --git a/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp
index d4ce2eb5bb..0c1800381e 100644
--- a/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/TextureConverter.cpp
@@ -9,7 +9,6 @@
#include "TextureConversionShader.h"
#include "TextureCache.h"
#include "ProgramShaderCache.h"
-#include "VertexShaderManager.h"
#include "FramebufferManager.h"
#include "Globals.h"
#include "VideoConfig.h"
@@ -170,7 +169,7 @@ void Init()
glBindTexture(GL_TEXTURE_2D, s_dstTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, renderBufferWidth, renderBufferHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-
+
CreatePrograms();
}
@@ -187,8 +186,8 @@ void Shutdown()
s_rgbToYuyvProgram.Destroy();
s_yuyvToRgbProgram.Destroy();
- for (unsigned int i = 0; i < NUM_ENCODING_PROGRAMS; i++)
- s_encodingPrograms[i].Destroy();
+ for (auto& program : s_encodingPrograms)
+ program.Destroy();
s_srcTexture = 0;
s_dstTexture = 0;
@@ -230,7 +229,7 @@ void EncodeToRamUsingShader(GLuint srcTexture, const TargetRectangle& sourceRc,
GL_REPORT_ERRORD();
if(!(s_cached_sourceRc == sourceRc)) {
GLfloat vertices[] = {
- -1.f, -1.f,
+ -1.f, -1.f,
(float)sourceRc.left, (float)sourceRc.top,
-1.f, 1.f,
(float)sourceRc.left, (float)sourceRc.bottom,
@@ -241,13 +240,13 @@ void EncodeToRamUsingShader(GLuint srcTexture, const TargetRectangle& sourceRc,
};
glBindBuffer(GL_ARRAY_BUFFER, s_encode_VBO );
glBufferData(GL_ARRAY_BUFFER, 4*4*sizeof(GLfloat), vertices, GL_STREAM_DRAW);
-
+
s_cached_sourceRc = sourceRc;
- }
+ }
glBindVertexArray( s_encode_VAO );
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
+
GL_REPORT_ERRORD();
// .. and then read back the results.
@@ -304,16 +303,16 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
int size_in_bytes = TexDecoder_GetTextureSizeInBytes(width, height, format);
u16 blkW = TexDecoder_GetBlockWidthInTexels(format) - 1;
- u16 blkH = TexDecoder_GetBlockHeightInTexels(format) - 1;
- u16 samples = TextureConversionShader::GetEncodedSampleCount(format);
+ u16 blkH = TexDecoder_GetBlockHeightInTexels(format) - 1;
+ u16 samples = TextureConversionShader::GetEncodedSampleCount(format);
// only copy on cache line boundaries
// extra pixels are copied but not displayed in the resulting texture
s32 expandedWidth = (width + blkW) & (~blkW);
s32 expandedHeight = (height + blkH) & (~blkH);
-
+
float sampleStride = bScaleByHalf ? 2.f : 1.f;
-
+
float params[] = {
Renderer::EFBToScaledXf(sampleStride), Renderer::EFBToScaledYf(sampleStride),
0.0f, 0.0f,
@@ -345,12 +344,11 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* destAddr, int dstWidth, int dstHeight)
{
g_renderer->ResetAPIState();
-
+
s_rgbToYuyvProgram.Bind();
-
+
EncodeToRamUsingShader(srcTexture, sourceRc, destAddr, dstWidth / 2, dstHeight, 0, false, false);
FramebufferManager::SetFramebuffer(0);
- VertexShaderManager::SetViewportChanged();
TextureCache::DisableStage(0);
g_renderer->RestoreAPIState();
GL_REPORT_ERRORD();
@@ -401,7 +399,7 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
s_yuyvToRgbProgram.Bind();
GL_REPORT_ERRORD();
-
+
if(s_cached_srcHeight != srcHeight || s_cached_srcWidth != srcWidth) {
GLfloat vertices[] = {
1.f, -1.f,
@@ -413,20 +411,18 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
-1.f, 1.f,
0.f, 0.f
};
-
+
glBindBuffer(GL_ARRAY_BUFFER, s_decode_VBO );
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*4*4, vertices, GL_STREAM_DRAW);
-
+
s_cached_srcHeight = srcHeight;
s_cached_srcWidth = srcWidth;
}
-
+
glBindVertexArray( s_decode_VAO );
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- GL_REPORT_ERRORD();
- VertexShaderManager::SetViewportChanged();
+ GL_REPORT_ERRORD();
FramebufferManager::SetFramebuffer(0);
diff --git a/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp b/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
index 620df0c161..44d8ddeaa4 100644
--- a/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
@@ -60,10 +60,10 @@ void VertexManager::CreateDeviceObjects()
{
s_vertexBuffer = new StreamBuffer(GL_ARRAY_BUFFER, MAX_VBUFFER_SIZE);
m_vertex_buffers = s_vertexBuffer->getBuffer();
-
+
s_indexBuffer = new StreamBuffer(GL_ELEMENT_ARRAY_BUFFER, MAX_IBUFFER_SIZE);
m_index_buffers = s_indexBuffer->getBuffer();
-
+
m_CurrentVertexFmt = NULL;
m_last_vao = 0;
}
@@ -74,7 +74,7 @@ void VertexManager::DestroyDeviceObjects()
glBindBuffer(GL_ARRAY_BUFFER, 0 );
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0 );
GL_REPORT_ERROR();
-
+
delete s_vertexBuffer;
delete s_indexBuffer;
GL_REPORT_ERROR();
@@ -87,7 +87,7 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
u32 line_index_size = IndexGenerator::GetLineindexLen();
u32 point_index_size = IndexGenerator::GetPointindexLen();
u32 index_size = (triangle_index_size+line_index_size+point_index_size) * sizeof(u16);
-
+
s_vertexBuffer->Alloc(vertex_data_size, stride);
u32 offset = s_vertexBuffer->Upload(GetVertexBuffer(), vertex_data_size);
s_baseVertex = offset / stride;
@@ -105,7 +105,7 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
{
s_offset[2] = s_indexBuffer->Upload((u8*)GetPointIndexBuffer(), point_index_size * sizeof(u16));
}
-
+
ADDSTAT(stats.thisFrame.bytesVertexStreamed, vertex_data_size);
ADDSTAT(stats.thisFrame.bytesIndexStreamed, index_size);
}
@@ -117,7 +117,7 @@ void VertexManager::Draw(u32 stride)
u32 point_index_size = IndexGenerator::GetPointindexLen();
u32 max_index = IndexGenerator::GetNumVerts();
GLenum triangle_mode = g_ActiveConfig.backend_info.bSupportsPrimitiveRestart?GL_TRIANGLE_STRIP:GL_TRIANGLES;
-
+
if(g_ogl_config.bSupportsGLBaseVertex) {
if (triangle_index_size > 0)
{
@@ -134,7 +134,7 @@ void VertexManager::Draw(u32 stride)
glDrawRangeElementsBaseVertex(GL_POINTS, 0, max_index, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2], s_baseVertex);
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}
- }
+ }
else if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
{
if (triangle_index_size > 0)
@@ -168,17 +168,17 @@ void VertexManager::Draw(u32 stride)
glDrawRangeElements(GL_POINTS, 0, max_index, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2]);
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}
- }
+ }
}
void VertexManager::vFlush()
{
-#if defined(_DEBUG) || defined(DEBUGFAST)
+#if defined(_DEBUG) || defined(DEBUGFAST)
PRIM_LOG("frame%d:\n texgen=%d, numchan=%d, dualtex=%d, ztex=%d, cole=%d, alpe=%d, ze=%d", g_ActiveConfig.iSaveTargetId, xfregs.numTexGen.numTexGens,
xfregs.numChan.numColorChans, xfregs.dualTexTrans.enabled, bpmem.ztex2.op,
bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.zmode.updateenable);
- for (unsigned int i = 0; i < xfregs.numChan.numColorChans; ++i)
+ for (unsigned int i = 0; i < xfregs.numChan.numColorChans; ++i)
{
LitChannel* ch = &xfregs.color[i];
PRIM_LOG("colchan%d: matsrc=%d, light=0x%x, ambsrc=%d, diffunc=%d, attfunc=%d", i, ch->matsource, ch->GetFullLightMask(), ch->ambsource, ch->diffusefunc, ch->attnfunc);
@@ -186,7 +186,7 @@ void VertexManager::vFlush()
PRIM_LOG("alpchan%d: matsrc=%d, light=0x%x, ambsrc=%d, diffunc=%d, attfunc=%d", i, ch->matsource, ch->GetFullLightMask(), ch->ambsource, ch->diffusefunc, ch->attnfunc);
}
- for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
+ for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
{
TexMtxInfo tinfo = xfregs.texMtxInfo[i];
if (tinfo.texgentype != XF_TEXGEN_EMBOSS_MAP) tinfo.hex &= 0x7ff;
@@ -202,10 +202,10 @@ void VertexManager::vFlush()
#endif
(void)GL_REPORT_ERROR();
-
+
GLVertexFormat *nativeVertexFmt = (GLVertexFormat*)g_nativeVertexFmt;
u32 stride = nativeVertexFmt->GetVertexStride();
-
+
if(m_last_vao != nativeVertexFmt->VAO) {
glBindVertexArray(nativeVertexFmt->VAO);
m_last_vao = nativeVertexFmt->VAO;
@@ -231,10 +231,10 @@ void VertexManager::vFlush()
TextureCache::SetNextStage(i);
g_renderer->SetSamplerState(i % 4, i / 4);
FourTexUnits &tex = bpmem.tex[i >> 2];
- TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
+ TextureCache::TCacheEntryBase* tentry = TextureCache::Load(i,
(tex.texImage3[i&3].image_base/* & 0x1FFFFF*/) << 5,
tex.texImage0[i&3].width + 1, tex.texImage0[i&3].height + 1,
- tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
+ tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
tex.texTlut[i&3].tlut_format,
(tex.texMode0[i&3].min_filter & 3),
(tex.texMode1[i&3].max_lod + 0xf) / 0x10,
@@ -279,7 +279,7 @@ void VertexManager::vFlush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants(g_nativeVertexFmt->m_components);
ProgramShaderCache::UploadConstants();
-
+
// setup the pointers
if (g_nativeVertexFmt)
g_nativeVertexFmt->SetupVertexPointers();
@@ -300,24 +300,24 @@ void VertexManager::vFlush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants(g_nativeVertexFmt->m_components);
}
-
+
// only update alpha
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
glDisable(GL_BLEND);
Draw(stride);
-
+
// restore color mask
g_renderer->SetColorMask();
- if (bpmem.blendmode.blendenable || bpmem.blendmode.subtract)
+ if (bpmem.blendmode.blendenable || bpmem.blendmode.subtract)
glEnable(GL_BLEND);
}
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);
-
+
#if defined(_DEBUG) || defined(DEBUGFAST)
- if (g_ActiveConfig.iLog & CONF_SAVESHADERS)
+ if (g_ActiveConfig.iLog & CONF_SAVESHADERS)
{
// save the shaders
ProgramShaderCache::PCacheEntry prog = ProgramShaderCache::GetShaderProgram();
@@ -332,7 +332,7 @@ void VertexManager::vFlush()
fvs << prog.shader.strvprog.c_str();
}
- if (g_ActiveConfig.iLog & CONF_SAVETARGETS)
+ if (g_ActiveConfig.iLog & CONF_SAVETARGETS)
{
char str[128];
sprintf(str, "%starg%.3d.tga", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), g_ActiveConfig.iSaveTargetId);
diff --git a/Source/Core/VideoBackends/OGL/Src/VertexManager.h b/Source/Core/VideoBackends/OGL/Src/VertexManager.h
index e31c8d48ec..f96ec7ec97 100644
--- a/Source/Core/VideoBackends/OGL/Src/VertexManager.h
+++ b/Source/Core/VideoBackends/OGL/Src/VertexManager.h
@@ -19,9 +19,9 @@ namespace OGL
GLVertexFormat();
~GLVertexFormat();
- virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
- virtual void SetupVertexPointers();
-
+ virtual void Initialize(const PortableVertexDeclaration &_vtx_decl) override;
+ virtual void SetupVertexPointers() override;
+
GLuint VAO;
};
@@ -32,17 +32,17 @@ class VertexManager : public ::VertexManager
public:
VertexManager();
~VertexManager();
- NativeVertexFormat* CreateNativeVertexFormat();
- void CreateDeviceObjects();
- void DestroyDeviceObjects();
-
+ NativeVertexFormat* CreateNativeVertexFormat() override;
+ void CreateDeviceObjects() override;
+ void DestroyDeviceObjects() override;
+
// NativeVertexFormat use this
GLuint m_vertex_buffers;
- GLuint m_index_buffers;
+ GLuint m_index_buffers;
GLuint m_last_vao;
private:
void Draw(u32 stride);
- void vFlush();
+ void vFlush() override;
void PrepareDrawBuffers(u32 stride);
NativeVertexFormat *m_CurrentVertexFmt;
};
diff --git a/Source/Core/VideoBackends/OGL/Src/VideoBackend.h b/Source/Core/VideoBackends/OGL/Src/VideoBackend.h
index 137c09a973..ed4a748eb4 100644
--- a/Source/Core/VideoBackends/OGL/Src/VideoBackend.h
+++ b/Source/Core/VideoBackends/OGL/Src/VideoBackend.h
@@ -9,19 +9,19 @@ namespace OGL
class VideoBackend : public VideoBackendHardware
{
- bool Initialize(void *&);
- void Shutdown();
+ bool Initialize(void *&) override;
+ void Shutdown() override;
- std::string GetName();
- std::string GetDisplayName();
+ std::string GetName() override;
+ std::string GetDisplayName() override;
- void Video_Prepare();
- void Video_Cleanup();
+ void Video_Prepare() override;
+ void Video_Cleanup() override;
- void ShowConfig(void* parent);
+ void ShowConfig(void* parent) override;
- void UpdateFPSDisplay(const char*);
- unsigned int PeekMessages();
+ void UpdateFPSDisplay(const char*) override;
+ unsigned int PeekMessages() override;
};
}
diff --git a/Source/Core/VideoBackends/OGL/Src/main.cpp b/Source/Core/VideoBackends/OGL/Src/main.cpp
index b109fcdd8b..7ad18bca25 100644
--- a/Source/Core/VideoBackends/OGL/Src/main.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/main.cpp
@@ -5,7 +5,7 @@
// OpenGL Backend Documentation
-/*
+/*
1.1 Display settings
@@ -110,16 +110,16 @@ void GetShaders(std::vector<std::string> &shaders)
File::GetUserPath(D_SHADERS_IDX),
File::GetSysDirectory() + SHADERS_DIR DIR_SEP,
};
- for (size_t i = 0; i < ArraySize(directories); ++i)
+ for (auto& directory : directories)
{
- if (!File::IsDirectory(directories[i]))
+ if (!File::IsDirectory(directory))
continue;
File::FSTEntry entry;
- File::ScanDirectoryTree(directories[i], entry);
- for (u32 j = 0; j < entry.children.size(); j++)
+ File::ScanDirectoryTree(directory, entry);
+ for (auto& file : entry.children)
{
- std::string name = entry.children[j].virtualName.c_str();
+ std::string name = file.virtualName.c_str();
if (name.size() < 5)
continue;
if (strcasecmp(name.substr(name.size() - 5).c_str(), ".glsl"))
@@ -146,6 +146,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsFormatReinterpretation = true;
g_Config.backend_info.bSupportsPixelLighting = true;
//g_Config.backend_info.bSupportsEarlyZ = true; // is gpu dependent and must be set in renderer
+ g_Config.backend_info.bSupportsOversizedViewports = true;
// aamodes
const char* caamodes[] = {_trans("None"), "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA", "4x SSAA"};
@@ -181,7 +182,7 @@ bool VideoBackend::Initialize(void *&window_handle)
if (!GLInterface->Create(window_handle))
return false;
- // Do our OSD callbacks
+ // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT);
s_BackendInitialized = true;
@@ -232,14 +233,14 @@ void VideoBackend::Shutdown()
{
s_BackendInitialized = false;
- // Do our OSD callbacks
+ // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_SHUTDOWN);
GLInterface->Shutdown();
}
void VideoBackend::Video_Cleanup() {
-
+
if (g_renderer)
{
s_efbAccessRequested = false;
diff --git a/Source/Core/VideoBackends/OGL/Src/stdafx.h b/Source/Core/VideoBackends/OGL/Src/stdafx.h
index 2431184aaf..81bb44dc19 100644
--- a/Source/Core/VideoBackends/OGL/Src/stdafx.h
+++ b/Source/Core/VideoBackends/OGL/Src/stdafx.h
@@ -9,4 +9,4 @@
#endif
#include <tchar.h>
-#include <windows.h>
+#include <windows.h>
diff --git a/Source/Core/VideoBackends/Software/Software.vcxproj b/Source/Core/VideoBackends/Software/Software.vcxproj
index a87a05fac9..cd393dd437 100644
--- a/Source/Core/VideoBackends/Software/Software.vcxproj
+++ b/Source/Core/VideoBackends/Software/Software.vcxproj
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="DebugFast|Win32">
- <Configuration>DebugFast</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="DebugFast|x64">
- <Configuration>DebugFast</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -27,160 +19,61 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{9E9DA440-E9AD-413C-B648-91030E792211}</ProjectGuid>
- <RootNamespace>VideoSoftware</RootNamespace>
- <ProjectName>VideoSoftware</ProjectName>
+ <ProjectGuid>{A4C423AA-F57C-46C7-A172-D1A777017D29}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
- <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Debug.props" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_Release.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
- <Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="..\..\..\VSProps\Base.props" />
- <Import Project="..\..\..\VSProps\CodeGen_DebugFast.props" />
<Import Project="..\..\..\VSProps\PrecompiledHeader.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..\Common\Src;..\..\Core\Src;..\..\VideoCommon\Src;..\..\DolphinWX\Src;$(SolutionDir)..\Externals\GLew\include;$(SolutionDir)..\Externals\wxWidgets3;$(SolutionDir)..\Externals\wxWidgets3\Include;$(SolutionDir)..\Externals;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Src\BPMemLoader.cpp" />
<ClCompile Include="Src\Clipper.cpp" />
- <ClCompile Include="Src\SWCommandProcessor.cpp" />
<ClCompile Include="Src\CPMemLoader.cpp" />
<ClCompile Include="Src\DebugUtil.cpp" />
<ClCompile Include="Src\EfbCopy.cpp" />
<ClCompile Include="Src\EfbInterface.cpp" />
<ClCompile Include="Src\HwRasterizer.cpp" />
- <ClCompile Include="Src\SWmain.cpp" />
<ClCompile Include="Src\OpcodeDecoder.cpp" />
- <ClCompile Include="Src\SWPixelEngine.cpp" />
- <ClCompile Include="Src\Rasterizer.cpp" />
<ClCompile Include="Src\RasterFont.cpp" />
- <ClCompile Include="Src\SWRenderer.cpp" />
+ <ClCompile Include="Src\Rasterizer.cpp" />
<ClCompile Include="Src\SetupUnit.cpp" />
- <ClCompile Include="Src\SWStatistics.cpp" />
<ClCompile Include="Src\stdafx.cpp">
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="Src\SWCommandProcessor.cpp" />
+ <ClCompile Include="Src\SWmain.cpp" />
+ <ClCompile Include="Src\SWPixelEngine.cpp" />
+ <ClCompile Include="Src\SWRenderer.cpp" />
+ <ClCompile Include="Src\SWStatistics.cpp" />
+ <ClCompile Include="Src\SWVertexLoader.cpp" />
<ClCompile Include="Src\SWVideoConfig.cpp" />
<ClCompile Include="Src\Tev.cpp" />
<ClCompile Include="Src\TextureEncoder.cpp" />
<ClCompile Include="Src\TextureSampler.cpp" />
<ClCompile Include="Src\TransformUnit.cpp" />
- <ClCompile Include="Src\SWVertexLoader.cpp" />
<ClCompile Include="Src\VideoConfigDialog.cpp" />
<ClCompile Include="Src\XFMemLoader.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\BPMemLoader.h" />
<ClInclude Include="Src\Clipper.h" />
- <ClInclude Include="Src\SWCommandProcessor.h" />
<ClInclude Include="Src\CPMemLoader.h" />
<ClInclude Include="Src\DebugUtil.h" />
<ClInclude Include="Src\EfbCopy.h" />
@@ -188,30 +81,37 @@
<ClInclude Include="Src\HwRasterizer.h" />
<ClInclude Include="Src\NativeVertexFormat.h" />
<ClInclude Include="Src\OpcodeDecoder.h" />
- <ClInclude Include="Src\SWPixelEngine.h" />
- <ClInclude Include="Src\Rasterizer.h" />
<ClInclude Include="Src\RasterFont.h" />
- <ClInclude Include="Src\SWRenderer.h" />
+ <ClInclude Include="Src\Rasterizer.h" />
<ClInclude Include="Src\SetupUnit.h" />
- <ClInclude Include="Src\SWStatistics.h" />
<ClInclude Include="Src\stdafx.h" />
+ <ClInclude Include="Src\SWCommandProcessor.h" />
+ <ClInclude Include="Src\SWPixelEngine.h" />
+ <ClInclude Include="Src\SWRenderer.h" />
+ <ClInclude Include="Src\SWStatistics.h" />
+ <ClInclude Include="Src\SWVertexLoader.h" />
<ClInclude Include="Src\SWVideoConfig.h" />
<ClInclude Include="Src\Tev.h" />
<ClInclude Include="Src\TextureEncoder.h" />
<ClInclude Include="Src\TextureSampler.h" />
<ClInclude Include="Src\TransformUnit.h" />
<ClInclude Include="Src\Vec3.h" />
- <ClInclude Include="Src\SWVertexLoader.h" />
<ClInclude Include="Src\VideoBackend.h" />
<ClInclude Include="Src\VideoConfigDialog.h" />
<ClInclude Include="Src\XFMemLoader.h" />
</ItemGroup>
<ItemGroup>
- <None Include="CMakeLists.txt" />
+ <Text Include="CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\VideoCommon\VideoCommon.vcxproj">
- <Project>{3e5c4e02-1ba9-4776-bdbe-e3f91ffa34cf}</Project>
+ <ProjectReference Include="..\..\..\..\Externals\GLew\glew.vcxproj">
+ <Project>{2a3f751d-69e9-45f2-9199-9a00bfb6cc72}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\..\Externals\wxWidgets3\build\msw\wx_base.vcxproj">
+ <Project>{1c8436c9-dbaf-42be-83bc-cf3ec9175abe}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Core\VideoCommon\VideoCommon.vcxproj">
+ <Project>{3de9ee35-3e91-4f27-a014-2866ad8c3fe3}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/Source/Core/VideoBackends/Software/Software.vcxproj.filters b/Source/Core/VideoBackends/Software/Software.vcxproj.filters
deleted file mode 100644
index 14be6ff447..0000000000
--- a/Source/Core/VideoBackends/Software/Software.vcxproj.filters
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <ClCompile Include="Src\BPMemLoader.cpp" />
- <ClCompile Include="Src\Clipper.cpp" />
- <ClCompile Include="Src\SWCommandProcessor.cpp" />
- <ClCompile Include="Src\CPMemLoader.cpp" />
- <ClCompile Include="Src\DebugUtil.cpp" />
- <ClCompile Include="Src\EfbCopy.cpp" />
- <ClCompile Include="Src\EfbInterface.cpp" />
- <ClCompile Include="Src\HwRasterizer.cpp" />
- <ClCompile Include="Src\SWmain.cpp" />
- <ClCompile Include="Src\OpcodeDecoder.cpp" />
- <ClCompile Include="Src\SWPixelEngine.cpp" />
- <ClCompile Include="Src\Rasterizer.cpp" />
- <ClCompile Include="Src\RasterFont.cpp" />
- <ClCompile Include="Src\SWRenderer.cpp" />
- <ClCompile Include="Src\SetupUnit.cpp" />
- <ClCompile Include="Src\SWStatistics.cpp" />
- <ClCompile Include="Src\stdafx.cpp" />
- <ClCompile Include="Src\SWVideoConfig.cpp" />
- <ClCompile Include="Src\Tev.cpp" />
- <ClCompile Include="Src\TextureEncoder.cpp" />
- <ClCompile Include="Src\TextureSampler.cpp" />
- <ClCompile Include="Src\TransformUnit.cpp" />
- <ClCompile Include="Src\SWVertexLoader.cpp" />
- <ClCompile Include="Src\VideoConfigDialog.cpp" />
- <ClCompile Include="Src\XFMemLoader.cpp" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="Src\BPMemLoader.h" />
- <ClInclude Include="Src\Clipper.h" />
- <ClInclude Include="Src\SWCommandProcessor.h" />
- <ClInclude Include="Src\CPMemLoader.h" />
- <ClInclude Include="Src\DebugUtil.h" />
- <ClInclude Include="Src\EfbCopy.h" />
- <ClInclude Include="Src\EfbInterface.h" />
- <ClInclude Include="Src\HwRasterizer.h" />
- <ClInclude Include="Src\NativeVertexFormat.h" />
- <ClInclude Include="Src\OpcodeDecoder.h" />
- <ClInclude Include="Src\SWPixelEngine.h" />
- <ClInclude Include="Src\Rasterizer.h" />
- <ClInclude Include="Src\RasterFont.h" />
- <ClInclude Include="Src\SWRenderer.h" />
- <ClInclude Include="Src\SetupUnit.h" />
- <ClInclude Include="Src\SWStatistics.h" />
- <ClInclude Include="Src\stdafx.h" />
- <ClInclude Include="Src\SWVideoConfig.h" />
- <ClInclude Include="Src\Tev.h" />
- <ClInclude Include="Src\TextureEncoder.h" />
- <ClInclude Include="Src\TextureSampler.h" />
- <ClInclude Include="Src\TransformUnit.h" />
- <ClInclude Include="Src\Vec3.h" />
- <ClInclude Include="Src\SWVertexLoader.h" />
- <ClInclude Include="Src\VideoBackend.h" />
- <ClInclude Include="Src\VideoConfigDialog.h" />
- <ClInclude Include="Src\XFMemLoader.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="CMakeLists.txt" />
- </ItemGroup>
- <ItemGroup>
- <Filter Include="Win32">
- <UniqueIdentifier>{081288cb-a63b-4ae9-93eb-e668568520b8}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/Source/Core/VideoBackends/Software/Src/BPMemLoader.cpp b/Source/Core/VideoBackends/Software/Src/BPMemLoader.cpp
index 6317398f39..f6f810791d 100644
--- a/Source/Core/VideoBackends/Software/Src/BPMemLoader.cpp
+++ b/Source/Core/VideoBackends/Software/Src/BPMemLoader.cpp
@@ -97,7 +97,7 @@ void SWBPWritten(int address, int newvalue)
case BPMEM_LOADTLUT1: // Load a Texture Look Up Table
{
u32 tlutTMemAddr = (newvalue & 0x3FF) << 9;
- u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5;
+ u32 tlutXferCount = (newvalue & 0x1FFC00) >> 5;
u8 *ptr = 0;
diff --git a/Source/Core/VideoBackends/Software/Src/Clipper.cpp b/Source/Core/VideoBackends/Software/Src/Clipper.cpp
index ff71ee491d..6d6069b262 100644
--- a/Source/Core/VideoBackends/Software/Src/Clipper.cpp
+++ b/Source/Core/VideoBackends/Software/Src/Clipper.cpp
@@ -8,18 +8,18 @@ Copyright (c) 2007, 2008 Markus Trenkwalder
All rights reserved.
-Redistribution and use in source and binary forms, with or without
+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,
+* 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
+ this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of the library's copyright owner nor the names of its
- contributors may be used to endorse or promote products derived from this
+* Neither the name of the library's copyright owner 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
@@ -55,8 +55,8 @@ namespace Clipper
void DoState(PointerWrap &p)
{
p.DoArray(m_ViewOffset,2);
- for (int i = 0; i< NUM_CLIPPED_VERTICES; ++i)
- ClippedVertices[i].DoState(p);
+ for (auto& ClippedVertice : ClippedVertices)
+ ClippedVertice.DoState(p);
}
void Init()
@@ -190,7 +190,7 @@ namespace Clipper
inlist[1] = 1;
inlist[2] = 2;
- // mark this triangle as unused in case it should be completely
+ // mark this triangle as unused in case it should be completely
// clipped
indices[0] = SKIP_FLAG;
indices[1] = SKIP_FLAG;
@@ -229,13 +229,13 @@ namespace Clipper
mask |= clip_mask[i];
}
- if (mask == 0)
+ if (mask == 0)
return;
float t0 = 0;
float t1 = 0;
- // Mark unused in case of early termination
+ // Mark unused in case of early termination
// of the macros below. (When fully clipped)
indices[0] = SKIP_FLAG;
indices[1] = SKIP_FLAG;
@@ -247,7 +247,7 @@ namespace Clipper
LINE_CLIP(CLIP_POS_Z_BIT, 0, 0, -1, 1);
LINE_CLIP(CLIP_NEG_Z_BIT, 0, 0, 1, 1);
- // Restore the old values as this line
+ // Restore the old values as this line
// was not fully clipped.
indices[0] = 0;
indices[1] = 1;
@@ -305,7 +305,7 @@ namespace Clipper
PerspectiveDivide(Vertices[indices[i+1]]);
PerspectiveDivide(Vertices[indices[i+2]]);
- Rasterizer::DrawTriangleFrontFace(Vertices[indices[i]], Vertices[indices[i+1]], Vertices[indices[i+2]]);
+ Rasterizer::DrawTriangleFrontFace(Vertices[indices[i]], Vertices[indices[i+1]], Vertices[indices[i+2]]);
}
}
}
@@ -349,7 +349,7 @@ namespace Clipper
float dx = v1->screenPosition.x - v0->screenPosition.x;
float dy = v1->screenPosition.y - v0->screenPosition.y;
-
+
float screenDx = 0;
float screenDy = 0;
@@ -405,7 +405,7 @@ namespace Clipper
float w1 = v1->projectedPosition.w;
float w2 = v2->projectedPosition.w;
- float normalZDir = (x0*w2 - x2*w0)*y1 + (x2*y0 - x0*y2)*w1 + (y2*w0 - y0*w2)*x1;
+ float normalZDir = (x0*w2 - x2*w0)*y1 + (x2*y0 - x0*y2)*w1 + (y2*w0 - y0*w2)*x1;
backface = normalZDir <= 0.0f;
diff --git a/Source/Core/VideoBackends/Software/Src/DebugUtil.h b/Source/Core/VideoBackends/Software/Src/DebugUtil.h
index 89b0db9b72..3cbb318ffb 100644
--- a/Source/Core/VideoBackends/Software/Src/DebugUtil.h
+++ b/Source/Core/VideoBackends/Software/Src/DebugUtil.h
@@ -24,4 +24,4 @@ namespace DebugUtil
void CopyTempBuffer(s16 x, s16 y, int bufferBase, int subBuffer, const char *name);
}
-#endif
+#endif
diff --git a/Source/Core/VideoBackends/Software/Src/EfbCopy.cpp b/Source/Core/VideoBackends/Software/Src/EfbCopy.cpp
index 303d5a06ad..1191b3c6df 100644
--- a/Source/Core/VideoBackends/Software/Src/EfbCopy.cpp
+++ b/Source/Core/VideoBackends/Software/Src/EfbCopy.cpp
@@ -19,7 +19,7 @@ namespace EfbCopy
{
void CopyToXfb()
{
- GLInterface->Update(); // just updates the render window position and the backbuffer size
+ GLInterface->Update(); // just updates the render window position and the backbuffer size
if (!g_SWVideoConfig.bHwRasterizer)
{
diff --git a/Source/Core/VideoBackends/Software/Src/EfbInterface.cpp b/Source/Core/VideoBackends/Software/Src/EfbInterface.cpp
index 3d8ea0f9f1..f13f6a47b1 100644
--- a/Source/Core/VideoBackends/Software/Src/EfbInterface.cpp
+++ b/Source/Core/VideoBackends/Software/Src/EfbInterface.cpp
@@ -185,7 +185,7 @@ namespace EfbInterface
u32 *dst = (u32*)&efb[offset];
u32 val = *dst & 0xff000000;
val |= depth & 0x00ffffff;
- *dst = val;
+ *dst = val;
}
break;
case PIXELFMT_RGB565_Z16:
@@ -194,7 +194,7 @@ namespace EfbInterface
u32 *dst = (u32*)&efb[offset];
u32 val = *dst & 0xff000000;
val |= depth & 0x00ffffff;
- *dst = val;
+ *dst = val;
}
break;
default:
diff --git a/Source/Core/VideoBackends/Software/Src/HwRasterizer.cpp b/Source/Core/VideoBackends/Software/Src/HwRasterizer.cpp
index 5e3e4a4ae0..996b440dc4 100644
--- a/Source/Core/VideoBackends/Software/Src/HwRasterizer.cpp
+++ b/Source/Core/VideoBackends/Software/Src/HwRasterizer.cpp
@@ -130,7 +130,7 @@ namespace HwRasterizer
glDepthFunc(GL_LEQUAL);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
+
CreateShaders();
GL_REPORT_ERRORD();
}
@@ -141,7 +141,7 @@ namespace HwRasterizer
u32 imageAddr = texUnit.texImage3[0].image_base;
// Texture Rectangle uses pixel coordinates
// While GLES uses texture coordinates
-#ifdef USE_GLES
+#ifdef USE_GLES
width = texUnit.texImage0[0].width;
height = texUnit.texImage0[0].height;
#else
@@ -303,7 +303,7 @@ namespace HwRasterizer
{
glUseProgram(clearProg);
glVertexAttribPointer(clear_apos, 3, GL_FLOAT, GL_FALSE, 0, verts);
- glUniform4f(clear_ucol, r, g, b, a);
+ glUniform4f(clear_ucol, r, g, b, a);
glEnableVertexAttribArray(col_apos);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glDisableVertexAttribArray(col_apos);
diff --git a/Source/Core/VideoBackends/Software/Src/HwRasterizer.h b/Source/Core/VideoBackends/Software/Src/HwRasterizer.h
index ac0892841f..c3af17cec2 100644
--- a/Source/Core/VideoBackends/Software/Src/HwRasterizer.h
+++ b/Source/Core/VideoBackends/Software/Src/HwRasterizer.h
@@ -28,10 +28,10 @@ namespace HwRasterizer
struct TexCacheEntry
{
- TexImage0 texImage0;
- TexImage1 texImage1;
- TexImage2 texImage2;
- TexImage3 texImage3;
+ TexImage0 texImage0;
+ TexImage1 texImage1;
+ TexImage2 texImage2;
+ TexImage3 texImage3;
TexTLUT texTlut;
GLuint texture;
@@ -47,4 +47,4 @@ namespace HwRasterizer
static TextureCache textures;
}
-#endif
+#endif
diff --git a/Source/Core/VideoBackends/Software/Src/NativeVertexFormat.h b/Source/Core/VideoBackends/Software/Src/NativeVertexFormat.h
index 2f0213d469..9f9610910a 100644
--- a/Source/Core/VideoBackends/Software/Src/NativeVertexFormat.h
+++ b/Source/Core/VideoBackends/Software/Src/NativeVertexFormat.h
@@ -85,11 +85,11 @@ struct OutputVertexData
mvPosition.DoState(p);
p.Do(projectedPosition);
screenPosition.DoState(p);
- for (int i = 0; i < 3;++i)
- normal[i].DoState(p);
+ for (auto& vec : normal)
+ vec.DoState(p);
p.DoArray(color, sizeof color);
- for (int i = 0; i < 8;++i)
- texCoords[i].DoState(p);
+ for (auto& vec : texCoords)
+ vec.DoState(p);
}
};
diff --git a/Source/Core/VideoBackends/Software/Src/OpcodeDecoder.cpp b/Source/Core/VideoBackends/Software/Src/OpcodeDecoder.cpp
index 7c3408a316..21f0a97abd 100644
--- a/Source/Core/VideoBackends/Software/Src/OpcodeDecoder.cpp
+++ b/Source/Core/VideoBackends/Software/Src/OpcodeDecoder.cpp
@@ -82,7 +82,7 @@ void DecodePrimitiveStream(u32 iBufferSize)
void ReadXFData(u32 iBufferSize)
{
- _assert_msg_(VIDEO, iBufferSize >= (u32)(streamSize * 4), "Underflow during standard opcode decoding");
+ _assert_msg_(VIDEO, iBufferSize >= (u32)(streamSize * 4), "Underflow during standard opcode decoding");
u32 pData[16];
for (int i = 0; i < streamSize; i++)
@@ -109,7 +109,7 @@ void ExecuteDisplayList(u32 addr, u32 count)
u32 readCount = (u32)(g_pVideoData - dlStart);
dlStart = g_pVideoData;
- _assert_msg_(VIDEO, count >= readCount, "Display list underrun");
+ _assert_msg_(VIDEO, count >= readCount, "Display list underrun");
count -= readCount;
}
@@ -119,7 +119,7 @@ void ExecuteDisplayList(u32 addr, u32 count)
void DecodeStandard(u32 bufferSize)
{
- _assert_msg_(VIDEO, CommandRunnable(bufferSize), "Underflow during standard opcode decoding");
+ _assert_msg_(VIDEO, CommandRunnable(bufferSize), "Underflow during standard opcode decoding");
int Cmd = DataReadU8();
@@ -191,7 +191,7 @@ void DecodeStandard(u32 bufferSize)
// zelda 4 swords calls it and checks the metrics registers after that
break;
- case GX_CMD_INVL_VC:// Invalidate (vertex cache?)
+ case GX_CMD_INVL_VC:// Invalidate (vertex cache?)
DEBUG_LOG(VIDEO, "Invalidate (vertex cache?)");
break;
@@ -202,7 +202,7 @@ void DecodeStandard(u32 bufferSize)
}
break;
- // draw primitives
+ // draw primitives
default:
if (Cmd & 0x80)
{
@@ -284,7 +284,7 @@ bool CommandRunnable(u32 iBufferSize)
minSize = 5;
break;
- // draw primitives
+ // draw primitives
default:
if (Cmd & 0x80)
minSize = 3;
diff --git a/Source/Core/VideoBackends/Software/Src/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Src/Rasterizer.cpp
index 3c45ee7d25..fa10ac38af 100644
--- a/Source/Core/VideoBackends/Software/Src/Rasterizer.cpp
+++ b/Source/Core/VideoBackends/Software/Src/Rasterizer.cpp
@@ -54,12 +54,12 @@ void DoState(PointerWrap &p)
{
ZSlope.DoState(p);
WSlope.DoState(p);
- for (int i=0;i<2;++i)
+ for (auto& ColorSlope : ColorSlopes)
for (int n=0; n<4; ++n)
- ColorSlopes[i][n].DoState(p);
- for (int i=0;i<8;++i)
+ ColorSlope[n].DoState(p);
+ for (auto& TexSlope : TexSlopes)
for (int n=0; n<3; ++n)
- TexSlopes[i][n].DoState(p);
+ TexSlope[n].DoState(p);
p.Do(vertex0X);
p.Do(vertex0Y);
p.Do(vertexOffsetX);
diff --git a/Source/Core/VideoBackends/Software/Src/SWCommandProcessor.cpp b/Source/Core/VideoBackends/Software/Src/SWCommandProcessor.cpp
index 5fd1353a94..06876a2035 100644
--- a/Source/Core/VideoBackends/Software/Src/SWCommandProcessor.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWCommandProcessor.cpp
@@ -88,7 +88,7 @@ void Init()
cpreg.bboxbottom = 0;
cpreg.token = 0;
-
+
et_UpdateInterrupts = CoreTiming::RegisterEvent("UpdateInterrupts", UpdateInterrupts_Wrapper);
// internal buffer position
@@ -174,7 +174,7 @@ void Write16(const u16 _Value, const u32 _Address)
cpreg.status.UnderflowLoWatermark = 0;
INFO_LOG(COMMANDPROCESSOR,"\t write to CLEAR_REGISTER : %04x",_Value);
- }
+ }
break;
// Fifo Registers
diff --git a/Source/Core/VideoBackends/Software/Src/SWPixelEngine.cpp b/Source/Core/VideoBackends/Software/Src/SWPixelEngine.cpp
index 6c81aedac7..a747a669ed 100644
--- a/Source/Core/VideoBackends/Software/Src/SWPixelEngine.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWPixelEngine.cpp
@@ -81,7 +81,7 @@ void Write16(const u16 _iValue, const u32 _iAddress)
switch (address)
{
- case PE_CTRL_REGISTER:
+ case PE_CTRL_REGISTER:
{
UPECtrlReg tmpCtrl(_iValue);
@@ -135,7 +135,7 @@ void SetToken_OnMainThread(u64 userdata, int cyclesLate)
void SetFinish_OnMainThread(u64 userdata, int cyclesLate)
{
- g_bSignalFinishInterrupt = true;
+ g_bSignalFinishInterrupt = true;
UpdateInterrupts();
}
diff --git a/Source/Core/VideoBackends/Software/Src/SWPixelEngine.h b/Source/Core/VideoBackends/Software/Src/SWPixelEngine.h
index b61af07a06..01fb49685b 100644
--- a/Source/Core/VideoBackends/Software/Src/SWPixelEngine.h
+++ b/Source/Core/VideoBackends/Software/Src/SWPixelEngine.h
@@ -46,7 +46,7 @@ namespace SWPixelEngine
union UPEZConfReg
{
u16 Hex;
- struct
+ struct
{
u16 ZCompEnable : 1; // Z Comparator Enable
u16 Function : 3;
@@ -58,7 +58,7 @@ namespace SWPixelEngine
union UPEAlphaConfReg
{
u16 Hex;
- struct
+ struct
{
u16 BMMath : 1; // GX_BM_BLEND || GX_BM_SUBSTRACT
u16 BMLogic : 1; // GX_BM_LOGIC
@@ -75,7 +75,7 @@ namespace SWPixelEngine
union UPEDstAlphaConfReg
{
u16 Hex;
- struct
+ struct
{
u16 DstAlpha : 8;
u16 Enable : 1;
@@ -86,7 +86,7 @@ namespace SWPixelEngine
union UPEAlphaModeConfReg
{
u16 Hex;
- struct
+ struct
{
u16 Threshold : 8;
u16 CompareMode : 8;
@@ -96,7 +96,7 @@ namespace SWPixelEngine
union UPEAlphaReadReg
{
u16 Hex;
- struct
+ struct
{
u16 ReadMode : 3;
u16 : 13;
@@ -105,7 +105,7 @@ namespace SWPixelEngine
union UPECtrlReg
{
- struct
+ struct
{
u16 PETokenEnable : 1;
u16 PEFinishEnable : 1;
diff --git a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
index 57557c1ee8..1d894b18da 100644
--- a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
@@ -30,7 +30,7 @@ void SWRenderer::Init()
void SWRenderer::Shutdown()
{
glDeleteProgram(program);
- glDeleteTextures(1, &s_RenderTarget);
+ glDeleteTextures(1, &s_RenderTarget);
#ifndef USE_GLES
delete s_pfont;
s_pfont = 0;
@@ -62,7 +62,7 @@ void CreateShaders()
uni_tex = glGetUniformLocation(program, "Texture");
attr_pos = glGetAttribLocation(program, "pos");
- attr_tex = glGetAttribLocation(program, "TexCoordIn");
+ attr_tex = glGetAttribLocation(program, "TexCoordIn");
}
void SWRenderer::Prepare()
@@ -100,7 +100,7 @@ void SWRenderer::DrawDebugText()
char *p = debugtext_buffer;
p[0] = 0;
- if (g_SWVideoConfig.bShowStats)
+ if (g_SWVideoConfig.bShowStats)
{
p+=sprintf(p,"Objects: %i\n",swstats.thisFrame.numDrawnObjects);
p+=sprintf(p,"Primitives: %i\n",swstats.thisFrame.numPrimatives);
@@ -136,7 +136,7 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-
+
glUseProgram(program);
static const GLfloat verts[4][2] = {
{ -1, -1}, // Left top
@@ -161,13 +161,13 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
glDisableVertexAttribArray(attr_pos);
glDisableVertexAttribArray(attr_tex);
- glBindTexture(GL_TEXTURE_2D, 0);
+ glBindTexture(GL_TEXTURE_2D, 0);
GL_REPORT_ERRORD();
}
void SWRenderer::SwapBuffer()
{
- // Do our OSD callbacks
+ // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_ONFRAME);
DrawDebugText();
@@ -177,7 +177,7 @@ void SWRenderer::SwapBuffer()
GLInterface->Swap();
swstats.ResetFrame();
-
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GL_REPORT_ERRORD();
diff --git a/Source/Core/VideoBackends/Software/Src/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/Src/SWVertexLoader.cpp
index f176acd635..f08e2f3825 100644
--- a/Source/Core/VideoBackends/Software/Src/SWVertexLoader.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWVertexLoader.cpp
@@ -76,13 +76,13 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
};
const u32 tcElements[8] = {
- m_CurrentVat->g0.Tex0CoordElements, m_CurrentVat->g1.Tex1CoordElements, m_CurrentVat->g1.Tex2CoordElements,
+ m_CurrentVat->g0.Tex0CoordElements, m_CurrentVat->g1.Tex1CoordElements, m_CurrentVat->g1.Tex2CoordElements,
m_CurrentVat->g1.Tex3CoordElements, m_CurrentVat->g1.Tex4CoordElements, m_CurrentVat->g2.Tex5CoordElements,
m_CurrentVat->g2.Tex6CoordElements, m_CurrentVat->g2.Tex7CoordElements
};
const u32 tcFormat[8] = {
- m_CurrentVat->g0.Tex0CoordFormat, m_CurrentVat->g1.Tex1CoordFormat, m_CurrentVat->g1.Tex2CoordFormat,
+ m_CurrentVat->g0.Tex0CoordFormat, m_CurrentVat->g1.Tex1CoordFormat, m_CurrentVat->g1.Tex2CoordFormat,
m_CurrentVat->g1.Tex3CoordFormat, m_CurrentVat->g1.Tex4CoordFormat, m_CurrentVat->g2.Tex5CoordFormat,
m_CurrentVat->g2.Tex6CoordFormat, m_CurrentVat->g2.Tex7CoordFormat
};
@@ -161,10 +161,10 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
{
m_VertexSize += VertexLoader_Normal::GetSize(g_VtxDesc.Normal,
m_CurrentVat->g0.NormalFormat, m_CurrentVat->g0.NormalElements, m_CurrentVat->g0.NormalIndex3);
-
+
m_normalLoader = VertexLoader_Normal::GetFunction(g_VtxDesc.Normal,
m_CurrentVat->g0.NormalFormat, m_CurrentVat->g0.NormalElements, m_CurrentVat->g0.NormalIndex3);
-
+
if (m_normalLoader == 0)
{
ERROR_LOG(VIDEO, "VertexLoader_Normal::GetFunction returned zero!");
@@ -192,7 +192,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
}
AddAttributeLoader(LoadColor, i);
break;
- case INDEX8:
+ case INDEX8:
m_VertexSize += 1;
switch (colComp[i])
{
diff --git a/Source/Core/VideoBackends/Software/Src/SWVideoConfig.cpp b/Source/Core/VideoBackends/Software/Src/SWVideoConfig.cpp
index a6ebb97eb9..43b6a96ef7 100644
--- a/Source/Core/VideoBackends/Software/Src/SWVideoConfig.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWVideoConfig.cpp
@@ -12,7 +12,7 @@ SWVideoConfig::SWVideoConfig()
{
bFullscreen = false;
bHideCursor = false;
- renderToMainframe = false;
+ renderToMainframe = false;
bHwRasterizer = false;
diff --git a/Source/Core/VideoBackends/Software/Src/SWVideoConfig.h b/Source/Core/VideoBackends/Software/Src/SWVideoConfig.h
index 94e3a6b2a8..ce1857d774 100644
--- a/Source/Core/VideoBackends/Software/Src/SWVideoConfig.h
+++ b/Source/Core/VideoBackends/Software/Src/SWVideoConfig.h
@@ -19,7 +19,7 @@ struct SWVideoConfig : NonCopyable
// General
bool bFullscreen;
bool bHideCursor;
- bool renderToMainframe;
+ bool renderToMainframe;
bool bHwRasterizer;
diff --git a/Source/Core/VideoBackends/Software/Src/SWmain.cpp b/Source/Core/VideoBackends/Software/Src/SWmain.cpp
index 7f6792fc1c..939dd4553a 100644
--- a/Source/Core/VideoBackends/Software/Src/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWmain.cpp
@@ -61,8 +61,8 @@ void VideoSoftware::ShowConfig(void *_hParent)
bool VideoSoftware::Initialize(void *&window_handle)
{
g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
- InitInterface();
-
+ InitInterface();
+
if (!GLInterface->Create(window_handle))
{
INFO_LOG(VIDEO, "%s", "SWRenderer::Create failed\n");
@@ -150,7 +150,7 @@ void VideoSoftware::Shutdown()
HwRasterizer::Shutdown();
SWRenderer::Shutdown();
- // Do our OSD callbacks
+ // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_SHUTDOWN);
GLInterface->Shutdown();
@@ -177,7 +177,7 @@ void VideoSoftware::Video_Prepare()
// Handle VSync on/off
GLInterface->SwapInterval(VSYNC_ENABLED);
- // Do our OSD callbacks
+ // Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT);
HwRasterizer::Prepare();
@@ -188,7 +188,7 @@ void VideoSoftware::Video_Prepare()
// Run from the CPU thread (from VideoInterface.cpp)
void VideoSoftware::Video_BeginField(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
-{
+{
}
// Run from the CPU thread (from VideoInterface.cpp)
@@ -263,7 +263,7 @@ void VideoSoftware::Video_EnterLoop()
Common::SleepCurrentThread(1);
m_csSWVidOccupied.lock();
}
- }
+ }
}
void VideoSoftware::Video_ExitLoop()
diff --git a/Source/Core/VideoBackends/Software/Src/SetupUnit.cpp b/Source/Core/VideoBackends/Software/Src/SetupUnit.cpp
index f0cc179f25..b08584e0a9 100644
--- a/Source/Core/VideoBackends/Software/Src/SetupUnit.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SetupUnit.cpp
@@ -99,7 +99,7 @@ void SetupUnit::SetupTriStrip()
m_VertPointer[2 - (m_VertexCounter & 1)] = m_VertPointer[0];
m_VertWritePointer = m_VertPointer[0];
- m_VertPointer[0] = &m_Vertices[(m_VertexCounter + 1) % 3];
+ m_VertPointer[0] = &m_Vertices[(m_VertexCounter + 1) % 3];
}
void SetupUnit::SetupTriFan()
diff --git a/Source/Core/VideoBackends/Software/Src/Tev.cpp b/Source/Core/VideoBackends/Software/Src/Tev.cpp
index effe1d3261..da9b30fe78 100644
--- a/Source/Core/VideoBackends/Software/Src/Tev.cpp
+++ b/Source/Core/VideoBackends/Software/Src/Tev.cpp
@@ -179,7 +179,7 @@ void Tev::DrawColorRegular(TevStageCombiner::ColorCombiner &cc)
InputReg.c = *m_ColorInputLUT[cc.c][i];
InputReg.d = *m_ColorInputLUT[cc.d][i];
- u16 c = InputReg.c + (InputReg.c >> 7);
+ u16 c = InputReg.c + (InputReg.c >> 7);
s32 temp = InputReg.a * (256 - c) + (InputReg.b * c);
temp = cc.op?(-temp >> 8):(temp >> 8);
@@ -285,7 +285,7 @@ void Tev::DrawColorCompare(TevStageCombiner::ColorCombiner &cc)
Reg[cc.dest][BLU_C + i] = InputReg.d + ((InputReg.a > InputReg.b) ? InputReg.c : 0);
}
break;
- case TEVCMP_RGB8_EQ:
+ case TEVCMP_RGB8_EQ:
for (int i = 0; i < 3; i++)
{
InputReg.a = *m_ColorInputLUT[cc.a][i];
@@ -307,7 +307,7 @@ void Tev::DrawAlphaRegular(TevStageCombiner::AlphaCombiner &ac)
InputReg.c = m_AlphaInputLUT[ac.c][ALP_C];
InputReg.d = m_AlphaInputLUT[ac.d][ALP_C];
- u16 c = InputReg.c + (InputReg.c >> 7);
+ u16 c = InputReg.c + (InputReg.c >> 7);
s32 temp = InputReg.a * (256 - c) + (InputReg.b * c);
temp = ac.op?(-temp >> 8):(temp >> 8);
@@ -736,8 +736,8 @@ void Tev::Draw()
s32 denom = bpmem.fog.b_magnitude - (Position[2] >> bpmem.fog.b_shift);
//in addition downscale magnitude and zs to 0.24 bits
ze = (bpmem.fog.a.GetA() * 16777215.0f) / (float)denom;
- }
- else
+ }
+ else
{
// orthographic
// ze = a*Zs
@@ -848,7 +848,7 @@ void Tev::SetRegColor(int reg, int comp, bool konst, s16 color)
void Tev::DoState(PointerWrap &p)
{
p.DoArray(Reg, sizeof(Reg));
-
+
p.DoArray(KonstantColors, sizeof(KonstantColors));
p.DoArray(TexColor,4);
p.DoArray(RasColor,4);
diff --git a/Source/Core/VideoBackends/Software/Src/Tev.h b/Source/Core/VideoBackends/Software/Src/Tev.h
index fee3c8022e..e86768ac0b 100644
--- a/Source/Core/VideoBackends/Software/Src/Tev.h
+++ b/Source/Core/VideoBackends/Software/Src/Tev.h
@@ -9,7 +9,7 @@
#include "ChunkFile.h"
class Tev
-{
+{
struct InputRegType
{
unsigned a : 8;
@@ -49,7 +49,7 @@ class Tev
{
BLU_INP,
GRN_INP,
- RED_INP
+ RED_INP
};
enum BufferBase
diff --git a/Source/Core/VideoBackends/Software/Src/TextureEncoder.cpp b/Source/Core/VideoBackends/Software/Src/TextureEncoder.cpp
index 9874e13449..07bb162cd6 100644
--- a/Source/Core/VideoBackends/Software/Src/TextureEncoder.cpp
+++ b/Source/Core/VideoBackends/Software/Src/TextureEncoder.cpp
@@ -359,7 +359,7 @@ void EncodeRGBA6(u8 *dst, u8 *src, u32 format)
SetSpans(sBlkSize, tBlkSize, tSpan, sBlkSpan, tBlkSpan, writeStride);
ENCODE_LOOP_BLOCKS
{
- RGBA_to_RGBA8(src, dst[1], dst[32], dst[33], dst[0]);
+ RGBA_to_RGBA8(src, dst[1], dst[32], dst[33], dst[0]);
src += readStride;
dst += 2;
}
@@ -563,7 +563,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
boxfilterRGBA_to_RGB8(src, r, g, b);
src += readStride;
- u16 val = ((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001e);
+ u16 val = ((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001e);
*(u16*)dst = Common::swap16(val);
dst+=2;
}
@@ -595,7 +595,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
SetSpans(sBlkSize, tBlkSize, tSpan, sBlkSpan, tBlkSpan, writeStride);
ENCODE_LOOP_BLOCKS
{
- boxfilterRGBA_to_RGBA8(src, dst[1], dst[32], dst[33], dst[0]);
+ boxfilterRGBA_to_RGBA8(src, dst[1], dst[32], dst[33], dst[0]);
src += readStride;
dst += 2;
}
@@ -721,7 +721,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
default:
PanicAlert("Unknown texture copy format: 0x%x\n", format);
- break;
+ break;
}
}
@@ -790,7 +790,7 @@ void EncodeRGB8(u8 *dst, u8 *src, u32 format)
SetSpans(sBlkSize, tBlkSize, tSpan, sBlkSpan, tBlkSpan, writeStride);
ENCODE_LOOP_BLOCKS
{
- u16 val = ((src[2] << 8) & 0xf800) | ((src[1] << 3) & 0x07e0) | ((src[0] >> 3) & 0x001e);
+ u16 val = ((src[2] << 8) & 0xf800) | ((src[1] << 3) & 0x07e0) | ((src[0] >> 3) & 0x001e);
*(u16*)dst = Common::swap16(val);
src += readStride;
dst+=2;
@@ -935,7 +935,7 @@ void EncodeRGB8(u8 *dst, u8 *src, u32 format)
default:
PanicAlert("Unknown texture copy format: 0x%x\n", format);
- break;
+ break;
}
}
@@ -1010,7 +1010,7 @@ void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
ENCODE_LOOP_BLOCKS
{
boxfilterRGB_to_RGB8(src, r, g, b);
- u16 val = ((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001e);
+ u16 val = ((r << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((b >> 3) & 0x001e);
*(u16*)dst = Common::swap16(val);
src += readStride;
dst+=2;
@@ -1166,7 +1166,7 @@ void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
default:
PanicAlert("Unknown texture copy format: 0x%x\n", format);
- break;
+ break;
}
}
@@ -1270,7 +1270,7 @@ void EncodeZ24(u8 *dst, u8 *src, u32 format)
default:
PanicAlert("Unknown texture copy format: 0x%x\n", format);
- break;
+ break;
}
}
@@ -1314,7 +1314,7 @@ void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format)
SetSpans(sBlkSize, tBlkSize, tSpan, sBlkSpan, tBlkSpan, writeStride);
ENCODE_LOOP_BLOCKS
{
- boxfilterRGB_to_RGB8(src, dst[33], dst[32], dst[1]);
+ boxfilterRGB_to_RGB8(src, dst[33], dst[32], dst[1]);
dst[0] = 255;
src += readStride;
dst += 2;
@@ -1380,7 +1380,7 @@ void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format)
default:
PanicAlert("Unknown texture copy format: 0x%x\n", format);
- break;
+ break;
}
}
@@ -1389,7 +1389,7 @@ void Encode(u8 *dest_ptr)
int pixelformat = bpmem.zcontrol.pixel_format;
bool bFromZBuffer = pixelformat == PIXELFMT_Z24;
bool bIsIntensityFmt = bpmem.triggerEFBCopy.intensity_fmt > 0;
- u32 copyfmt = ((bpmem.triggerEFBCopy.target_pixel_format / 2) + ((bpmem.triggerEFBCopy.target_pixel_format & 1) * 8));
+ u32 copyfmt = ((bpmem.triggerEFBCopy.target_pixel_format / 2) + ((bpmem.triggerEFBCopy.target_pixel_format & 1) * 8));
// pack copy format information into a single variable
u32 format = copyfmt;
diff --git a/Source/Core/VideoBackends/Software/Src/TextureSampler.cpp b/Source/Core/VideoBackends/Software/Src/TextureSampler.cpp
index f7c87ba513..0657f701f2 100644
--- a/Source/Core/VideoBackends/Software/Src/TextureSampler.cpp
+++ b/Source/Core/VideoBackends/Software/Src/TextureSampler.cpp
@@ -124,7 +124,7 @@ void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample)
int imageHeight = ti0.height;
int tlutAddress = texTlut.tmem_offset << 9;
-
+
// reduce sample location and texture size to mip level
// move texture pointer to mip location
if (mip)
diff --git a/Source/Core/VideoBackends/Software/Src/TransformUnit.cpp b/Source/Core/VideoBackends/Software/Src/TransformUnit.cpp
index a1c2bd190a..e00f05e4aa 100644
--- a/Source/Core/VideoBackends/Software/Src/TransformUnit.cpp
+++ b/Source/Core/VideoBackends/Software/Src/TransformUnit.cpp
@@ -248,7 +248,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann
float attn;
if (chan.attnfunc == 3) // spot
- {
+ {
float dist2 = ldir.length2();
float dist = sqrtf(dist2);
ldir = ldir / dist;
@@ -259,7 +259,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann
attn = SafeDivide(max(0.0f, cosAtt), distAtt);
}
else if (chan.attnfunc == 1) // specular
- {
+ {
// donko - what is going on here? 655.36 is a guess but seems about right.
attn = (light->pos * normal) > -655.36 ? max(0.0f, (light->dir * normal)) : 0;
ldir.set(1.0f, attn, attn * attn);
diff --git a/Source/Core/VideoBackends/Software/Src/Vec3.h b/Source/Core/VideoBackends/Software/Src/Vec3.h
index d4b1502dcb..117a6f4197 100644
--- a/Source/Core/VideoBackends/Software/Src/Vec3.h
+++ b/Source/Core/VideoBackends/Software/Src/Vec3.h
@@ -62,7 +62,7 @@ public:
Vec3 operator %(const Vec3 &v) const {
return Vec3(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x);
- }
+ }
float length2() const {
return x*x+y*y+z*z;
}
@@ -88,11 +88,11 @@ public:
{
return *((&x) + i);
}
- bool operator == (const Vec3 &other) const
+ bool operator == (const Vec3 &other) const
{
if (x==other.x && y==other.y && z==other.z)
return true;
- else
+ else
return false;
}
void setZero()
diff --git a/Source/Core/VideoBackends/Software/Src/VideoBackend.h b/Source/Core/VideoBackends/Software/Src/VideoBackend.h
index 6c382aa0b2..4d85c637f0 100644
--- a/Source/Core/VideoBackends/Software/Src/VideoBackend.h
+++ b/Source/Core/VideoBackends/Software/Src/VideoBackend.h
@@ -9,57 +9,57 @@ namespace SW
class VideoSoftware : public VideoBackend
{
- bool Initialize(void *&);
- void Shutdown();
+ bool Initialize(void *&) override;
+ void Shutdown() override;
- std::string GetName();
+ std::string GetName() override;
- void EmuStateChange(EMUSTATE_CHANGE newState);
+ void EmuStateChange(EMUSTATE_CHANGE newState) override;
- void RunLoop(bool enable);
+ void RunLoop(bool enable) override;
- void ShowConfig(void* parent);
+ void ShowConfig(void* parent) override;
- void Video_Prepare();
- void Video_Cleanup();
+ void Video_Prepare() override;
+ void Video_Cleanup() override;
- void Video_EnterLoop();
- void Video_ExitLoop();
- void Video_BeginField(u32, u32, u32);
- void Video_EndField();
-
- u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
- u32 Video_GetQueryResult(PerfQueryType type);
+ void Video_EnterLoop() override;
+ void Video_ExitLoop() override;
+ void Video_BeginField(u32, u32, u32) override;
+ void Video_EndField() override;
- void Video_AddMessage(const char* pstr, unsigned int milliseconds);
- void Video_ClearMessages();
- bool Video_Screenshot(const char* filename);
+ u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) override;
+ u32 Video_GetQueryResult(PerfQueryType type) override;
+
+ void Video_AddMessage(const char* pstr, unsigned int milliseconds) override;
+ void Video_ClearMessages() override;
+ bool Video_Screenshot(const char* filename) override;
int Video_LoadTexture(char *imagedata, u32 width, u32 height);
void Video_DeleteTexture(int texID);
void Video_DrawTexture(int texID, float *coords);
- void Video_SetRendering(bool bEnabled);
+ void Video_SetRendering(bool bEnabled) override;
+
+ void Video_GatherPipeBursted() override;
+ bool Video_IsHiWatermarkActive() override;
+ bool Video_IsPossibleWaitingSetDrawDone() override;
+ void Video_AbortFrame() override;
- void Video_GatherPipeBursted();
- bool Video_IsHiWatermarkActive();
- bool Video_IsPossibleWaitingSetDrawDone();
- void Video_AbortFrame();
+ readFn16 Video_CPRead16() override;
+ writeFn16 Video_CPWrite16() override;
+ readFn16 Video_PERead16() override;
+ writeFn16 Video_PEWrite16() override;
+ writeFn32 Video_PEWrite32() override;
- readFn16 Video_CPRead16();
- writeFn16 Video_CPWrite16();
- readFn16 Video_PERead16();
- writeFn16 Video_PEWrite16();
- writeFn32 Video_PEWrite32();
+ void UpdateFPSDisplay(const char*) override;
+ unsigned int PeekMessages() override;
- void UpdateFPSDisplay(const char*);
- unsigned int PeekMessages();
+ void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) override;
+ void DoState(PointerWrap &p) override;
- void PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
- void DoState(PointerWrap &p);
-
public:
- void CheckInvalidState();
+ void CheckInvalidState() override;
};
}
diff --git a/Source/Core/VideoBackends/Software/Src/VideoConfigDialog.cpp b/Source/Core/VideoBackends/Software/Src/VideoConfigDialog.cpp
index eea908edfc..5ac6946d23 100644
--- a/Source/Core/VideoBackends/Software/Src/VideoConfigDialog.cpp
+++ b/Source/Core/VideoBackends/Software/Src/VideoConfigDialog.cpp
@@ -28,7 +28,7 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title,
{
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
- wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize);
+ wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize);
// -- GENERAL --
{
@@ -79,7 +79,7 @@ VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title,
szr_info->Add(new SettingCheckBox(page_general, wxT("Various Statistics"), wxT(""), vconfig.bShowStats));
}
-
+
// - utility
{
wxStaticBoxSizer* const group_utility = new wxStaticBoxSizer(wxVERTICAL, page_general, wxT("Utility"));
diff --git a/Source/Core/VideoBackends/Software/Src/XFMemLoader.cpp b/Source/Core/VideoBackends/Software/Src/XFMemLoader.cpp
index 4580bafad8..899a5fab48 100644
--- a/Source/Core/VideoBackends/Software/Src/XFMemLoader.cpp
+++ b/Source/Core/VideoBackends/Software/Src/XFMemLoader.cpp
@@ -23,7 +23,7 @@ void XFWritten(u32 transferSize, u32 baseAddress)
if (baseAddress <= 0x1026 && topAddress >= 0x1020)
Clipper::SetViewOffset();
- // fix lights so invalid values don't trash the lighting computations
+ // fix lights so invalid values don't trash the lighting computations
if (baseAddress <= 0x067f && topAddress >= 0x0604)
{
u32* x = swxfregs.lights;
diff --git a/Source/Core/VideoBackends/Software/Src/XFMemLoader.h b/Source/Core/VideoBackends/Software/Src/XFMemLoader.h
index 75e05110bf..ff6c7267dd 100644
--- a/Source/Core/VideoBackends/Software/Src/XFMemLoader.h
+++ b/Source/Core/VideoBackends/Software/Src/XFMemLoader.h
@@ -158,7 +158,7 @@ struct Projection
union TexMtxInfo
{
- struct
+ struct
{
u32 unknown : 1;
u32 projection : 1; // XF_TEXPROJ_X
@@ -173,7 +173,7 @@ union TexMtxInfo
union PostMtxInfo
{
- struct
+ struct
{
u32 index : 6; // base row of dual transform matrix
u32 unused : 2;
diff --git a/Source/Core/VideoBackends/Software/Src/stdafx.h b/Source/Core/VideoBackends/Software/Src/stdafx.h
index 60f0912113..9d8868e8a9 100644
--- a/Source/Core/VideoBackends/Software/Src/stdafx.h
+++ b/Source/Core/VideoBackends/Software/Src/stdafx.h
@@ -9,5 +9,5 @@
#endif
#include <tchar.h>
-#include <windows.h>
+#include <windows.h>