native renderer: game world at MT_RENDER_SCALE (0.75 on Android), MSAA default 2
Draws recorded inside CPythonApplication::RenderGame are marked Render3DDraw::scene and drawn by a scene pass compatible with pass_ into a reduced-resolution image, composited where RenderGame drew; the UI stays full resolution. --render-scale / MT_RENDER_SCALE, desktop default 1.0 (unchanged path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b7c215ee42
commit
44a020f01e
@@ -15,6 +15,7 @@
|
||||
namespace {
|
||||
std::mutex g_draws_mutex;
|
||||
std::vector<Render3DDraw> g_draws;
|
||||
bool g_in_scene = false;
|
||||
int g_native_terrain_override = -1;
|
||||
bool g_gpu_render_targets = false;
|
||||
|
||||
@@ -1256,9 +1257,13 @@ void Render3DBeginFrame()
|
||||
void Render3DAdd(Render3DDraw draw)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g_draws_mutex);
|
||||
draw.scene = g_in_scene;
|
||||
g_draws.push_back(std::move(draw));
|
||||
}
|
||||
|
||||
void Render3DBeginScene() { g_in_scene = true; }
|
||||
void Render3DEndScene() { g_in_scene = false; }
|
||||
|
||||
const std::vector<Render3DDraw>& Render3DDraws() { return g_draws; }
|
||||
|
||||
// D3D8 fixed-function texture coordinate processing for one stage (the native renderer's
|
||||
|
||||
@@ -22,6 +22,9 @@ struct Render3DDraw {
|
||||
// PORT: UIRenderOffsetX() when recorded (a draw from a shifted window layer); the host moves the
|
||||
// viewport (and a pretransformed draw's screen positions) right by it.
|
||||
float ui_offset_x = 0;
|
||||
// PORT: recorded inside CPythonApplication::RenderGame (Render3DBeginScene/EndScene). The native
|
||||
// renderer may draw these into a reduced-resolution scene image composited under the UI.
|
||||
bool scene = false;
|
||||
|
||||
// IDirect3DDevice8::Clear on the back buffer, kept in draw order. A clear entry has no geometry;
|
||||
// clear_flags holds D3DCLEAR_TARGET / D3DCLEAR_ZBUFFER / D3DCLEAR_STENCIL.
|
||||
@@ -138,4 +141,8 @@ std::string Render3DRenderTargetName(std::uint32_t id, std::uint32_t width, std:
|
||||
|
||||
void Render3DBeginFrame();
|
||||
void Render3DAdd(Render3DDraw draw);
|
||||
// PORT: brackets the game world's draws (CPythonApplication::RenderGame); Render3DAdd marks the draws
|
||||
// in between with Render3DDraw::scene.
|
||||
void Render3DBeginScene();
|
||||
void Render3DEndScene();
|
||||
const std::vector<Render3DDraw>& Render3DDraws();
|
||||
|
||||
@@ -202,6 +202,8 @@ void CPythonApplication::GetMousePosition(POINT* ppt)
|
||||
void CPythonApplication::RenderGame()
|
||||
{
|
||||
MtPerf::CScope kPerf(MtPerf::SECTION_RENDER_GAME);
|
||||
// PORT: marks the world's draws so the native renderer can draw them at a reduced resolution.
|
||||
struct SceneScope { SceneScope() { Render3DBeginScene(); } ~SceneScope() { Render3DEndScene(); } } kScene;
|
||||
float fAspect=UI::CWindowManager::Instance().GetAspect();
|
||||
float fFarClip=CPythonBackground::Instance().GetFarClip();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user