d3d: Migrate a few more things into common code.

This commit is contained in:
Unknown W. Brackets 2014-09-09 22:09:41 -07:00
parent 8ef326e531
commit ae2e8c5c7c
6 changed files with 30 additions and 62 deletions

View file

@ -102,10 +102,6 @@ enum {
FBO_OLD_AGE = 5,
};
bool FramebufferManager::MaskedEqual(u32 addr1, u32 addr2) {
return (addr1 & 0x03FFFFFF) == (addr2 & 0x03FFFFFF);
}
inline u16 RGBA8888toRGB565(u32 px) {
return ((px >> 3) & 0x001F) | ((px >> 5) & 0x07E0) | ((px >> 8) & 0xF800);
}
@ -640,26 +636,6 @@ void FramebufferManager::DrawActiveTexture(GLuint texture, float x, float y, flo
glsl_unbind();
}
VirtualFramebuffer *FramebufferManager::GetVFBAt(u32 addr) {
VirtualFramebuffer *match = NULL;
for (size_t i = 0; i < vfbs_.size(); ++i) {
VirtualFramebuffer *v = vfbs_[i];
if (MaskedEqual(v->fb_address, addr)) {
// Could check w too but whatever
if (match == NULL || match->last_frame_render < v->last_frame_render) {
match = v;
}
}
}
if (match != NULL) {
return match;
}
DEBUG_LOG(SCEGE, "Finding no FBO matching address %08x", addr);
return 0;
}
void FramebufferManager::DestroyFramebuf(VirtualFramebuffer *v) {
textureCache_->NotifyFramebuffer(v->fb_address, v, NOTIFY_FB_DESTROYED);
if (v->fbo) {