Scale TileSize with internal resolution
This commit is contained in:
parent
57d20751fc
commit
528501149e
|
@ -19,6 +19,7 @@
|
|||
#include "GPU3D_Compute.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "OpenGLSupport.h"
|
||||
|
||||
|
@ -50,6 +51,8 @@ bool ComputeRenderer::CompileShader(GLuint& shader, const std::string& source, c
|
|||
shaderSource += std::to_string(ScreenHeight);
|
||||
shaderSource += "\n#define MaxWorkTiles ";
|
||||
shaderSource += std::to_string(MaxWorkTiles);
|
||||
shaderSource += "\n#define TileSize ";
|
||||
shaderSource += std::to_string(TileSize);
|
||||
|
||||
shaderSource += ComputeRendererShaders::Common;
|
||||
shaderSource += source;
|
||||
|
@ -310,6 +313,10 @@ void ComputeRenderer::SetRenderSettings(int scale, bool highResolutionCoordinate
|
|||
ScreenWidth = 256 * ScaleFactor;
|
||||
ScreenHeight = 192 * ScaleFactor;
|
||||
|
||||
TileSize = std::min(8 * (1 << (ScaleFactor / 5)), 32);
|
||||
CoarseTileW = CoarseTileCountX * TileSize;
|
||||
CoarseTileH = CoarseTileCountY * TileSize;
|
||||
|
||||
TilesPerLine = ScreenWidth/TileSize;
|
||||
TileLines = ScreenHeight/TileSize;
|
||||
|
||||
|
|
|
@ -163,11 +163,11 @@ private:
|
|||
float TextureLayer;
|
||||
};
|
||||
|
||||
static constexpr int TileSize = 8;
|
||||
int TileSize;
|
||||
static constexpr int CoarseTileCountX = 8;
|
||||
static constexpr int CoarseTileCountY = 4;
|
||||
static constexpr int CoarseTileW = CoarseTileCountX * TileSize;
|
||||
static constexpr int CoarseTileH = CoarseTileCountY * TileSize;
|
||||
int CoarseTileW;
|
||||
int CoarseTileH;
|
||||
|
||||
static constexpr int BinStride = 2048/32;
|
||||
static constexpr int CoarseBinStride = BinStride/32;
|
||||
|
|
|
@ -339,7 +339,6 @@ const uint ResultAttrStart = ResultDepthStart+ScreenWidth*ScreenHeight*2;
|
|||
|
||||
const char* Common = R"(
|
||||
|
||||
#define TileSize 8
|
||||
const int CoarseTileCountX = 8;
|
||||
const int CoarseTileCountY = 4;
|
||||
const int CoarseTileW = (CoarseTileCountX * TileSize);
|
||||
|
|
Loading…
Reference in New Issue