rsx: Fix const RTV/DSV cast from texture cache

This commit is contained in:
kd-11 2022-12-15 15:56:00 +03:00 committed by kd-11
parent 66dc1cc15d
commit bf96cbe980
4 changed files with 12 additions and 2 deletions

View file

@ -113,6 +113,11 @@ namespace gl
{
return ensure(dynamic_cast<gl::render_target*>(t));
}
static inline const gl::render_target* as_rtt(const gl::texture* t)
{
return ensure(dynamic_cast<const gl::render_target*>(t));
}
}
struct gl_render_target_traits

View file

@ -393,7 +393,7 @@ namespace gl
return managed_texture.get();
}
gl::render_target* get_render_target()
gl::render_target* get_render_target() const
{
return gl::as_rtt(vram_texture);
}

View file

@ -85,6 +85,11 @@ namespace vk
return ensure(dynamic_cast<vk::render_target*>(t));
}
static inline const vk::render_target* as_rtt(const vk::image* t)
{
return ensure(dynamic_cast<const vk::render_target*>(t));
}
struct surface_cache_traits
{
using surface_storage_type = std::unique_ptr<vk::render_target>;

View file

@ -163,7 +163,7 @@ namespace vk
return managed_texture;
}
vk::render_target* get_render_target()
vk::render_target* get_render_target() const
{
return vk::as_rtt(vram_texture);
}