summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2017-02-15 20:37:04 -0800
committerPhil Christensen <philc@microsoft.com>2017-02-15 20:37:04 -0800
commit2ed61b0ee1d18547d1dc662bf538c7eaab4886f7 (patch)
tree3a45255d4052264fd39d704c19ba3254194e549a /Source/Core/VideoBackends
parentf80f7b6f9ceba62d26d6d3c9c7e0afa5ac53959a (diff)
C++ conformance fixes (MSVC /permissive-)
We (the Microsoft C++ team) use the dolphin project as part of our "Real world code" tests. I noticed a few issues in windows specific code when building dolphin with the MSVC compiler in its conformance mode (/permissive-). For more information on /permissive- see our blog https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/. These changes are to address 3 different types of issues: 1) Use of qualified names in member declarations struct A {      void A::f() { } // error C4596: illegal qualified name in member declaration                      // remove redundant 'A::' to fix }; 2) Binding a non-const reference to a temporary struct S{};    // If arg is in 'in' parameter, then it should be made const. void func(S& arg){}    int main() {    //error C2664: 'void func(S &)': cannot convert argument 1 from 'S' to 'S &'    //note: A non-const reference may only be bound to an lvalue    func( S() );       //Work around this by creating a local, and using it to call the function    S s;    func( s ); } 3) Add missing #include <intrin.h> Because of the workaround you are using in the code you will need to include this. This is because of changes in the libraries and not /permissive-
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/D3D/GeometryShaderCache.h4
-rw-r--r--Source/Core/VideoBackends/D3D/VertexShaderCache.h2
-rw-r--r--Source/Core/VideoBackends/D3D12/TextureCache.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/D3D/GeometryShaderCache.h b/Source/Core/VideoBackends/D3D/GeometryShaderCache.h
index f0cab99940..72024e52f5 100644
--- a/Source/Core/VideoBackends/D3D/GeometryShaderCache.h
+++ b/Source/Core/VideoBackends/D3D/GeometryShaderCache.h
@@ -21,8 +21,8 @@ public:
static bool InsertByteCode(const GeometryShaderUid& uid, const void* bytecode,
unsigned int bytecodelen);
- static ID3D11GeometryShader* GeometryShaderCache::GetClearGeometryShader();
- static ID3D11GeometryShader* GeometryShaderCache::GetCopyGeometryShader();
+ static ID3D11GeometryShader* GetClearGeometryShader();
+ static ID3D11GeometryShader* GetCopyGeometryShader();
static ID3D11GeometryShader* GetActiveShader() { return last_entry->shader; }
static ID3D11Buffer*& GetConstantBuffer();
diff --git a/Source/Core/VideoBackends/D3D/VertexShaderCache.h b/Source/Core/VideoBackends/D3D/VertexShaderCache.h
index 7471d4f769..ba006bb954 100644
--- a/Source/Core/VideoBackends/D3D/VertexShaderCache.h
+++ b/Source/Core/VideoBackends/D3D/VertexShaderCache.h
@@ -30,7 +30,7 @@ public:
static ID3D11InputLayout* GetSimpleInputLayout();
static ID3D11InputLayout* GetClearInputLayout();
- static bool VertexShaderCache::InsertByteCode(const VertexShaderUid& uid, D3DBlob* bcodeblob);
+ static bool InsertByteCode(const VertexShaderUid& uid, D3DBlob* bcodeblob);
private:
struct VSCacheEntry
diff --git a/Source/Core/VideoBackends/D3D12/TextureCache.cpp b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
index 4e297dc7e8..59198dca8d 100644
--- a/Source/Core/VideoBackends/D3D12/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D12/TextureCache.cpp
@@ -499,7 +499,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* uncon
g_renderer->RestoreAPIState();
}
-D3D12_SHADER_BYTECODE GetConvertShader12(std::string& Type)
+D3D12_SHADER_BYTECODE GetConvertShader12(const std::string& Type)
{
std::string shader = "#define DECODE DecodePixel_";
shader.append(Type);