summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-03-29 20:40:06 +1000
committerGitHub <noreply@github.com>2019-03-29 20:40:06 +1000
commitf3fadd730218429a5f6472283d16d30d7e276f8d (patch)
treed1d6577cd52b2d3b3d7872aef4fac80dbd0ce563 /Source/Core/VideoCommon
parentfbe57e8dbef17e583f0ba0208af7bf414a3716bf (diff)
parentd0d010f8549cc902829f567b3b5127d9a0556ca5 (diff)
Merge pull request #7869 from stenzek/d3dcommon
D3D: Move sharable D3D11/D3D12 code to common library
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp5
-rw-r--r--Source/Core/VideoCommon/RenderBase.h1
-rw-r--r--Source/Core/VideoCommon/ShaderCache.cpp14
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.h6
-rw-r--r--Source/Core/VideoCommon/VideoBackendBase.cpp1
5 files changed, 21 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 1a15f0aec0..688c7fc43b 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -151,6 +151,11 @@ std::unique_ptr<AbstractShader> Renderer::CreateShaderFromSource(ShaderStage sta
return CreateShaderFromSource(stage, source.c_str(), source.size());
}
+bool Renderer::EFBHasAlphaChannel() const
+{
+ return m_prev_efb_format == PEControl::RGBA6_Z24;
+}
+
void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable,
u32 color, u32 z)
{
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index 6ee03a9156..af9c1a8972 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -224,6 +224,7 @@ public:
PEControl::PixelFormat GetPrevPixelFormat() const { return m_prev_efb_format; }
void StorePixelFormat(PEControl::PixelFormat new_format) { m_prev_efb_format = new_format; }
+ bool EFBHasAlphaChannel() const;
VideoCommon::PostProcessing* GetPostProcessor() const { return m_post_processor.get(); }
// Final surface changing
// This is called when the surface is resized (WX) or the window changes (Android).
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp
index b42587a2d4..8f9c99d39d 100644
--- a/Source/Core/VideoCommon/ShaderCache.cpp
+++ b/Source/Core/VideoCommon/ShaderCache.cpp
@@ -966,10 +966,16 @@ void ShaderCache::QueueUberShaderPipelines()
config.vs_uid = vs_uid;
config.gs_uid = gs_uid;
config.ps_uid = ps_uid;
- config.rasterization_state =
- RenderState::GetCullBackFaceRasterizationState(PrimitiveType::TriangleStrip);
+ config.rasterization_state = RenderState::GetCullBackFaceRasterizationState(
+ static_cast<PrimitiveType>(gs_uid.GetUidData()->primitive_type));
config.depth_state = RenderState::GetNoDepthTestingDepthState();
config.blending_state = RenderState::GetNoBlendingBlendState();
+ if (ps_uid.GetUidData()->uint_output)
+ {
+ // uint_output is only ever enabled when logic ops are enabled.
+ config.blending_state.logicopenable = true;
+ config.blending_state.logicmode = BlendMode::AND;
+ }
auto iter = m_gx_uber_pipeline_cache.find(config);
if (iter != m_gx_uber_pipeline_cache.end())
@@ -986,13 +992,15 @@ void ShaderCache::QueueUberShaderPipelines()
if (vuid.GetUidData()->num_texgens != puid.GetUidData()->num_texgens)
return;
+ UberShader::PixelShaderUid cleared_puid = puid;
+ UberShader::ClearUnusedPixelShaderUidBits(m_api_type, m_host_config, &cleared_puid);
EnumerateGeometryShaderUids([&](const GeometryShaderUid& guid) {
if (guid.GetUidData()->numTexGens != vuid.GetUidData()->num_texgens ||
(!guid.GetUidData()->IsPassthrough() && !m_host_config.backend_geometry_shaders))
{
return;
}
- QueueDummyPipeline(vuid, guid, puid);
+ QueueDummyPipeline(vuid, guid, cleared_puid);
});
});
});
diff --git a/Source/Core/VideoCommon/VertexManagerBase.h b/Source/Core/VideoCommon/VertexManagerBase.h
index 9a657bd7f3..ba1d98c236 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.h
+++ b/Source/Core/VideoCommon/VertexManagerBase.h
@@ -54,9 +54,9 @@ public:
// Streaming buffer sizes.
// Texel buffer will fit the maximum size of an encoded GX texture. 1024x1024, RGBA8 = 4MB.
- static constexpr u32 VERTEX_STREAM_BUFFER_SIZE = 40 * 1024 * 1024;
- static constexpr u32 INDEX_STREAM_BUFFER_SIZE = 4 * 1024 * 1024;
- static constexpr u32 UNIFORM_STREAM_BUFFER_SIZE = 16 * 1024 * 1024;
+ static constexpr u32 VERTEX_STREAM_BUFFER_SIZE = 48 * 1024 * 1024;
+ static constexpr u32 INDEX_STREAM_BUFFER_SIZE = 8 * 1024 * 1024;
+ static constexpr u32 UNIFORM_STREAM_BUFFER_SIZE = 32 * 1024 * 1024;
static constexpr u32 TEXEL_STREAM_BUFFER_SIZE = 16 * 1024 * 1024;
VertexManagerBase();
diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp
index 268a3b70b7..f310f68920 100644
--- a/Source/Core/VideoCommon/VideoBackendBase.cpp
+++ b/Source/Core/VideoCommon/VideoBackendBase.cpp
@@ -294,6 +294,7 @@ void VideoBackendBase::InitializeShared()
GeometryShaderManager::Init();
PixelShaderManager::Init();
+ g_Config.VerifyValidity();
UpdateActiveConfig();
}