Scale TileSize with internal resolution

This commit is contained in:
FireNX70 2024-06-09 20:07:26 +02:00
parent 57d20751fc
commit 528501149e
3 changed files with 10 additions and 4 deletions

View File

@ -19,6 +19,7 @@
#include "GPU3D_Compute.h" #include "GPU3D_Compute.h"
#include <assert.h> #include <assert.h>
#include <algorithm>
#include "OpenGLSupport.h" #include "OpenGLSupport.h"
@ -50,6 +51,8 @@ bool ComputeRenderer::CompileShader(GLuint& shader, const std::string& source, c
shaderSource += std::to_string(ScreenHeight); shaderSource += std::to_string(ScreenHeight);
shaderSource += "\n#define MaxWorkTiles "; shaderSource += "\n#define MaxWorkTiles ";
shaderSource += std::to_string(MaxWorkTiles); shaderSource += std::to_string(MaxWorkTiles);
shaderSource += "\n#define TileSize ";
shaderSource += std::to_string(TileSize);
shaderSource += ComputeRendererShaders::Common; shaderSource += ComputeRendererShaders::Common;
shaderSource += source; shaderSource += source;
@ -310,6 +313,10 @@ void ComputeRenderer::SetRenderSettings(int scale, bool highResolutionCoordinate
ScreenWidth = 256 * ScaleFactor; ScreenWidth = 256 * ScaleFactor;
ScreenHeight = 192 * ScaleFactor; ScreenHeight = 192 * ScaleFactor;
TileSize = std::min(8 * (1 << (ScaleFactor / 5)), 32);
CoarseTileW = CoarseTileCountX * TileSize;
CoarseTileH = CoarseTileCountY * TileSize;
TilesPerLine = ScreenWidth/TileSize; TilesPerLine = ScreenWidth/TileSize;
TileLines = ScreenHeight/TileSize; TileLines = ScreenHeight/TileSize;

View File

@ -163,11 +163,11 @@ private:
float TextureLayer; float TextureLayer;
}; };
static constexpr int TileSize = 8; int TileSize;
static constexpr int CoarseTileCountX = 8; static constexpr int CoarseTileCountX = 8;
static constexpr int CoarseTileCountY = 4; static constexpr int CoarseTileCountY = 4;
static constexpr int CoarseTileW = CoarseTileCountX * TileSize; int CoarseTileW;
static constexpr int CoarseTileH = CoarseTileCountY * TileSize; int CoarseTileH;
static constexpr int BinStride = 2048/32; static constexpr int BinStride = 2048/32;
static constexpr int CoarseBinStride = BinStride/32; static constexpr int CoarseBinStride = BinStride/32;

View File

@ -339,7 +339,6 @@ const uint ResultAttrStart = ResultDepthStart+ScreenWidth*ScreenHeight*2;
const char* Common = R"( const char* Common = R"(
#define TileSize 8
const int CoarseTileCountX = 8; const int CoarseTileCountX = 8;
const int CoarseTileCountY = 4; const int CoarseTileCountY = 4;
const int CoarseTileW = (CoarseTileCountX * TileSize); const int CoarseTileW = (CoarseTileCountX * TileSize);