mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-08-20 20:43:22 +02:00
texture_cache: eliminate accelerated depth->color/color->depth copies due to driver instability.
This commit is contained in:
parent
561ce29c98
commit
b01f9c8a70
@ -28,7 +28,6 @@ Device::Device() {
|
|||||||
max_varyings = GetInteger<u32>(GL_MAX_VARYING_VECTORS);
|
max_varyings = GetInteger<u32>(GL_MAX_VARYING_VECTORS);
|
||||||
has_variable_aoffi = TestVariableAoffi();
|
has_variable_aoffi = TestVariableAoffi();
|
||||||
has_component_indexing_bug = TestComponentIndexingBug();
|
has_component_indexing_bug = TestComponentIndexingBug();
|
||||||
is_turing_plus = GLAD_GL_NV_mesh_shader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Device::Device(std::nullptr_t) {
|
Device::Device(std::nullptr_t) {
|
||||||
|
@ -34,10 +34,6 @@ public:
|
|||||||
return has_component_indexing_bug;
|
return has_component_indexing_bug;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsTuringGPU() const {
|
|
||||||
return is_turing_plus;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool TestVariableAoffi();
|
static bool TestVariableAoffi();
|
||||||
static bool TestComponentIndexingBug();
|
static bool TestComponentIndexingBug();
|
||||||
@ -47,7 +43,6 @@ private:
|
|||||||
u32 max_varyings{};
|
u32 max_varyings{};
|
||||||
bool has_variable_aoffi{};
|
bool has_variable_aoffi{};
|
||||||
bool has_component_indexing_bug{};
|
bool has_component_indexing_bug{};
|
||||||
bool is_turing_plus{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace OpenGL
|
} // namespace OpenGL
|
||||||
|
@ -439,7 +439,6 @@ TextureCacheOpenGL::TextureCacheOpenGL(Core::System& system,
|
|||||||
VideoCore::RasterizerInterface& rasterizer,
|
VideoCore::RasterizerInterface& rasterizer,
|
||||||
const Device& device)
|
const Device& device)
|
||||||
: TextureCacheBase{system, rasterizer} {
|
: TextureCacheBase{system, rasterizer} {
|
||||||
support_info.depth_color_image_copies = !device.IsTuringGPU();
|
|
||||||
src_framebuffer.Create();
|
src_framebuffer.Create();
|
||||||
dst_framebuffer.Create();
|
dst_framebuffer.Create();
|
||||||
}
|
}
|
||||||
@ -452,14 +451,12 @@ Surface TextureCacheOpenGL::CreateSurface(GPUVAddr gpu_addr, const SurfaceParams
|
|||||||
|
|
||||||
void TextureCacheOpenGL::ImageCopy(Surface& src_surface, Surface& dst_surface,
|
void TextureCacheOpenGL::ImageCopy(Surface& src_surface, Surface& dst_surface,
|
||||||
const VideoCommon::CopyParams& copy_params) {
|
const VideoCommon::CopyParams& copy_params) {
|
||||||
if (!support_info.depth_color_image_copies) {
|
|
||||||
const auto& src_params = src_surface->GetSurfaceParams();
|
const auto& src_params = src_surface->GetSurfaceParams();
|
||||||
const auto& dst_params = dst_surface->GetSurfaceParams();
|
const auto& dst_params = dst_surface->GetSurfaceParams();
|
||||||
if (src_params.type != dst_params.type) {
|
if (src_params.type != dst_params.type) {
|
||||||
// A fallback is needed
|
// A fallback is needed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const auto src_handle = src_surface->GetTexture();
|
const auto src_handle = src_surface->GetTexture();
|
||||||
const auto src_target = src_surface->GetTarget();
|
const auto src_target = src_surface->GetTarget();
|
||||||
const auto dst_handle = dst_surface->GetTexture();
|
const auto dst_handle = dst_surface->GetTexture();
|
||||||
|
@ -218,12 +218,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// This structure is used for communicating with the backend, on which behaviors
|
|
||||||
// it supports and what not, to avoid assuming certain things about hardware.
|
|
||||||
// The backend is RESPONSIBLE for filling this settings on creation.
|
|
||||||
struct Support {
|
|
||||||
bool depth_color_image_copies;
|
|
||||||
} support_info;
|
|
||||||
|
|
||||||
TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer)
|
TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer)
|
||||||
: system{system}, rasterizer{rasterizer} {
|
: system{system}, rasterizer{rasterizer} {
|
||||||
@ -389,8 +383,7 @@ private:
|
|||||||
const auto gpu_addr = current_surface->GetGpuAddr();
|
const auto gpu_addr = current_surface->GetGpuAddr();
|
||||||
TSurface new_surface = GetUncachedSurface(gpu_addr, params);
|
TSurface new_surface = GetUncachedSurface(gpu_addr, params);
|
||||||
const auto& cr_params = current_surface->GetSurfaceParams();
|
const auto& cr_params = current_surface->GetSurfaceParams();
|
||||||
if (cr_params.type != params.type && (!support_info.depth_color_image_copies ||
|
if (cr_params.type != params.type || (cr_params.component_type != params.component_type)) {
|
||||||
cr_params.component_type != params.component_type)) {
|
|
||||||
BufferCopy(current_surface, new_surface);
|
BufferCopy(current_surface, new_surface);
|
||||||
} else {
|
} else {
|
||||||
std::vector<CopyParams> bricks = current_surface->BreakDown(params);
|
std::vector<CopyParams> bricks = current_surface->BreakDown(params);
|
||||||
|
Loading…
Reference in New Issue
Block a user