mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Merge pull request #8349 from unknownbrackets/d3d9-minor
Fix some Direct3D 9 validation errors
This commit is contained in:
@@ -587,7 +587,9 @@ namespace DX9 {
|
||||
if (!fbo)
|
||||
return fbo;
|
||||
fbo_bind_as_render_target(fbo);
|
||||
dxstate.viewport.force(0, 0, w, h);
|
||||
ClearBuffer(true);
|
||||
dxstate.viewport.restore();
|
||||
const TempFBO info = {fbo, gpuStats.numFlips};
|
||||
tempFBOs_[key] = info;
|
||||
return fbo;
|
||||
@@ -793,7 +795,7 @@ namespace DX9 {
|
||||
const u32 rw = PSP_CoreParameter().pixelWidth;
|
||||
const u32 rh = PSP_CoreParameter().pixelHeight;
|
||||
const RECT srcRect = {(LONG)(u0 * vfb->renderWidth), (LONG)(v0 * vfb->renderHeight), (LONG)(u1 * vfb->renderWidth), (LONG)(v1 * vfb->renderHeight)};
|
||||
const RECT dstRect = {(LONG)(x * rw / w, y * rh / h), (LONG)((x + w) * rw / w, (y + h) * rh / h)};
|
||||
const RECT dstRect = {(LONG)(x * rw / w), (LONG)(y * rh / h), (LONG)((x + w) * rw / w), (LONG)((y + h) * rh / h)};
|
||||
HRESULT hr = fbo_blit_color(vfb->fbo_dx9, &srcRect, nullptr, &dstRect, g_Config.iBufFilter == SCALE_LINEAR ? D3DTEXF_LINEAR : D3DTEXF_POINT);
|
||||
if (FAILED(hr)) {
|
||||
ERROR_LOG_REPORT_ONCE(blit_fail, G3D, "fbo_blit_color failed on display: %08x", hr);
|
||||
|
||||
@@ -349,7 +349,12 @@ private:
|
||||
class StateVp {
|
||||
D3DVIEWPORT9 viewport;
|
||||
public:
|
||||
StateVp() { memset(&viewport, 0, sizeof(viewport)); }
|
||||
StateVp() {
|
||||
memset(&viewport, 0, sizeof(viewport));
|
||||
// It's an error if w/h is zero, so let's start with something that can work.
|
||||
viewport.Width = 1;
|
||||
viewport.Height = 1;
|
||||
}
|
||||
inline void set(int x, int y, int w, int h, float n = 0.f, float f = 1.f) {
|
||||
D3DVIEWPORT9 newviewport;
|
||||
newviewport.X = x;
|
||||
|
||||
Reference in New Issue
Block a user