mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
AbstractTexture: Move Bind() method to Renderer
This makes state tracking simpler, and enables easier porting to command lists later on.
This commit is contained in:
@ -15,7 +15,10 @@ AbstractTexture::AbstractTexture(const TextureConfig& c) : m_config(c)
|
||||
{
|
||||
}
|
||||
|
||||
AbstractTexture::~AbstractTexture() = default;
|
||||
AbstractTexture::~AbstractTexture()
|
||||
{
|
||||
g_renderer->UnbindTexture(this);
|
||||
}
|
||||
|
||||
bool AbstractTexture::Save(const std::string& filename, unsigned int level)
|
||||
{
|
||||
|
@ -17,8 +17,6 @@ public:
|
||||
explicit AbstractTexture(const TextureConfig& c);
|
||||
virtual ~AbstractTexture();
|
||||
|
||||
virtual void Bind(unsigned int stage) = 0;
|
||||
|
||||
virtual void CopyRectangleFromTexture(const AbstractTexture* src,
|
||||
const MathUtil::Rectangle<int>& src_rect, u32 src_layer,
|
||||
u32 src_level, const MathUtil::Rectangle<int>& dst_rect,
|
||||
|
@ -73,7 +73,9 @@ public:
|
||||
virtual void SetScissorRect(const EFBRectangle& rc) {}
|
||||
virtual void SetRasterizationState(const RasterizationState& state) {}
|
||||
virtual void SetDepthState(const DepthState& state) {}
|
||||
virtual void SetTexture(u32 index, const AbstractTexture* texture) {}
|
||||
virtual void SetSamplerState(u32 index, const SamplerState& state) {}
|
||||
virtual void UnbindTexture(const AbstractTexture* texture) {}
|
||||
virtual void SetInterlacingMode() {}
|
||||
virtual void SetViewport() {}
|
||||
virtual void SetFullscreen(bool enable_fullscreen) {}
|
||||
|
@ -470,10 +470,10 @@ static u32 CalculateLevelSize(u32 level_0_size, u32 level)
|
||||
|
||||
void TextureCacheBase::BindTextures()
|
||||
{
|
||||
for (size_t i = 0; i < bound_textures.size(); ++i)
|
||||
for (u32 i = 0; i < bound_textures.size(); i++)
|
||||
{
|
||||
if (IsValidBindPoint(static_cast<u32>(i)) && bound_textures[i])
|
||||
bound_textures[i]->texture->Bind(static_cast<u32>(i));
|
||||
if (IsValidBindPoint(i) && bound_textures[i])
|
||||
g_renderer->SetTexture(i, bound_textures[i]->texture.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user