mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
Declare DrawActiveTexture in FramebufferCommon
This commit is contained in:
1 parent
0fb1e95bac
commit
7652bc2d8b
7 files changed
+20
-17
No files matched your search
@@ -259,6 +259,7 @@ public:
|
||||
|
||||
protected:
|
||||
void CalculatePostShaderUniforms(int bufferWidth, int bufferHeight, int renderWidth, int renderHeight, PostShaderUniforms *uniforms);
|
||||
virtual void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) = 0;
|
||||
virtual void BindPostShader(const PostShaderUniforms &uniforms) {}
|
||||
|
||||
// Cardboard Settings Calculator
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual void DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override;
|
||||
virtual void DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override;
|
||||
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter);
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) override;
|
||||
|
||||
void DestroyAllFBOs(bool forceDelete);
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
||||
MakePixelTexture(srcPixels, srcPixelFormat, srcStride, width, height);
|
||||
DisableState();
|
||||
device_->SetTexture(0, drawPixelsTex_);
|
||||
DrawActiveTexture(dstX, dstY, width, height, vfb->bufferWidth, vfb->bufferHeight, 0.0f, 0.0f, 1.0f, 1.0f, ROTATION_LOCKED_HORIZONTAL);
|
||||
DrawActiveTexture(dstX, dstY, width, height, vfb->bufferWidth, vfb->bufferHeight, 0.0f, 0.0f, 1.0f, 1.0f, ROTATION_LOCKED_HORIZONTAL, true);
|
||||
textureCacheDX9_->ForgetLastTexture();
|
||||
dxstate.viewport.restore();
|
||||
}
|
||||
@@ -296,10 +296,10 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
||||
int uvRotation = (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE) ? g_Config.iInternalScreenRotation : ROTATION_LOCKED_HORIZONTAL;
|
||||
CenterDisplayOutputRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)pixelWidth_, (float)pixelHeight_, uvRotation);
|
||||
device_->SetTexture(0, drawPixelsTex_);
|
||||
DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, 0.0f, 0.0f, 480.0f / 512.0f, 1.0f, uvRotation);
|
||||
DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, 0.0f, 0.0f, 480.0f / 512.0f, 1.0f, uvRotation, true);
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation) {
|
||||
void FramebufferManagerDX9::DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) {
|
||||
// TODO: StretchRect instead?
|
||||
float coord[20] = {
|
||||
x,y,0, u0,v0,
|
||||
@@ -339,6 +339,13 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
||||
coord[i * 5 + 1] = -(coord[i * 5 + 1] * invDestH - 1.0f - halfPixelY);
|
||||
}
|
||||
|
||||
if (linearFilter) {
|
||||
dxstate.texMagFilter.set(D3DTEXF_LINEAR);
|
||||
dxstate.texMinFilter.set(D3DTEXF_LINEAR);
|
||||
} else {
|
||||
dxstate.texMagFilter.set(D3DTEXF_POINT);
|
||||
dxstate.texMinFilter.set(D3DTEXF_POINT);
|
||||
}
|
||||
pD3Ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
pD3Ddevice->SetVertexDeclaration(pFramebufferVertexDecl);
|
||||
pD3Ddevice->SetPixelShader(pFramebufferPixelShader);
|
||||
@@ -701,16 +708,9 @@ static void DXSetViewport(float x, float y, float w, float h, float minZ, float
|
||||
ERROR_LOG_REPORT_ONCE(blit_fail, G3D, "fbo_blit_color failed on display");
|
||||
DXSetViewport(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight, 0.0f, 1.0f);
|
||||
// These are in the output display coordinates
|
||||
if (g_Config.iBufFilter == SCALE_LINEAR) {
|
||||
dxstate.texMagFilter.set(D3DTEXF_LINEAR);
|
||||
dxstate.texMinFilter.set(D3DTEXF_LINEAR);
|
||||
} else {
|
||||
dxstate.texMagFilter.set(D3DTEXF_POINT);
|
||||
dxstate.texMinFilter.set(D3DTEXF_POINT);
|
||||
}
|
||||
dxstate.texMipFilter.set(D3DTEXF_NONE);
|
||||
dxstate.texMipLodBias.set(0);
|
||||
DrawActiveTexture(x, y, w, h, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, u0, v0, u1, v1, uvRotation);
|
||||
DrawActiveTexture(x, y, w, h, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, u0, v0, u1, v1, uvRotation, g_Config.iBufFilter == SCALE_LINEAR);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
virtual void DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) override;
|
||||
virtual void DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override;
|
||||
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation);
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) override;
|
||||
|
||||
void DestroyAllFBOs(bool forceDelete);
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
void DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) override;
|
||||
|
||||
// x,y,w,h are relative to destW, destH which fill out the target completely.
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter);
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) override;
|
||||
|
||||
void DestroyAllFBOs(bool forceDelete);
|
||||
|
||||
|
||||
@@ -480,11 +480,12 @@ void FramebufferManagerVulkan::DrawFramebufferToOutput(const u8 *srcPixels, GEBu
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// x, y, w, h are relative coordinates against destW/destH, which is not very intuitive.
|
||||
void FramebufferManagerVulkan::DrawTexture(VulkanTexture *texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, VkPipeline pipeline, int uvRotation) {
|
||||
if (!texture)
|
||||
return;
|
||||
|
||||
float texCoords[8] = {
|
||||
u0,v0,
|
||||
u1,v0,
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
// If texture != 0, will bind it.
|
||||
// x,y,w,h are relative to destW, destH which fill out the target completely.
|
||||
void DrawTexture(VulkanTexture *texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, VkPipeline pipeline, int uvRotation);
|
||||
void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, bool linearFilter) override;
|
||||
|
||||
void DestroyAllFBOs(bool forceDelete);
|
||||
|
||||
|
||||
Reference in new issue
Block a user