mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
VideoCommon: Move abstract texture creation function to Renderer
This commit is contained in:
@ -731,7 +731,7 @@ void Renderer::UpdateFrameDumpTexture()
|
||||
config.width = target_width;
|
||||
config.height = target_height;
|
||||
config.rendertarget = true;
|
||||
m_dump_texture = g_texture_cache->CreateTexture(config);
|
||||
m_dump_texture = CreateTexture(config);
|
||||
}
|
||||
m_dump_texture->CopyRectangleFromTexture(m_last_xfb_texture, m_last_xfb_region,
|
||||
EFBRectangle{0, 0, target_width, target_height});
|
||||
|
@ -35,6 +35,7 @@
|
||||
class AbstractRawTexture;
|
||||
class AbstractTexture;
|
||||
class PostProcessingShaderImplementation;
|
||||
struct TextureConfig;
|
||||
enum class EFBAccessType;
|
||||
|
||||
struct EfbPokeData
|
||||
@ -79,6 +80,8 @@ public:
|
||||
virtual void RestoreState() {}
|
||||
virtual void ResetAPIState() {}
|
||||
virtual void RestoreAPIState() {}
|
||||
virtual std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config) = 0;
|
||||
|
||||
// Ideal internal resolution - multiple of the native EFB resolution
|
||||
int GetTargetWidth() const { return m_target_width; }
|
||||
int GetTargetHeight() const { return m_target_height; }
|
||||
|
@ -2090,7 +2090,7 @@ std::unique_ptr<AbstractTexture> TextureCacheBase::AllocateTexture(const Texture
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = CreateTexture(config);
|
||||
entry = g_renderer->CreateTexture(config);
|
||||
if (!entry)
|
||||
return nullptr;
|
||||
|
||||
|
@ -273,8 +273,6 @@ public:
|
||||
|
||||
void ScaleTextureCacheEntryTo(TCacheEntry* entry, u32 new_width, u32 new_height);
|
||||
|
||||
virtual std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config) = 0;
|
||||
|
||||
protected:
|
||||
TextureCacheBase();
|
||||
|
||||
|
@ -22,6 +22,13 @@ enum class AbstractTextureFormat : u32
|
||||
struct TextureConfig
|
||||
{
|
||||
constexpr TextureConfig() = default;
|
||||
constexpr TextureConfig(u32 width_, u32 height_, u32 levels_, u32 layers_,
|
||||
AbstractTextureFormat format_, bool rendertarget_)
|
||||
: width(width_), height(height_), levels(levels_), layers(layers_), format(format_),
|
||||
rendertarget(rendertarget_)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==(const TextureConfig& o) const;
|
||||
MathUtil::Rectangle<int> GetRect() const;
|
||||
|
||||
|
Reference in New Issue
Block a user