add swap effect COPY support in Swap(), enable BackBufferScale#2429
add swap effect COPY support in Swap(), enable BackBufferScale#2429jackchentwkh wants to merge 8 commits into
Conversation
add BackBufferScale support
|
this PR is merely for reference in case anyone interested in how I did it. |
RadWolfie
left a comment
There was a problem hiding this comment.
I understand the PR is merely for reference, however there's at least one issue with this reference PR. Such as CxbxrImpl_Swap get called from where?
Another issue is missing D3DDevice_GetBackBuffer_8 call. However, it can put on hold temporary until push into this pull request or future pull request.
At the moment, I had reviewed the code. The rest can be review by one of graphic experts.
| /* pSourceRect = */ &scr, | ||
| /* pDestSurface = */ pXboxFrontBufferHostSurface, | ||
| /* pDestRect = */ nullptr, | ||
| /* Filter = */ D3DTEXF_LINEAR |
There was a problem hiding this comment.
Perhaps make this filter style configurable, or add a comment explaining why LINEAR is chosen here (same applies below)
There was a problem hiding this comment.
frankly I have no idea about how to choose a proper filter here.
There was a problem hiding this comment.
Then perhaps add an end of line comment along the lines of // TODO: verify filtering mode with hardware behaviour
add BackBufferScale support
|
update PR address almost all requests asked by reviewers except the configurable filter |
…/Cxbx-Reloaded into fix_backbufferscale
|
actually I reversed nbk2k2 to get the api detail.
|
…/Cxbx-Reloaded into fix_backbufferscale
I forgot the most inportant part. and fix come minor code to enable build in master.
…/Cxbx-Reloaded into fix_backbufferscale
|
the newest PR update enable master build and put the missing part of back buffer scale in effect inside GetMultiSampleScaleRaw() which I wrongly deleted when solving the merge conflict. it works in master without any jitter. |
| GetMultiSampleScaleRaw(scaleX, scaleY); | ||
| } | ||
|
|
||
| // the scales returned from GetMultiSampleScaleRaw(scaleX, scaleY) are already scaled with back buffer scales. |
There was a problem hiding this comment.
Nit: Indentation mismatches surrounding lines
|
|
||
| return result; | ||
| } | ||
| // ****************************************************************** |
There was a problem hiding this comment.
Nit: insert an empty line above
| ret | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Nit: reduce 2 empty separator lines down to 1
| CONST RECT* pDestRect, | ||
| PVOID pDummy1, | ||
| PVOID pDummy2 | ||
| ) |
There was a problem hiding this comment.
Nit: unindent closing round brace. Same for below new function signatures.
| LOG_FUNC_END; | ||
|
|
||
| //EMUPATCH(D3DDevice_Swap)(CXBX_SWAP_PRESENT_FORWARD); // Xbox present ignores | ||
| CxbxrImpl_Swap(CXBX_SWAP_PRESENT_FORWARD); |
There was a problem hiding this comment.
Consider prefixing with /*ignore*/ (or whatever convention is being used elsewhere when a return value is consciously not being used)
| IDirect3DSurface* pExistingHostRenderTarget = nullptr; | ||
| hRet = g_pD3DDevice->GetRenderTarget(0, &pExistingHostRenderTarget); | ||
| assert(hRet == D3D_OK); | ||
| // todo: there are jitters in stretching up, the source rect should be one possible cause. |
There was a problem hiding this comment.
Nit: Always capitalize TODO: wording. The same for around 10+ lines below.
BackBufferScale sample works, at least with my LLE POC.