mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 13:18:50 +00:00
VideoBackends: Use VideoCommon shader generators for efb2tex copies.
This will generate one shader per copy format. For now, it is the same shader with the colmat hard coded. So it should already improve the GPU performance a bit, but a rewrite of the shader generator is suggested. Half of the patch is done by linkmauve1: VideoCommon: Reorganise the shader writes.
This commit is contained in:
parent
2b2941d0c9
commit
491c10ec96
15 changed files with 468 additions and 211 deletions
32
Source/Core/VideoCommon/TextureConverterShaderGen.h
Normal file
32
Source/Core/VideoCommon/TextureConverterShaderGen.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoCommon/ShaderGenCommon.h"
|
||||
#include "VideoCommon/TextureDecoder.h"
|
||||
|
||||
enum class APIType;
|
||||
|
||||
#pragma pack(1)
|
||||
struct convertion_shader_uid_data
|
||||
{
|
||||
u32 NumValues() const { return sizeof(convertion_shader_uid_data); }
|
||||
EFBCopyFormat dst_format;
|
||||
|
||||
u32 efb_has_alpha : 1;
|
||||
u32 is_depth_copy : 1;
|
||||
u32 is_intensity : 1;
|
||||
u32 scale_by_half : 1;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
using TextureConverterShaderUid = ShaderUid<convertion_shader_uid_data>;
|
||||
|
||||
ShaderCode GenerateTextureConverterShaderCode(APIType api_type,
|
||||
const convertion_shader_uid_data* uid_data);
|
||||
|
||||
TextureConverterShaderUid GetTextureConverterShaderUid(EFBCopyFormat dst_format, bool is_depth_copy,
|
||||
bool is_intensity, bool scale_by_half);
|
Loading…
Add table
Add a link
Reference in a new issue