diff --git a/src/GPU3D_Compute.cpp b/src/GPU3D_Compute.cpp index 8e0ea4f3..294cd518 100644 --- a/src/GPU3D_Compute.cpp +++ b/src/GPU3D_Compute.cpp @@ -53,6 +53,8 @@ bool ComputeRenderer::CompileShader(GLuint& shader, const std::string& source, c shaderSource += std::to_string(MaxWorkTiles); shaderSource += "\n#define TileSize "; shaderSource += std::to_string(TileSize); + shaderSource += "\nconst int CoarseTileCountY = "; + shaderSource += std::to_string(CoarseTileCountY) + ";"; shaderSource += ComputeRendererShaders::Common; shaderSource += source; @@ -314,6 +316,7 @@ void ComputeRenderer::SetRenderSettings(int scale, bool highResolutionCoordinate ScreenHeight = 192 * ScaleFactor; TileSize = std::min(8 << (ScaleFactor / 5), 32); + CoarseTileCountY = TileSize < 32 ? 4 : 6; CoarseTileW = CoarseTileCountX * TileSize; CoarseTileH = CoarseTileCountY * TileSize; diff --git a/src/GPU3D_Compute.h b/src/GPU3D_Compute.h index 1e225948..4f944e42 100644 --- a/src/GPU3D_Compute.h +++ b/src/GPU3D_Compute.h @@ -165,7 +165,7 @@ private: int TileSize; static constexpr int CoarseTileCountX = 8; - static constexpr int CoarseTileCountY = 4; + int CoarseTileCountY; int CoarseTileW; int CoarseTileH; diff --git a/src/GPU3D_Compute_shaders.h b/src/GPU3D_Compute_shaders.h index 0ad57dbd..9fb4aae7 100644 --- a/src/GPU3D_Compute_shaders.h +++ b/src/GPU3D_Compute_shaders.h @@ -340,7 +340,6 @@ const uint ResultAttrStart = ResultDepthStart+ScreenWidth*ScreenHeight*2; const char* Common = R"( const int CoarseTileCountX = 8; -const int CoarseTileCountY = 4; const int CoarseTileW = (CoarseTileCountX * TileSize); const int CoarseTileH = (CoarseTileCountY * TileSize);