mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Rename the fbo_ functions to match the rest of DrawContext.
This commit is contained in:
parent
ad29974a56
commit
e42f5e6f46
12 changed files with 178 additions and 178 deletions
|
@ -262,7 +262,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
void FramebufferManagerDX9::DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) {
|
||||
if (useBufferedRendering_ && vfb && vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
D3DVIEWPORT9 vp{ 0, 0, vfb->renderWidth, vfb->renderHeight, 0.0f, 1.0f };
|
||||
pD3Ddevice->SetViewport(&vp);
|
||||
} else {
|
||||
|
@ -368,9 +368,9 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
void FramebufferManagerDX9::RebindFramebuffer() {
|
||||
if (currentRenderVfb_ && currentRenderVfb_->fbo) {
|
||||
draw_->fbo_bind_as_render_target(currentRenderVfb_->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo);
|
||||
} else {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
textureCache_->ForgetLastTexture();
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
if (!useBufferedRendering_) {
|
||||
if (vfb->fbo) {
|
||||
|
@ -428,11 +428,11 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
return;
|
||||
}
|
||||
|
||||
vfb->fbo = draw_->fbo_create({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, (Draw::FBColorDepth)vfb->colorDepth });
|
||||
vfb->fbo = draw_->CreateFramebuffer({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, (Draw::FBColorDepth)vfb->colorDepth });
|
||||
if (old.fbo) {
|
||||
INFO_LOG(SCEGE, "Resizing FBO for %08x : %i x %i x %i", vfb->fb_address, w, h, vfb->format);
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
ClearBuffer();
|
||||
if (!skipCopy && !g_Config.bDisableSlowFramebufEffects) {
|
||||
BlitFramebuffer(vfb, 0, 0, &old, 0, 0, std::min(vfb->bufferWidth, vfb->width), std::min(vfb->height, vfb->bufferHeight), 0);
|
||||
|
@ -440,7 +440,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
delete old.fbo;
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
void FramebufferManagerDX9::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) {
|
||||
if (!useBufferedRendering_) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
// Let's ignore rendering to targets that have not (yet) been displayed.
|
||||
gstate_c.skipDrawReason |= SKIPDRAW_NON_DISPLAYED_FB;
|
||||
}
|
||||
|
@ -480,10 +480,10 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
if (useBufferedRendering_) {
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
} else {
|
||||
// wtf? This should only happen very briefly when toggling bBufferedRendering
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
} else {
|
||||
if (vfb->fbo) {
|
||||
|
@ -492,7 +492,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
delete vfb->fbo;
|
||||
vfb->fbo = nullptr;
|
||||
}
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
// Let's ignore rendering to targets that have not (yet) been displayed.
|
||||
if (vfb->usageFlags & FB_USAGE_DISPLAYED_FRAMEBUFFER) {
|
||||
|
@ -550,7 +550,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
return;
|
||||
}
|
||||
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
|
||||
// Technically, we should at this point re-interpret the bytes of the old format to the new.
|
||||
// That might get tricky, and could cause unnecessary slowness in some games.
|
||||
|
@ -629,10 +629,10 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
bool matchingSize = src->width == dst->width && src->height == dst->height;
|
||||
if (matchingDepthBuffer && matchingSize) {
|
||||
// Doesn't work. Use a shader maybe?
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
LPDIRECT3DTEXTURE9 srcTex = (LPDIRECT3DTEXTURE9)draw_->fbo_get_api_texture(src->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 dstTex = (LPDIRECT3DTEXTURE9)draw_->fbo_get_api_texture(dst->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 srcTex = (LPDIRECT3DTEXTURE9)draw_->GetFramebufferAPITexture(src->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 dstTex = (LPDIRECT3DTEXTURE9)draw_->GetFramebufferAPITexture(dst->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
|
||||
if (srcTex && dstTex) {
|
||||
D3DSURFACE_DESC srcDesc;
|
||||
|
@ -682,10 +682,10 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
textureCache_->ForgetLastTexture();
|
||||
Draw::Framebuffer *fbo = draw_->fbo_create({ w, h, 1, 1, false, depth });
|
||||
Draw::Framebuffer *fbo = draw_->CreateFramebuffer({ w, h, 1, 1, false, depth });
|
||||
if (!fbo)
|
||||
return fbo;
|
||||
draw_->fbo_bind_as_render_target(fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(fbo);
|
||||
dxstate.viewport.force(0, 0, w, h);
|
||||
ClearBuffer(true);
|
||||
dxstate.viewport.restore();
|
||||
|
@ -772,19 +772,19 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
BlitFramebuffer(©Info, x, y, framebuffer, x, y, w, h, 0);
|
||||
|
||||
RebindFramebuffer();
|
||||
draw_->fbo_bind_as_texture(renderCopy, stage, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(renderCopy, stage, Draw::FB_COLOR_BIT, 0);
|
||||
} else {
|
||||
draw_->fbo_bind_as_texture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
|
||||
}
|
||||
} else {
|
||||
draw_->fbo_bind_as_texture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::CopyDisplayToOutput() {
|
||||
DownloadFramebufferOnSwitch(currentRenderVfb_);
|
||||
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
currentRenderVfb_ = 0;
|
||||
|
||||
if (displayFramebufPtr_ == 0) {
|
||||
|
@ -884,7 +884,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
if (vfb->fbo) {
|
||||
DEBUG_LOG(SCEGE, "Displaying FBO %08x", vfb->fb_address);
|
||||
DisableState();
|
||||
draw_->fbo_bind_as_texture(vfb->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(vfb->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
// Output coordinates
|
||||
float x, y, w, h;
|
||||
|
@ -899,7 +899,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
if (1) {
|
||||
const u32 rw = PSP_CoreParameter().pixelWidth;
|
||||
const u32 rh = PSP_CoreParameter().pixelHeight;
|
||||
bool result = draw_->fbo_blit(vfb->fbo,
|
||||
bool result = draw_->BlitFramebuffer(vfb->fbo,
|
||||
(LONG)(u0 * vfb->renderWidth), (LONG)(v0 * vfb->renderHeight), (LONG)(u1 * vfb->renderWidth), (LONG)(v1 * vfb->renderHeight),
|
||||
nullptr,
|
||||
(LONG)(x * rw / w), (LONG)(y * rh / h), (LONG)((x + w) * rw / w), (LONG)((y + h) * rh / h),
|
||||
|
@ -924,7 +924,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
/*
|
||||
else if (usePostShader_ && extraFBOs_.size() == 1 && !postShaderAtOutputResolution_) {
|
||||
// An additional pass, post-processing shader to the extra FBO.
|
||||
fbo_bind_as_render_target(extraFBOs_[0]);
|
||||
BindFramebufferAsRenderTarget(extraFBOs_[0]);
|
||||
int fbo_w, fbo_h;
|
||||
fbo_get_dimensions(extraFBOs_[0], &fbo_w, &fbo_h);
|
||||
DXSetViewport(0, 0, fbo_w, fbo_h);
|
||||
|
@ -1006,13 +1006,13 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
bool FramebufferManagerDX9::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb) {
|
||||
nvfb->colorDepth = Draw::FBO_8888;
|
||||
|
||||
nvfb->fbo = draw_->fbo_create({ nvfb->width, nvfb->height, 1, 1, true, (Draw::FBColorDepth)nvfb->colorDepth });
|
||||
nvfb->fbo = draw_->CreateFramebuffer({ nvfb->width, nvfb->height, 1, 1, true, (Draw::FBColorDepth)nvfb->colorDepth });
|
||||
if (!(nvfb->fbo)) {
|
||||
ERROR_LOG(SCEGE, "Error creating FBO! %i x %i", nvfb->renderWidth, nvfb->renderHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
draw_->fbo_bind_as_render_target(nvfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(nvfb->fbo);
|
||||
ClearBuffer();
|
||||
return true;
|
||||
}
|
||||
|
@ -1024,7 +1024,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
void FramebufferManagerDX9::BlitFramebuffer(VirtualFramebuffer *dst, int dstX, int dstY, VirtualFramebuffer *src, int srcX, int srcY, int w, int h, int bpp) {
|
||||
if (!dst->fbo || !src->fbo || !useBufferedRendering_) {
|
||||
// This can happen if they recently switched from non-buffered.
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
Draw::Framebuffer *srcFBO = src->fbo;
|
||||
if (src == dst) {
|
||||
Draw::Framebuffer *tempFBO = GetTempFBO(src->renderWidth, src->renderHeight, (Draw::FBColorDepth)src->colorDepth);
|
||||
bool result = draw_->fbo_blit(
|
||||
bool result = draw_->BlitFramebuffer(
|
||||
src->fbo, srcX1, srcY1, srcX2, srcY2,
|
||||
tempFBO, dstX1, dstY1, dstX2, dstY2,
|
||||
Draw::FB_COLOR_BIT, Draw::FB_BLIT_NEAREST);
|
||||
|
@ -1062,7 +1062,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
srcFBO = tempFBO;
|
||||
}
|
||||
}
|
||||
bool result = draw_->fbo_blit(
|
||||
bool result = draw_->BlitFramebuffer(
|
||||
srcFBO, srcX1, srcY1, srcX2, srcY2,
|
||||
dst->fbo, dstX1, dstY1, dstX2, dstY2,
|
||||
Draw::FB_COLOR_BIT, Draw::FB_BLIT_NEAREST);
|
||||
|
@ -1124,7 +1124,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
void FramebufferManagerDX9::PackFramebufferDirectx9_(VirtualFramebuffer *vfb, int x, int y, int w, int h) {
|
||||
if (!vfb->fbo) {
|
||||
ERROR_LOG_REPORT_ONCE(vfbfbozero, SCEGE, "PackFramebufferDirectx9_: vfb->fbo == 0");
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
// Right now that's always 8888.
|
||||
DEBUG_LOG(HLE, "Reading framebuffer to mem, fb_address = %08x", fb_address);
|
||||
|
||||
LPDIRECT3DSURFACE9 renderTarget = (LPDIRECT3DSURFACE9)draw_->fbo_get_api_texture(vfb->fbo, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0);
|
||||
LPDIRECT3DSURFACE9 renderTarget = (LPDIRECT3DSURFACE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0);
|
||||
D3DSURFACE_DESC desc;
|
||||
renderTarget->GetDesc(&desc);
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
DEBUG_LOG(SCEGE, "Reading depthbuffer to mem at %08x for vfb=%08x", z_address, vfb->fb_address);
|
||||
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->fbo_get_api_texture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
if (tex) {
|
||||
D3DSURFACE_DESC desc;
|
||||
D3DLOCKED_RECT locked;
|
||||
|
@ -1272,7 +1272,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
|
||||
void FramebufferManagerDX9::DecimateFBOs() {
|
||||
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
currentRenderVfb_ = 0;
|
||||
bool updateVram = !(g_Config.iRenderingMode == FB_NON_BUFFERED_MODE || g_Config.iRenderingMode == FB_BUFFERED_MODE);
|
||||
|
@ -1331,7 +1331,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
void FramebufferManagerDX9::DestroyAllFBOs(bool forceDelete) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
currentRenderVfb_ = 0;
|
||||
displayFramebuf_ = 0;
|
||||
prevDisplayFramebuf_ = 0;
|
||||
|
@ -1392,7 +1392,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
buffer = GPUDebugBuffer(Memory::GetPointer(fb_address | 0x04000000), fb_stride, 512, fb_format);
|
||||
return true;
|
||||
}
|
||||
LPDIRECT3DSURFACE9 renderTarget = vfb->fbo ? (LPDIRECT3DSURFACE9)draw_->fbo_get_api_texture(vfb->fbo, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0) : nullptr;
|
||||
LPDIRECT3DSURFACE9 renderTarget = vfb->fbo ? (LPDIRECT3DSURFACE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0) : nullptr;
|
||||
bool success = false;
|
||||
if (renderTarget) {
|
||||
Draw::Framebuffer *tempFBO = nullptr;
|
||||
|
@ -1402,9 +1402,9 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
// Let's resize. We must stretch to a render target first.
|
||||
w = vfb->width * maxRes;
|
||||
h = vfb->height * maxRes;
|
||||
tempFBO = draw_->fbo_create({ w, h, 1, 1, false, Draw::FBO_8888 });
|
||||
if (draw_->fbo_blit(vfb->fbo, 0, 0, vfb->renderWidth, vfb->renderHeight, tempFBO, 0, 0, w, h, Draw::FB_COLOR_BIT, g_Config.iBufFilter == SCALE_LINEAR ? Draw::FB_BLIT_LINEAR : Draw::FB_BLIT_NEAREST)) {
|
||||
renderTarget = (LPDIRECT3DSURFACE9)draw_->fbo_get_api_texture(tempFBO, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0);
|
||||
tempFBO = draw_->CreateFramebuffer({ w, h, 1, 1, false, Draw::FBO_8888 });
|
||||
if (draw_->BlitFramebuffer(vfb->fbo, 0, 0, vfb->renderWidth, vfb->renderHeight, tempFBO, 0, 0, w, h, Draw::FB_COLOR_BIT, g_Config.iBufFilter == SCALE_LINEAR ? Draw::FB_BLIT_LINEAR : Draw::FB_BLIT_NEAREST)) {
|
||||
renderTarget = (LPDIRECT3DSURFACE9)draw_->GetFramebufferAPITexture(tempFBO, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1421,7 +1421,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
bool FramebufferManagerDX9::GetOutputFramebuffer(GPUDebugBuffer &buffer) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
LPDIRECT3DSURFACE9 renderTarget = nullptr;
|
||||
HRESULT hr = pD3Ddevice->GetRenderTarget(0, &renderTarget);
|
||||
|
@ -1483,7 +1483,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
bool success = false;
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->fbo_get_api_texture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
if (tex) {
|
||||
D3DSURFACE_DESC desc;
|
||||
D3DLOCKED_RECT locked;
|
||||
|
@ -1527,7 +1527,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
|||
}
|
||||
|
||||
bool success = false;
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->fbo_get_api_texture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_DEPTH_BIT, 0);
|
||||
if (tex) {
|
||||
D3DSURFACE_DESC desc;
|
||||
D3DLOCKED_RECT locked;
|
||||
|
|
|
@ -221,7 +221,7 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, bool skipZer
|
|||
u16 h = dstBuffer->renderHeight;
|
||||
|
||||
if (dstBuffer->fbo) {
|
||||
draw_->fbo_bind_as_render_target(dstBuffer->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo);
|
||||
}
|
||||
D3DVIEWPORT9 vp{ 0, 0, w, h, 0.0f, 1.0f };
|
||||
pD3Ddevice->SetViewport(&vp);
|
||||
|
|
|
@ -780,7 +780,7 @@ void TextureCacheDX9::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFrame
|
|||
LPDIRECT3DTEXTURE9 clutTexture = depalShaderCache_->GetClutTexture(clutFormat, clutHash_, clutBuf_);
|
||||
|
||||
Draw::Framebuffer *depalFBO = framebufferManager_->GetTempFBO(framebuffer->renderWidth, framebuffer->renderHeight, Draw::FBO_8888);
|
||||
draw_->fbo_bind_as_render_target(depalFBO);
|
||||
draw_->BindFramebufferAsRenderTarget(depalFBO);
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
float xoff = -0.5f / framebuffer->renderWidth;
|
||||
|
@ -802,7 +802,7 @@ void TextureCacheDX9::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFrame
|
|||
|
||||
shaderApply.Shade();
|
||||
|
||||
draw_->fbo_bind_as_texture(depalFBO, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(depalFBO, 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16);
|
||||
const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor;
|
||||
|
|
|
@ -121,16 +121,16 @@ void FramebufferManagerGLES::SetNumExtraFBOs(int num) {
|
|||
extraFBOs_.clear();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// No depth/stencil for post processing
|
||||
Draw::Framebuffer *fbo = draw_->fbo_create({ (int)renderWidth_, (int)renderHeight_, 1, 1, false, Draw::FBO_8888 });
|
||||
Draw::Framebuffer *fbo = draw_->CreateFramebuffer({ (int)renderWidth_, (int)renderHeight_, 1, 1, false, Draw::FBO_8888 });
|
||||
extraFBOs_.push_back(fbo);
|
||||
|
||||
// The new FBO is still bound after creation, but let's bind it anyway.
|
||||
draw_->fbo_bind_as_render_target(fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(fbo);
|
||||
ClearBuffer();
|
||||
}
|
||||
|
||||
currentRenderVfb_ = 0;
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::CompileDraw2DProgram() {
|
||||
|
@ -362,7 +362,7 @@ void FramebufferManagerGLES::MakePixelTexture(const u8 *srcPixels, GEBufferForma
|
|||
void FramebufferManagerGLES::DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) {
|
||||
float v0 = 0.0f, v1 = 1.0f;
|
||||
if (useBufferedRendering_ && vfb && vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
glViewport(0, 0, vfb->renderWidth, vfb->renderHeight);
|
||||
} else {
|
||||
// We are drawing to the back buffer so need to flip.
|
||||
|
@ -551,9 +551,9 @@ void FramebufferManagerGLES::DestroyFramebuf(VirtualFramebuffer *v) {
|
|||
|
||||
void FramebufferManagerGLES::RebindFramebuffer() {
|
||||
if (currentRenderVfb_ && currentRenderVfb_->fbo) {
|
||||
draw_->fbo_bind_as_render_target(currentRenderVfb_->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo);
|
||||
} else {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE)
|
||||
glstate.viewport.restore();
|
||||
|
@ -603,7 +603,7 @@ void FramebufferManagerGLES::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u
|
|||
}
|
||||
|
||||
textureCache_->ForgetLastTexture();
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
if (!useBufferedRendering_) {
|
||||
if (vfb->fbo) {
|
||||
|
@ -613,11 +613,11 @@ void FramebufferManagerGLES::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u
|
|||
return;
|
||||
}
|
||||
|
||||
vfb->fbo = draw_->fbo_create({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, (Draw::FBColorDepth)vfb->colorDepth });
|
||||
vfb->fbo = draw_->CreateFramebuffer({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, (Draw::FBColorDepth)vfb->colorDepth });
|
||||
if (old.fbo) {
|
||||
INFO_LOG(SCEGE, "Resizing FBO for %08x : %i x %i x %i", vfb->fb_address, w, h, vfb->format);
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
ClearBuffer();
|
||||
if (!skipCopy && !g_Config.bDisableSlowFramebufEffects) {
|
||||
BlitFramebuffer(vfb, 0, 0, &old, 0, 0, std::min(vfb->bufferWidth, vfb->width), std::min(vfb->height, vfb->bufferHeight), 0);
|
||||
|
@ -625,7 +625,7 @@ void FramebufferManagerGLES::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u
|
|||
}
|
||||
delete old.fbo;
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -636,7 +636,7 @@ void FramebufferManagerGLES::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u
|
|||
|
||||
void FramebufferManagerGLES::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) {
|
||||
if (!useBufferedRendering_) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
// Let's ignore rendering to targets that have not (yet) been displayed.
|
||||
gstate_c.skipDrawReason |= SKIPDRAW_NON_DISPLAYED_FB;
|
||||
}
|
||||
|
@ -663,10 +663,10 @@ void FramebufferManagerGLES::NotifyRenderFramebufferSwitched(VirtualFramebuffer
|
|||
|
||||
if (useBufferedRendering_) {
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
} else {
|
||||
// wtf? This should only happen very briefly when toggling bBufferedRendering
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
} else {
|
||||
if (vfb->fbo) {
|
||||
|
@ -675,7 +675,7 @@ void FramebufferManagerGLES::NotifyRenderFramebufferSwitched(VirtualFramebuffer
|
|||
delete vfb->fbo;
|
||||
vfb->fbo = nullptr;
|
||||
}
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
// Let's ignore rendering to targets that have not (yet) been displayed.
|
||||
if (vfb->usageFlags & FB_USAGE_DISPLAYED_FRAMEBUFFER) {
|
||||
|
@ -747,7 +747,7 @@ void FramebufferManagerGLES::ReformatFramebufferFrom(VirtualFramebuffer *vfb, GE
|
|||
return;
|
||||
}
|
||||
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
|
||||
// Technically, we should at this point re-interpret the bytes of the old format to the new.
|
||||
// That might get tricky, and could cause unnecessary slowness in some games.
|
||||
|
@ -786,7 +786,7 @@ void FramebufferManagerGLES::BlitFramebufferDepth(VirtualFramebuffer *src, Virtu
|
|||
if (gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT | GPU_SUPPORTS_NV_FRAMEBUFFER_BLIT)) {
|
||||
// Let's only do this if not clearing depth.
|
||||
glstate.scissorTest.force(false);
|
||||
draw_->fbo_blit(src->fbo, 0, 0, w, h, dst->fbo, 0, 0, w, h, Draw::FB_DEPTH_BIT, Draw::FB_BLIT_NEAREST);
|
||||
draw_->BlitFramebuffer(src->fbo, 0, 0, w, h, dst->fbo, 0, 0, w, h, Draw::FB_DEPTH_BIT, Draw::FB_BLIT_NEAREST);
|
||||
// WARNING: If we set dst->depthUpdated here, our optimization above would be pointless.
|
||||
glstate.scissorTest.restore();
|
||||
}
|
||||
|
@ -802,10 +802,10 @@ Draw::Framebuffer *FramebufferManagerGLES::GetTempFBO(u16 w, u16 h, Draw::FBColo
|
|||
}
|
||||
|
||||
textureCache_->ForgetLastTexture();
|
||||
Draw::Framebuffer *fbo = draw_->fbo_create({ w, h, 1, 1, false, depth });
|
||||
Draw::Framebuffer *fbo = draw_->CreateFramebuffer({ w, h, 1, 1, false, depth });
|
||||
if (!fbo)
|
||||
return fbo;
|
||||
draw_->fbo_bind_as_render_target(fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(fbo);
|
||||
ClearBuffer(true);
|
||||
const TempFBO info = {fbo, gpuStats.numFlips};
|
||||
tempFBOs_[key] = info;
|
||||
|
@ -863,12 +863,12 @@ void FramebufferManagerGLES::BindFramebufferColor(int stage, u32 fbRawAddress, V
|
|||
|
||||
BlitFramebuffer(©Info, x, y, framebuffer, x, y, w, h, 0);
|
||||
|
||||
draw_->fbo_bind_as_texture(renderCopy, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(renderCopy, 0, Draw::FB_COLOR_BIT, 0);
|
||||
} else {
|
||||
draw_->fbo_bind_as_texture(framebuffer->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(framebuffer->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
}
|
||||
} else {
|
||||
draw_->fbo_bind_as_texture(framebuffer->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(framebuffer->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
}
|
||||
|
||||
if (stage != GL_TEXTURE0) {
|
||||
|
@ -906,7 +906,7 @@ void FramebufferManagerGLES::CopyDisplayToOutput() {
|
|||
DownloadFramebufferOnSwitch(currentRenderVfb_);
|
||||
|
||||
glstate.viewport.set(0, 0, pixelWidth_, pixelHeight_);
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
currentRenderVfb_ = 0;
|
||||
|
||||
if (displayFramebufPtr_ == 0) {
|
||||
|
@ -1015,7 +1015,7 @@ void FramebufferManagerGLES::CopyDisplayToOutput() {
|
|||
DEBUG_LOG(SCEGE, "Displaying FBO %08x", vfb->fb_address);
|
||||
DisableState();
|
||||
|
||||
draw_->fbo_bind_as_texture(vfb->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(vfb->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
int uvRotation = (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE) ? g_Config.iInternalScreenRotation : ROTATION_LOCKED_HORIZONTAL;
|
||||
|
||||
|
@ -1049,16 +1049,16 @@ void FramebufferManagerGLES::CopyDisplayToOutput() {
|
|||
}
|
||||
} else if (usePostShader_ && extraFBOs_.size() == 1 && !postShaderAtOutputResolution_) {
|
||||
// An additional pass, post-processing shader to the extra FBO.
|
||||
draw_->fbo_bind_as_render_target(extraFBOs_[0]);
|
||||
draw_->BindFramebufferAsRenderTarget(extraFBOs_[0]);
|
||||
int fbo_w, fbo_h;
|
||||
draw_->fbo_get_dimensions(extraFBOs_[0], &fbo_w, &fbo_h);
|
||||
draw_->GetFramebufferDimensions(extraFBOs_[0], &fbo_w, &fbo_h);
|
||||
glstate.viewport.set(0, 0, fbo_w, fbo_h);
|
||||
shaderManager_->DirtyLastShader(); // dirty lastShader_
|
||||
glsl_bind(postShaderProgram_);
|
||||
UpdatePostShaderUniforms(vfb->bufferWidth, vfb->bufferHeight, renderWidth_, renderHeight_);
|
||||
DrawActiveTexture(0, 0, 0, fbo_w, fbo_h, fbo_w, fbo_h, 0.0f, 0.0f, 1.0f, 1.0f, postShaderProgram_, ROTATION_LOCKED_HORIZONTAL);
|
||||
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
|
||||
// Use the extra FBO, with applied post-processing shader, as a texture.
|
||||
// fbo_bind_as_texture(extraFBOs_[0], FB_COLOR_BIT, 0);
|
||||
|
@ -1066,7 +1066,7 @@ void FramebufferManagerGLES::CopyDisplayToOutput() {
|
|||
ERROR_LOG(G3D, "WTF?");
|
||||
return;
|
||||
}
|
||||
draw_->fbo_bind_as_texture(extraFBOs_[0], 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(extraFBOs_[0], 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
// We are doing the DrawActiveTexture call directly to the backbuffer after here. Hence, we must
|
||||
// flip V.
|
||||
|
@ -1087,7 +1087,7 @@ void FramebufferManagerGLES::CopyDisplayToOutput() {
|
|||
}
|
||||
|
||||
if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) {
|
||||
draw_->fbo_bind_as_render_target(extraFBOs_[0]);
|
||||
draw_->BindFramebufferAsRenderTarget(extraFBOs_[0]);
|
||||
GLenum attachments[3] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT };
|
||||
glInvalidateFramebuffer(GL_FRAMEBUFFER, 3, attachments);
|
||||
}
|
||||
|
@ -1212,13 +1212,13 @@ bool FramebufferManagerGLES::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb)
|
|||
}
|
||||
}
|
||||
|
||||
nvfb->fbo = draw_->fbo_create({ nvfb->width, nvfb->height, 1, 1, false, (Draw::FBColorDepth)nvfb->colorDepth });
|
||||
nvfb->fbo = draw_->CreateFramebuffer({ nvfb->width, nvfb->height, 1, 1, false, (Draw::FBColorDepth)nvfb->colorDepth });
|
||||
if (!nvfb->fbo) {
|
||||
ERROR_LOG(SCEGE, "Error creating FBO! %i x %i", nvfb->renderWidth, nvfb->renderHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
draw_->fbo_bind_as_render_target(nvfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(nvfb->fbo);
|
||||
ClearBuffer();
|
||||
glDisable(GL_DITHER);
|
||||
return true;
|
||||
|
@ -1229,11 +1229,11 @@ void FramebufferManagerGLES::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb)
|
|||
|
||||
// Discard the previous contents of this buffer where possible.
|
||||
if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) {
|
||||
draw_->fbo_bind_as_render_target(nvfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(nvfb->fbo);
|
||||
GLenum attachments[3] = { GL_COLOR_ATTACHMENT0, GL_STENCIL_ATTACHMENT, GL_DEPTH_ATTACHMENT };
|
||||
glInvalidateFramebuffer(GL_FRAMEBUFFER, 3, attachments);
|
||||
} else if (gl_extensions.IsGLES) {
|
||||
draw_->fbo_bind_as_render_target(nvfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(nvfb->fbo);
|
||||
ClearBuffer();
|
||||
}
|
||||
}
|
||||
|
@ -1241,7 +1241,7 @@ void FramebufferManagerGLES::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb)
|
|||
void FramebufferManagerGLES::BlitFramebuffer(VirtualFramebuffer *dst, int dstX, int dstY, VirtualFramebuffer *src, int srcX, int srcY, int w, int h, int bpp) {
|
||||
if (!dst->fbo || !src->fbo || !useBufferedRendering_) {
|
||||
// This can happen if they recently switched from non-buffered.
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1286,17 +1286,17 @@ void FramebufferManagerGLES::BlitFramebuffer(VirtualFramebuffer *dst, int dstX,
|
|||
const bool xOverlap = src == dst && srcX2 > dstX1 && srcX1 < dstX2;
|
||||
const bool yOverlap = src == dst && srcY2 > dstY1 && srcY1 < dstY2;
|
||||
if (sameSize && sameDepth && srcInsideBounds && dstInsideBounds && !(xOverlap && yOverlap)) {
|
||||
draw_->fbo_copy_image(src->fbo, 0, srcX1, srcY1, 0, dst->fbo, 0, dstX1, dstY1, 0, dstX2 - dstX1, dstY2 - dstY1, 1);
|
||||
draw_->CopyFramebufferImage(src->fbo, 0, srcX1, srcY1, 0, dst->fbo, 0, dstX1, dstY1, 0, dstX2 - dstX1, dstY2 - dstY1, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
glstate.scissorTest.force(false);
|
||||
if (useBlit) {
|
||||
draw_->fbo_blit(src->fbo, srcX1, srcY1, srcX2, srcY2, dst->fbo, dstX1, dstY1, dstX2, dstY2, Draw::FB_COLOR_BIT, Draw::FB_BLIT_NEAREST);
|
||||
draw_->BlitFramebuffer(src->fbo, srcX1, srcY1, srcX2, srcY2, dst->fbo, dstX1, dstY1, dstX2, dstY2, Draw::FB_COLOR_BIT, Draw::FB_BLIT_NEAREST);
|
||||
} else {
|
||||
draw_->fbo_bind_as_render_target(dst->fbo);
|
||||
draw_->fbo_bind_as_texture(src->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsRenderTarget(dst->fbo);
|
||||
draw_->BindFramebufferAsTexture(src->fbo, 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
// Make sure our 2D drawing program is ready. Compiles only if not already compiled.
|
||||
CompileDraw2DProgram();
|
||||
|
@ -1576,7 +1576,7 @@ void FramebufferManagerGLES::PackFramebufferAsync_(VirtualFramebuffer *vfb) {
|
|||
u32 fb_address = (0x04000000) | vfb->fb_address;
|
||||
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(vfbfbozero, SCEGE, "PackFramebufferAsync_: vfb->fbo == 0");
|
||||
return;
|
||||
|
@ -1619,7 +1619,7 @@ void FramebufferManagerGLES::PackFramebufferAsync_(VirtualFramebuffer *vfb) {
|
|||
|
||||
void FramebufferManagerGLES::PackFramebufferSync_(VirtualFramebuffer *vfb, int x, int y, int w, int h) {
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(vfbfbozero, SCEGE, "PackFramebufferSync_: vfb->fbo == 0");
|
||||
return;
|
||||
|
@ -1673,7 +1673,7 @@ void FramebufferManagerGLES::PackFramebufferSync_(VirtualFramebuffer *vfb, int x
|
|||
if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) {
|
||||
#ifdef USING_GLES2
|
||||
// GLES3 doesn't support using GL_READ_FRAMEBUFFER here.
|
||||
draw_->fbo_bind_as_render_target(vfb->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(vfb->fbo);
|
||||
const GLenum target = GL_FRAMEBUFFER;
|
||||
#else
|
||||
const GLenum target = GL_READ_FRAMEBUFFER;
|
||||
|
@ -1685,7 +1685,7 @@ void FramebufferManagerGLES::PackFramebufferSync_(VirtualFramebuffer *vfb, int x
|
|||
|
||||
void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int y, int w, int h) {
|
||||
if (vfb->fbo) {
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(vfbfbozero, SCEGE, "PackDepthbuffer: vfb->fbo == 0");
|
||||
return;
|
||||
|
@ -1788,11 +1788,11 @@ void FramebufferManagerGLES::EndFrame() {
|
|||
continue;
|
||||
}
|
||||
|
||||
draw_->fbo_bind_as_render_target(temp.second.fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(temp.second.fbo);
|
||||
GLenum attachments[3] = { GL_COLOR_ATTACHMENT0, GL_STENCIL_ATTACHMENT, GL_DEPTH_ATTACHMENT };
|
||||
glInvalidateFramebuffer(GL_FRAMEBUFFER, 3, attachments);
|
||||
}
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1822,7 +1822,7 @@ std::vector<FramebufferInfo> FramebufferManagerGLES::GetFramebufferList() {
|
|||
}
|
||||
|
||||
void FramebufferManagerGLES::DecimateFBOs() {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
currentRenderVfb_ = 0;
|
||||
|
||||
for (size_t i = 0; i < vfbs_.size(); ++i) {
|
||||
|
@ -1869,7 +1869,7 @@ void FramebufferManagerGLES::DecimateFBOs() {
|
|||
}
|
||||
|
||||
void FramebufferManagerGLES::DestroyAllFBOs(bool forceDelete) {
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
currentRenderVfb_ = 0;
|
||||
displayFramebuf_ = 0;
|
||||
prevDisplayFramebuf_ = 0;
|
||||
|
@ -1893,7 +1893,7 @@ void FramebufferManagerGLES::DestroyAllFBOs(bool forceDelete) {
|
|||
}
|
||||
tempFBOs_.clear();
|
||||
|
||||
draw_->fbo_bind_backbuffer_as_render_target();
|
||||
draw_->BindBackbufferAsRenderTarget();
|
||||
DisableState();
|
||||
}
|
||||
|
||||
|
@ -1939,9 +1939,9 @@ bool FramebufferManagerGLES::GetFramebuffer(u32 fb_address, int fb_stride, GEBuf
|
|||
tempVfb.renderHeight = h;
|
||||
BlitFramebuffer(&tempVfb, 0, 0, vfb, 0, 0, vfb->width, vfb->height, 0);
|
||||
|
||||
draw_->fbo_bind_for_read(tempFBO);
|
||||
draw_->BindFramebufferForRead(tempFBO);
|
||||
} else {
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1986,7 +1986,7 @@ bool FramebufferManagerGLES::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z
|
|||
buffer.Allocate(vfb->renderWidth, vfb->renderHeight, GPU_DBG_FORMAT_FLOAT, !useBufferedRendering_);
|
||||
}
|
||||
if (vfb->fbo)
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
if (gl_extensions.GLES3 || !gl_extensions.IsGLES)
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 4);
|
||||
|
@ -2011,7 +2011,7 @@ bool FramebufferManagerGLES::GetStencilbuffer(u32 fb_address, int fb_stride, GPU
|
|||
#ifndef USING_GLES2
|
||||
buffer.Allocate(vfb->renderWidth, vfb->renderHeight, GPU_DBG_FORMAT_8BIT, !useBufferedRendering_);
|
||||
if (vfb->fbo)
|
||||
draw_->fbo_bind_for_read(vfb->fbo);
|
||||
draw_->BindFramebufferForRead(vfb->fbo);
|
||||
if (gl_extensions.GLES3 || !gl_extensions.IsGLES)
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 2);
|
||||
|
|
|
@ -183,9 +183,9 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
|
|||
Draw::Framebuffer *blitFBO = nullptr;
|
||||
if (useBlit) {
|
||||
blitFBO = GetTempFBO(w, h, Draw::FBO_8888);
|
||||
draw_->fbo_bind_as_render_target(blitFBO);
|
||||
draw_->BindFramebufferAsRenderTarget(blitFBO);
|
||||
} else if (dstBuffer->fbo) {
|
||||
draw_->fbo_bind_as_render_target(dstBuffer->fbo);
|
||||
draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo);
|
||||
}
|
||||
glViewport(0, 0, w, h);
|
||||
|
||||
|
@ -220,7 +220,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
|
|||
glstate.stencilMask.set(0xFF);
|
||||
|
||||
if (useBlit) {
|
||||
draw_->fbo_blit(blitFBO, 0, 0, w, h, dstBuffer->fbo, 0, 0, dstBuffer->renderWidth, dstBuffer->renderHeight, Draw::FB_STENCIL_BIT, Draw::FB_BLIT_NEAREST);
|
||||
draw_->BlitFramebuffer(blitFBO, 0, 0, w, h, dstBuffer->fbo, 0, 0, dstBuffer->renderWidth, dstBuffer->renderHeight, Draw::FB_STENCIL_BIT, Draw::FB_BLIT_NEAREST);
|
||||
}
|
||||
|
||||
RebindFramebuffer();
|
||||
|
|
|
@ -850,7 +850,7 @@ void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFram
|
|||
if (depal) {
|
||||
GLuint clutTexture = depalShaderCache_->GetClutTexture(clutFormat, clutHash_, clutBuf_);
|
||||
Draw::Framebuffer *depalFBO = framebufferManager_->GetTempFBO(framebuffer->renderWidth, framebuffer->renderHeight, Draw::FBO_8888);
|
||||
draw_->fbo_bind_as_render_target(depalFBO);
|
||||
draw_->BindFramebufferAsRenderTarget(depalFBO);
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
TextureShaderApplier shaderApply(depal, framebuffer->bufferWidth, framebuffer->bufferHeight, framebuffer->renderWidth, framebuffer->renderHeight);
|
||||
|
@ -867,7 +867,7 @@ void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFram
|
|||
|
||||
shaderApply.Shade();
|
||||
|
||||
draw_->fbo_bind_as_texture(depalFBO, 0, Draw::FB_COLOR_BIT, 0);
|
||||
draw_->BindFramebufferAsTexture(depalFBO, 0, Draw::FB_COLOR_BIT, 0);
|
||||
|
||||
const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16);
|
||||
const u32 clutTotalColors = clutMaxBytes_ / bytesPerColor;
|
||||
|
|
|
@ -621,7 +621,7 @@ void FramebufferManagerVulkan::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w,
|
|||
if (old.fbo) {
|
||||
INFO_LOG(SCEGE, "Resizing FBO for %08x : %i x %i x %i", vfb->fb_address, w, h, vfb->format);
|
||||
if (vfb->fbo) {
|
||||
/// fbo_bind_as_render_target(vfb->fbo);
|
||||
/// BindFramebufferAsRenderTargetvfb->fbo);
|
||||
ClearBuffer();
|
||||
if (!skipCopy && !g_Config.bDisableSlowFramebufEffects) {
|
||||
BlitFramebuffer(vfb, 0, 0, &old, 0, 0, std::min(vfb->bufferWidth, vfb->width), std::min(vfb->height, vfb->bufferHeight), 0);
|
||||
|
@ -629,7 +629,7 @@ void FramebufferManagerVulkan::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w,
|
|||
}
|
||||
delete old.fbo;
|
||||
if (vfb->fbo) {
|
||||
// fbo_bind_as_render_target(vfb->fbo);
|
||||
// BindFramebufferAsRenderTargetvfb->fbo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -736,7 +736,7 @@ void FramebufferManagerVulkan::ReformatFramebufferFrom(VirtualFramebuffer *vfb,
|
|||
}
|
||||
|
||||
/*
|
||||
fbo_bind_as_render_target(vfb->fbo);
|
||||
BindFramebufferAsRenderTargetvfb->fbo);
|
||||
|
||||
// Technically, we should at this point re-interpret the bytes of the old format to the new.
|
||||
// That might get tricky, and could cause unnecessary slowness in some games.
|
||||
|
@ -1001,7 +1001,7 @@ void FramebufferManagerVulkan::CopyDisplayToOutput() {
|
|||
} else if (usePostShader_ && !postShaderAtOutputResolution_) {
|
||||
// An additional pass, post-processing shader to the extra FBO.
|
||||
/*
|
||||
fbo_bind_as_render_target(extraFBOs_[0]);
|
||||
BindFramebufferAsRenderTargetextraFBOs_[0]);
|
||||
int fbo_w, fbo_h;
|
||||
fbo_get_dimensions(extraFBOs_[0], &fbo_w, &fbo_h);
|
||||
glstate.viewport.set(0, 0, fbo_w, fbo_h);
|
||||
|
@ -1137,13 +1137,13 @@ bool FramebufferManagerVulkan::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb
|
|||
}
|
||||
|
||||
/*
|
||||
nvfb->fbo = fbo_create(nvfb->width, nvfb->height, 1, false, (FBOColorDepth)nvfb->colorDepth);
|
||||
nvfb->fbo = CreateFramebuffer(nvfb->width, nvfb->height, 1, false, (FBOColorDepth)nvfb->colorDepth);
|
||||
if (!(nvfb->fbo)) {
|
||||
ERROR_LOG(SCEGE, "Error creating FBO! %i x %i", nvfb->renderWidth, nvfb->renderHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
fbo_bind_as_render_target(nvfb->fbo);
|
||||
BindFramebufferAsRenderTargetnvfb->fbo);
|
||||
ClearBuffer();
|
||||
glDisable(GL_DITHER);
|
||||
*/
|
||||
|
@ -1156,11 +1156,11 @@ void FramebufferManagerVulkan::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb
|
|||
// Discard the previous contents of this buffer where possible.
|
||||
/*
|
||||
if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) {
|
||||
fbo_bind_as_render_target(nvfb->fbo);
|
||||
BindFramebufferAsRenderTargetnvfb->fbo);
|
||||
GLenum attachments[3] = { GL_COLOR_ATTACHMENT0, GL_STENCIL_ATTACHMENT, GL_DEPTH_ATTACHMENT };
|
||||
glInvalidateFramebuffer(GL_FRAMEBUFFER, 3, attachments);
|
||||
} else if (gl_extensions.IsGLES) {
|
||||
fbo_bind_as_render_target(nvfb->fbo);
|
||||
BindFramebufferAsRenderTargetnvfb->fbo);
|
||||
ClearBuffer();
|
||||
}
|
||||
*/
|
||||
|
@ -1223,7 +1223,7 @@ void FramebufferManagerVulkan::BlitFramebuffer(VirtualFramebuffer *dst, int dstX
|
|||
return;
|
||||
}
|
||||
|
||||
// fbo_bind_as_render_target(dst->fbo);
|
||||
// BindFramebufferAsRenderTargetdst->fbo);
|
||||
|
||||
if (useBlit) {
|
||||
// fbo_bind_for_read(src->fbo);
|
||||
|
|
|
@ -559,26 +559,26 @@ public:
|
|||
virtual Buffer *CreateBuffer(size_t size, uint32_t usageFlags) = 0;
|
||||
virtual Texture *CreateTexture(const TextureDesc &desc) = 0;
|
||||
// On some hardware, you might get a 24-bit depth buffer even though you only wanted a 16-bit one.
|
||||
virtual Framebuffer *fbo_create(const FramebufferDesc &desc) = 0;
|
||||
virtual Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) = 0;
|
||||
|
||||
virtual ShaderModule *CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize) = 0;
|
||||
virtual Pipeline *CreateGraphicsPipeline(const PipelineDesc &desc) = 0;
|
||||
|
||||
virtual void fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) = 0;
|
||||
virtual bool fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) = 0;
|
||||
virtual void CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) = 0;
|
||||
virtual bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) = 0;
|
||||
|
||||
virtual int fbo_preferred_z_bitdepth() = 0;
|
||||
|
||||
// These functions should be self explanatory.
|
||||
virtual void fbo_bind_as_render_target(Framebuffer *fbo) = 0;
|
||||
virtual void BindFramebufferAsRenderTarget(Framebuffer *fbo) = 0;
|
||||
// color must be 0, for now.
|
||||
virtual void fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) = 0;
|
||||
virtual void fbo_bind_for_read(Framebuffer *fbo) = 0;
|
||||
virtual void BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) = 0;
|
||||
virtual void BindFramebufferForRead(Framebuffer *fbo) = 0;
|
||||
|
||||
virtual void fbo_bind_backbuffer_as_render_target() = 0;
|
||||
virtual uintptr_t fbo_get_api_texture(Framebuffer *fbo, int channelBits, int attachment) = 0;
|
||||
virtual void BindBackbufferAsRenderTarget() = 0;
|
||||
virtual uintptr_t GetFramebufferAPITexture(Framebuffer *fbo, int channelBits, int attachment) = 0;
|
||||
|
||||
virtual void fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) = 0;
|
||||
virtual void GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) = 0;
|
||||
|
||||
// Dynamic state
|
||||
virtual void SetScissorRect(int left, int top, int width, int height) = 0;
|
||||
|
|
|
@ -39,15 +39,15 @@ public:
|
|||
Pipeline *CreateGraphicsPipeline(const PipelineDesc &desc) override;
|
||||
Texture *CreateTexture(const TextureDesc &desc) override;
|
||||
ShaderModule *CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize) override;
|
||||
Framebuffer *fbo_create(const FramebufferDesc &desc) override;
|
||||
Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) override;
|
||||
|
||||
void fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override;
|
||||
bool fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
|
||||
int fbo_preferred_z_bitdepth() override;
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void fbo_bind_as_render_target(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsRenderTarget(Framebuffer *fbo) override;
|
||||
// color must be 0, for now.
|
||||
void fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void fbo_bind_for_read(Framebuffer *fbo) override;
|
||||
|
@ -546,7 +546,7 @@ public:
|
|||
int height;
|
||||
};
|
||||
|
||||
Framebuffer *D3D11DrawContext::fbo_create(const FramebufferDesc &desc) {
|
||||
Framebuffer *D3D11DrawContext::CreateFramebuffer(const FramebufferDesc &desc) {
|
||||
D3D11Framebuffer *fb = new D3D11Framebuffer();
|
||||
fb->width = desc.width;
|
||||
fb->height = desc.height;
|
||||
|
@ -555,12 +555,12 @@ Framebuffer *D3D11DrawContext::fbo_create(const FramebufferDesc &desc) {
|
|||
}
|
||||
|
||||
void D3D11DrawContext::fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) {}
|
||||
bool D3D11DrawContext::fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) { return true; }
|
||||
bool D3D11DrawContext::BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) { return true; }
|
||||
|
||||
int D3D11DrawContext::fbo_preferred_z_bitdepth() { return 24; }
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void D3D11DrawContext::fbo_bind_as_render_target(Framebuffer *fbo) {}
|
||||
void D3D11DrawContext::BindFramebufferAsRenderTarget(Framebuffer *fbo) {}
|
||||
// color must be 0, for now.
|
||||
void D3D11DrawContext::fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) {}
|
||||
void D3D11DrawContext::fbo_bind_for_read(Framebuffer *fbo) {}
|
||||
|
|
|
@ -549,22 +549,22 @@ public:
|
|||
InputLayout *CreateInputLayout(const InputLayoutDesc &desc) override;
|
||||
Texture *CreateTexture(const TextureDesc &desc) override;
|
||||
|
||||
Framebuffer *fbo_create(const FramebufferDesc &desc) override;
|
||||
void fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override {}
|
||||
bool fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) override;
|
||||
void CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override {}
|
||||
bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
|
||||
int fbo_preferred_z_bitdepth() override { return 24; }
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void fbo_bind_as_render_target(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsRenderTarget(Framebuffer *fbo) override;
|
||||
// color must be 0, for now.
|
||||
void fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void fbo_bind_for_read(Framebuffer *fbo) override {}
|
||||
void BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void BindFramebufferForRead(Framebuffer *fbo) override {}
|
||||
|
||||
void fbo_bind_backbuffer_as_render_target() override;
|
||||
uintptr_t fbo_get_api_texture(Framebuffer *fbo, int channelBits, int attachment) override;
|
||||
void BindBackbufferAsRenderTarget() override;
|
||||
uintptr_t GetFramebufferAPITexture(Framebuffer *fbo, int channelBits, int attachment) override;
|
||||
|
||||
void fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
void GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
|
||||
void BindTextures(int start, int count, Texture **textures) override;
|
||||
void BindSamplerStates(int start, int count, SamplerState **states) override {
|
||||
|
@ -1002,7 +1002,7 @@ public:
|
|||
FBColorDepth colorDepth;
|
||||
};
|
||||
|
||||
Framebuffer *D3D9Context::fbo_create(const FramebufferDesc &desc) {
|
||||
Framebuffer *D3D9Context::CreateFramebuffer(const FramebufferDesc &desc) {
|
||||
static uint32_t id = 0;
|
||||
|
||||
D3D9Framebuffer *fbo = new D3D9Framebuffer{};
|
||||
|
@ -1051,7 +1051,7 @@ D3D9Framebuffer::~D3D9Framebuffer() {
|
|||
}
|
||||
}
|
||||
|
||||
void D3D9Context::fbo_bind_backbuffer_as_render_target() {
|
||||
void D3D9Context::BindBackbufferAsRenderTarget() {
|
||||
using namespace DX9;
|
||||
|
||||
device_->SetRenderTarget(0, deviceRTsurf);
|
||||
|
@ -1060,7 +1060,7 @@ void D3D9Context::fbo_bind_backbuffer_as_render_target() {
|
|||
dxstate.viewport.restore();
|
||||
}
|
||||
|
||||
void D3D9Context::fbo_bind_as_render_target(Framebuffer *fbo) {
|
||||
void D3D9Context::BindFramebufferAsRenderTarget(Framebuffer *fbo) {
|
||||
using namespace DX9;
|
||||
|
||||
D3D9Framebuffer *fb = (D3D9Framebuffer *)fbo;
|
||||
|
@ -1070,7 +1070,7 @@ void D3D9Context::fbo_bind_as_render_target(Framebuffer *fbo) {
|
|||
dxstate.viewport.restore();
|
||||
}
|
||||
|
||||
uintptr_t D3D9Context::fbo_get_api_texture(Framebuffer *fbo, int channelBits, int attachment) {
|
||||
uintptr_t D3D9Context::GetFramebufferAPITexture(Framebuffer *fbo, int channelBits, int attachment) {
|
||||
D3D9Framebuffer *fb = (D3D9Framebuffer *)fbo;
|
||||
if (channelBits & FB_SURFACE_BIT) {
|
||||
switch (channelBits & 7) {
|
||||
|
@ -1099,7 +1099,7 @@ LPDIRECT3DSURFACE9 fbo_get_color_for_read(D3D9Framebuffer *fbo) {
|
|||
return fbo->surf;
|
||||
}
|
||||
|
||||
void D3D9Context::fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int color) {
|
||||
void D3D9Context::BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int color) {
|
||||
D3D9Framebuffer *fb = (D3D9Framebuffer *)fbo;
|
||||
switch (channelBit) {
|
||||
case FB_DEPTH_BIT:
|
||||
|
@ -1116,13 +1116,13 @@ void D3D9Context::fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel c
|
|||
}
|
||||
}
|
||||
|
||||
void D3D9Context::fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
void D3D9Context::GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
D3D9Framebuffer *fb = (D3D9Framebuffer *)fbo;
|
||||
*w = fb->width;
|
||||
*h = fb->height;
|
||||
}
|
||||
|
||||
bool D3D9Context::fbo_blit(Framebuffer *srcfb, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dstfb, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) {
|
||||
bool D3D9Context::BlitFramebuffer(Framebuffer *srcfb, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dstfb, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) {
|
||||
D3D9Framebuffer *src = (D3D9Framebuffer *)srcfb;
|
||||
D3D9Framebuffer *dst = (D3D9Framebuffer *)dstfb;
|
||||
if (channelBits != FB_COLOR_BIT)
|
||||
|
|
|
@ -518,23 +518,23 @@ public:
|
|||
|
||||
Texture *CreateTexture(const TextureDesc &desc) override;
|
||||
Buffer *CreateBuffer(size_t size, uint32_t usageFlags) override;
|
||||
Framebuffer *fbo_create(const FramebufferDesc &desc) override;
|
||||
Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) override;
|
||||
|
||||
void fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override;
|
||||
bool fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
void CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override;
|
||||
bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
|
||||
int fbo_preferred_z_bitdepth() override;
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void fbo_bind_as_render_target(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsRenderTarget(Framebuffer *fbo) override;
|
||||
// color must be 0, for now.
|
||||
void fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void fbo_bind_for_read(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void BindFramebufferForRead(Framebuffer *fbo) override;
|
||||
|
||||
void fbo_bind_backbuffer_as_render_target() override;
|
||||
uintptr_t fbo_get_api_texture(Framebuffer *fbo, int channelBits, int attachment) override;
|
||||
void BindBackbufferAsRenderTarget() override;
|
||||
uintptr_t GetFramebufferAPITexture(Framebuffer *fbo, int channelBits, int attachment) override;
|
||||
|
||||
void fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
void GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
|
||||
void BindSamplerStates(int start, int count, SamplerState **states) override {
|
||||
if (samplerStates_.size() < (size_t)(start + count)) {
|
||||
|
@ -1302,7 +1302,7 @@ OpenGLFramebuffer *OpenGLContext::fbo_ext_create(const FramebufferDesc &desc) {
|
|||
#endif
|
||||
|
||||
int OpenGLContext::fbo_preferred_z_bitdepth() {
|
||||
// This matches the fbo_create() logic.
|
||||
// This matches the CreateFramebuffer() logic.
|
||||
if (gl_extensions.IsGLES) {
|
||||
if (gl_extensions.OES_packed_depth_stencil) {
|
||||
return 24;
|
||||
|
@ -1313,7 +1313,7 @@ int OpenGLContext::fbo_preferred_z_bitdepth() {
|
|||
}
|
||||
}
|
||||
|
||||
Framebuffer *OpenGLContext::fbo_create(const FramebufferDesc &desc) {
|
||||
Framebuffer *OpenGLContext::CreateFramebuffer(const FramebufferDesc &desc) {
|
||||
CheckGLExtensions();
|
||||
|
||||
#ifndef USING_GLES2
|
||||
|
@ -1493,7 +1493,7 @@ void OpenGLContext::fbo_unbind() {
|
|||
currentReadHandle_ = 0;
|
||||
}
|
||||
|
||||
void OpenGLContext::fbo_bind_as_render_target(Framebuffer *fbo) {
|
||||
void OpenGLContext::BindFramebufferAsRenderTarget(Framebuffer *fbo) {
|
||||
OpenGLFramebuffer *fb = (OpenGLFramebuffer *)fbo;
|
||||
// Without FBO_ARB / GLES3, this will collide with bind_for_read, but there's nothing
|
||||
// in ES 2.0 that actually separate them anyway of course, so doesn't matter.
|
||||
|
@ -1502,17 +1502,17 @@ void OpenGLContext::fbo_bind_as_render_target(Framebuffer *fbo) {
|
|||
glstate.viewport.restore();
|
||||
}
|
||||
|
||||
void OpenGLContext::fbo_bind_backbuffer_as_render_target() {
|
||||
void OpenGLContext::BindBackbufferAsRenderTarget() {
|
||||
fbo_unbind();
|
||||
}
|
||||
|
||||
// For GL_EXT_FRAMEBUFFER_BLIT and similar.
|
||||
void OpenGLContext::fbo_bind_for_read(Framebuffer *fbo) {
|
||||
void OpenGLContext::BindFramebufferForRead(Framebuffer *fbo) {
|
||||
OpenGLFramebuffer *fb = (OpenGLFramebuffer *)fbo;
|
||||
fbo_bind_fb_target(true, fb->handle);
|
||||
}
|
||||
|
||||
void OpenGLContext::fbo_copy_image(Framebuffer *fbsrc, int srcLevel, int srcX, int srcY, int srcZ, Framebuffer *fbdst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) {
|
||||
void OpenGLContext::CopyFramebufferImage(Framebuffer *fbsrc, int srcLevel, int srcX, int srcY, int srcZ, Framebuffer *fbdst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) {
|
||||
OpenGLFramebuffer *src = (OpenGLFramebuffer *)fbsrc;
|
||||
OpenGLFramebuffer *dst = (OpenGLFramebuffer *)fbdst;
|
||||
#if defined(USING_GLES2)
|
||||
|
@ -1541,7 +1541,7 @@ void OpenGLContext::fbo_copy_image(Framebuffer *fbsrc, int srcLevel, int srcX, i
|
|||
#endif
|
||||
}
|
||||
|
||||
bool OpenGLContext::fbo_blit(Framebuffer *fbsrc, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *fbdst, int dstX1, int dstY1, int dstX2, int dstY2, int channels, FBBlitFilter linearFilter) {
|
||||
bool OpenGLContext::BlitFramebuffer(Framebuffer *fbsrc, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *fbdst, int dstX1, int dstY1, int dstX2, int dstY2, int channels, FBBlitFilter linearFilter) {
|
||||
OpenGLFramebuffer *src = (OpenGLFramebuffer *)fbsrc;
|
||||
OpenGLFramebuffer *dst = (OpenGLFramebuffer *)fbdst;
|
||||
GLuint bits = 0;
|
||||
|
@ -1551,8 +1551,8 @@ bool OpenGLContext::fbo_blit(Framebuffer *fbsrc, int srcX1, int srcY1, int srcX2
|
|||
bits |= GL_DEPTH_BUFFER_BIT;
|
||||
if (channels & FB_STENCIL_BIT)
|
||||
bits |= GL_STENCIL_BUFFER_BIT;
|
||||
fbo_bind_as_render_target(dst);
|
||||
fbo_bind_for_read(src);
|
||||
BindFramebufferAsRenderTarget(dst);
|
||||
BindFramebufferForRead(src);
|
||||
if (gl_extensions.GLES3 || gl_extensions.ARB_framebuffer_object) {
|
||||
glBlitFramebuffer(srcX1, srcY1, srcX2, srcY2, dstX1, dstY1, dstX2, dstY2, bits, linearFilter == FB_BLIT_LINEAR ? GL_LINEAR : GL_NEAREST);
|
||||
#if defined(USING_GLES2) && defined(__ANDROID__) // We only support this extension on Android, it's not even available on PC.
|
||||
|
@ -1566,12 +1566,12 @@ bool OpenGLContext::fbo_blit(Framebuffer *fbsrc, int srcX1, int srcY1, int srcX2
|
|||
}
|
||||
}
|
||||
|
||||
uintptr_t OpenGLContext::fbo_get_api_texture(Framebuffer *fbo, int channelBits, int attachment) {
|
||||
uintptr_t OpenGLContext::GetFramebufferAPITexture(Framebuffer *fbo, int channelBits, int attachment) {
|
||||
// Unimplemented
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenGLContext::fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int color) {
|
||||
void OpenGLContext::BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int color) {
|
||||
OpenGLFramebuffer *fb = (OpenGLFramebuffer *)fbo;
|
||||
// glActiveTexture(GL_TEXTURE0 + binding);
|
||||
switch (channelBit) {
|
||||
|
@ -1608,7 +1608,7 @@ OpenGLFramebuffer::~OpenGLFramebuffer() {
|
|||
glDeleteTextures(1, &color_texture);
|
||||
}
|
||||
|
||||
void OpenGLContext::fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
void OpenGLContext::GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
OpenGLFramebuffer *fb = (OpenGLFramebuffer *)fbo;
|
||||
*w = fb->width;
|
||||
*h = fb->height;
|
||||
|
|
|
@ -367,23 +367,23 @@ public:
|
|||
|
||||
Texture *CreateTexture(const TextureDesc &desc) override;
|
||||
Buffer *CreateBuffer(size_t size, uint32_t usageFlags) override;
|
||||
Framebuffer *fbo_create(const FramebufferDesc &desc) override;
|
||||
Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) override;
|
||||
|
||||
void fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override;
|
||||
bool fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
void CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) override;
|
||||
bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) override;
|
||||
|
||||
int fbo_preferred_z_bitdepth() override;
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void fbo_bind_as_render_target(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsRenderTarget(Framebuffer *fbo) override;
|
||||
// color must be 0, for now.
|
||||
void fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void fbo_bind_for_read(Framebuffer *fbo) override;
|
||||
void BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) override;
|
||||
void BindFramebufferForRead(Framebuffer *fbo) override;
|
||||
|
||||
void fbo_bind_backbuffer_as_render_target() override;
|
||||
uintptr_t fbo_get_api_texture(Framebuffer *fbo, int channelBit, int attachment) override;
|
||||
void BindBackbufferAsRenderTarget() override;
|
||||
uintptr_t GetFramebufferAPITexture(Framebuffer *fbo, int channelBit, int attachment) override;
|
||||
|
||||
void fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
void GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) override;
|
||||
|
||||
void SetScissorRect(int left, int top, int width, int height) override;
|
||||
void SetViewports(int count, Viewport *viewports) override;
|
||||
|
@ -1281,7 +1281,7 @@ public:
|
|||
int height;
|
||||
};
|
||||
|
||||
Framebuffer *VKContext::fbo_create(const FramebufferDesc &desc) {
|
||||
Framebuffer *VKContext::CreateFramebuffer(const FramebufferDesc &desc) {
|
||||
VKFramebuffer *fb = new VKFramebuffer();
|
||||
fb->width = desc.width;
|
||||
fb->height = desc.height;
|
||||
|
@ -1289,21 +1289,21 @@ Framebuffer *VKContext::fbo_create(const FramebufferDesc &desc) {
|
|||
return fb;
|
||||
}
|
||||
|
||||
void VKContext::fbo_copy_image(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) {}
|
||||
bool VKContext::fbo_blit(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) { return true; }
|
||||
void VKContext::CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) {}
|
||||
bool VKContext::BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter) { return true; }
|
||||
|
||||
int VKContext::fbo_preferred_z_bitdepth() { return 24; }
|
||||
|
||||
// These functions should be self explanatory.
|
||||
void VKContext::fbo_bind_as_render_target(Framebuffer *fbo) {}
|
||||
void VKContext::BindFramebufferAsRenderTarget(Framebuffer *fbo) {}
|
||||
// color must be 0, for now.
|
||||
void VKContext::fbo_bind_as_texture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) {}
|
||||
void VKContext::fbo_bind_for_read(Framebuffer *fbo) {}
|
||||
void VKContext::BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) {}
|
||||
void VKContext::BindFramebufferForRead(Framebuffer *fbo) {}
|
||||
|
||||
void VKContext::fbo_bind_backbuffer_as_render_target() {}
|
||||
uintptr_t VKContext::fbo_get_api_texture(Framebuffer *fbo, int channelBit, int attachment) { return 0; }
|
||||
void VKContext::BindBackbufferAsRenderTarget() {}
|
||||
uintptr_t VKContext::GetFramebufferAPITexture(Framebuffer *fbo, int channelBit, int attachment) { return 0; }
|
||||
|
||||
void VKContext::fbo_get_dimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
void VKContext::GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h) {
|
||||
VKFramebuffer *fb = (VKFramebuffer *)fbo;
|
||||
*w = fb->width;
|
||||
*h = fb->height;
|
||||
|
|
Loading…
Add table
Reference in a new issue