mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GPU: Cleanup some extra pointers in fb managers.
These weren't being used / weren't final anyway.
This commit is contained in:
parent
87d2e16b11
commit
0dc7688838
13 changed files with 15 additions and 39 deletions
|
@ -159,17 +159,14 @@ FramebufferManagerD3D11::~FramebufferManagerD3D11() {
|
|||
}
|
||||
|
||||
void FramebufferManagerD3D11::SetTextureCache(TextureCacheD3D11 *tc) {
|
||||
textureCacheD3D11_ = tc;
|
||||
textureCache_ = tc;
|
||||
}
|
||||
|
||||
void FramebufferManagerD3D11::SetShaderManager(ShaderManagerD3D11 *sm) {
|
||||
shaderManagerD3D11_ = sm;
|
||||
shaderManager_ = sm;
|
||||
}
|
||||
|
||||
void FramebufferManagerD3D11::SetDrawEngine(DrawEngineD3D11 *td) {
|
||||
drawEngineD3D11_ = td;
|
||||
drawEngine_ = td;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,8 +84,4 @@ private:
|
|||
|
||||
ID3D11Texture2D *nullTexture_ = nullptr;
|
||||
ID3D11ShaderResourceView *nullTextureView_ = nullptr;
|
||||
|
||||
TextureCacheD3D11 *textureCacheD3D11_;
|
||||
ShaderManagerD3D11 *shaderManagerD3D11_;
|
||||
DrawEngineD3D11 *drawEngineD3D11_;
|
||||
};
|
||||
|
|
|
@ -153,7 +153,7 @@ bool FramebufferManagerD3D11::NotifyStencilUpload(u32 addr, int size, StencilUpl
|
|||
ASSERT_SUCCESS(device_->CreateBuffer(&desc, nullptr, &stencilValueBuffer_));
|
||||
}
|
||||
|
||||
shaderManagerD3D11_->DirtyLastShader();
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
u16 w = dstBuffer->renderWidth;
|
||||
u16 h = dstBuffer->renderHeight;
|
||||
|
@ -185,8 +185,8 @@ bool FramebufferManagerD3D11::NotifyStencilUpload(u32 addr, int size, StencilUpl
|
|||
memcpy(map.pData, coord, sizeof(float) * 4 * 5);
|
||||
context_->Unmap(quadBuffer_, 0);
|
||||
|
||||
shaderManagerD3D11_->DirtyLastShader();
|
||||
textureCacheD3D11_->ForgetLastTexture();
|
||||
shaderManager_->DirtyLastShader();
|
||||
textureCache_->ForgetLastTexture();
|
||||
|
||||
context_->OMSetBlendState(stockD3D11.blendStateDisabledWithColorMask[0], nullptr, 0xFFFFFFFF);
|
||||
context_->IASetInputLayout(stencilUploadInputLayout_);
|
||||
|
|
|
@ -141,17 +141,14 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
|||
}
|
||||
|
||||
void FramebufferManagerDX9::SetTextureCache(TextureCacheDX9 *tc) {
|
||||
textureCacheDX9_ = tc;
|
||||
textureCache_ = tc;
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::SetShaderManager(ShaderManagerDX9 *sm) {
|
||||
shaderManagerDX9_ = sm;
|
||||
shaderManager_ = sm;
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::SetDrawEngine(DrawEngineDX9 *td) {
|
||||
drawEngineD3D9_ = td;
|
||||
drawEngine_ = td;
|
||||
}
|
||||
|
||||
|
@ -240,7 +237,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
|
|||
return it->second.surface;
|
||||
}
|
||||
|
||||
textureCacheDX9_->ForgetLastTexture();
|
||||
textureCache_->ForgetLastTexture();
|
||||
LPDIRECT3DSURFACE9 offscreen = nullptr;
|
||||
HRESULT hr = device_->CreateOffscreenPlainSurface(w, h, fmt, D3DPOOL_SYSTEMMEM, &offscreen, NULL);
|
||||
if (FAILED(hr) || !offscreen) {
|
||||
|
|
|
@ -82,10 +82,6 @@ private:
|
|||
bool stencilUploadFailed_ = false;
|
||||
|
||||
LPDIRECT3DTEXTURE9 nullTex_ = nullptr;
|
||||
|
||||
TextureCacheDX9 *textureCacheDX9_;
|
||||
ShaderManagerDX9 *shaderManagerDX9_;
|
||||
DrawEngineDX9 *drawEngineD3D9_;
|
||||
|
||||
struct OffscreenSurface {
|
||||
LPDIRECT3DSURFACE9 surface;
|
||||
|
|
|
@ -179,7 +179,7 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa
|
|||
return false;
|
||||
}
|
||||
|
||||
shaderManagerDX9_->DirtyLastShader();
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
dxstate.colorMask.set(false, false, false, true);
|
||||
dxstate.stencilTest.enable();
|
||||
|
@ -221,8 +221,8 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa
|
|||
|
||||
draw_->BindTextures(0, 1, &tex);
|
||||
|
||||
shaderManagerDX9_->DirtyLastShader();
|
||||
textureCacheDX9_->ForgetLastTexture();
|
||||
shaderManager_->DirtyLastShader();
|
||||
textureCache_->ForgetLastTexture();
|
||||
|
||||
for (int i = 1; i < values; i += i) {
|
||||
if (!(usedBits & i)) {
|
||||
|
|
|
@ -125,7 +125,7 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
|||
}
|
||||
}
|
||||
|
||||
shaderManagerGL_->DirtyLastShader();
|
||||
shaderManager_->DirtyLastShader();
|
||||
auto *blitFBO = GetTempFBO(TempFBO::COPY, vfb->renderWidth, vfb->renderHeight);
|
||||
draw_->BindFramebufferAsRenderTarget(blitFBO, { Draw::RPAction::CLEAR, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE }, "PackDepthbuffer");
|
||||
render_->SetViewport({ 0, 0, (float)vfb->renderWidth, (float)vfb->renderHeight, 0.0f, 1.0f });
|
||||
|
@ -156,7 +156,7 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
|||
|
||||
draw_->CopyFramebufferToMemorySync(blitFBO, Draw::FB_COLOR_BIT, 0, y, packWidth, h, Draw::DataFormat::R8G8B8A8_UNORM, convBuf_, vfb->z_stride, "PackDepthbuffer");
|
||||
|
||||
textureCacheGL_->ForgetLastTexture();
|
||||
textureCache_->ForgetLastTexture();
|
||||
// TODO: Use 4444 so we can copy lines directly?
|
||||
format16Bit = true;
|
||||
} else {
|
||||
|
|
|
@ -113,12 +113,10 @@ void FramebufferManagerGLES::Init() {
|
|||
}
|
||||
|
||||
void FramebufferManagerGLES::SetTextureCache(TextureCacheGLES *tc) {
|
||||
textureCacheGL_ = tc;
|
||||
textureCache_ = tc;
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::SetShaderManager(ShaderManagerGLES *sm) {
|
||||
shaderManagerGL_ = sm;
|
||||
shaderManager_ = sm;
|
||||
}
|
||||
|
||||
|
@ -325,7 +323,7 @@ void FramebufferManagerGLES::BlitFramebuffer(VirtualFramebuffer *dst, int dstX,
|
|||
float srcH = src->bufferHeight;
|
||||
render_->BindProgram(draw2dprogram_);
|
||||
DrawActiveTexture(dstX1, dstY1, w * dstXFactor, h * dstYFactor, dst->bufferWidth, dst->bufferHeight, srcX1 / srcW, srcY1 / srcH, srcX2 / srcW, srcY2 / srcH, ROTATION_LOCKED_HORIZONTAL, DRAWTEX_NEAREST);
|
||||
textureCacheGL_->ForgetLastTexture();
|
||||
textureCache_->ForgetLastTexture();
|
||||
}
|
||||
|
||||
gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE);
|
||||
|
|
|
@ -89,8 +89,6 @@ private:
|
|||
// Cached uniform locs
|
||||
int u_draw2d_tex = -1;
|
||||
|
||||
TextureCacheGLES *textureCacheGL_ = nullptr;
|
||||
ShaderManagerGLES *shaderManagerGL_ = nullptr;
|
||||
DrawEngineGLES *drawEngineGL_ = nullptr;
|
||||
|
||||
struct Simple2DVertex {
|
||||
|
|
|
@ -120,7 +120,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, StencilUplo
|
|||
// Common when creating buffers, it's already 0. We're done.
|
||||
return false;
|
||||
}
|
||||
shaderManagerGL_->DirtyLastShader();
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
// Let's not bother with the shader if it's just zero.
|
||||
if (dstBuffer->fbo) {
|
||||
|
@ -156,7 +156,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, StencilUplo
|
|||
}
|
||||
}
|
||||
|
||||
shaderManagerGL_->DirtyLastShader();
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
bool useBlit = gstate_c.Supports(GPU_SUPPORTS_FRAMEBUFFER_BLIT);
|
||||
|
||||
|
@ -179,7 +179,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, StencilUplo
|
|||
|
||||
float u1 = 1.0f;
|
||||
float v1 = 1.0f;
|
||||
textureCacheGL_->ForgetLastTexture();
|
||||
textureCache_->ForgetLastTexture();
|
||||
Draw::Texture *tex = MakePixelTexture(src, dstBuffer->format, dstBuffer->fb_stride, dstBuffer->width, dstBuffer->height, u1, v1);
|
||||
if (!tex)
|
||||
return false;
|
||||
|
|
|
@ -90,17 +90,14 @@ FramebufferManagerVulkan::~FramebufferManagerVulkan() {
|
|||
}
|
||||
|
||||
void FramebufferManagerVulkan::SetTextureCache(TextureCacheVulkan *tc) {
|
||||
textureCacheVulkan_ = tc;
|
||||
textureCache_ = tc;
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::SetShaderManager(ShaderManagerVulkan *sm) {
|
||||
shaderManagerVulkan_ = sm;
|
||||
shaderManager_ = sm;
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::SetDrawEngine(DrawEngineVulkan *td) {
|
||||
drawEngineVulkan_ = td;
|
||||
drawEngine_ = td;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,9 +72,6 @@ private:
|
|||
|
||||
// Used to keep track of command buffers here but have moved all that into Thin3D.
|
||||
|
||||
TextureCacheVulkan *textureCacheVulkan_ = nullptr;
|
||||
ShaderManagerVulkan *shaderManagerVulkan_ = nullptr;
|
||||
DrawEngineVulkan *drawEngineVulkan_ = nullptr;
|
||||
VulkanPushBuffer *push_;
|
||||
|
||||
enum {
|
||||
|
|
|
@ -160,8 +160,8 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp
|
|||
|
||||
VulkanRenderManager *renderManager = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
|
||||
shaderManagerVulkan_->DirtyLastShader();
|
||||
textureCacheVulkan_->ForgetLastTexture();
|
||||
shaderManager_->DirtyLastShader();
|
||||
textureCache_->ForgetLastTexture();
|
||||
|
||||
u16 w = dstBuffer->renderWidth;
|
||||
u16 h = dstBuffer->renderHeight;
|
||||
|
|
Loading…
Add table
Reference in a new issue