Skip to content

Commit

Permalink
fix an issue where pngrawrastertiles were created read-only even on h…
Browse files Browse the repository at this point in the history
…ardware which doesn't support supportsAsyncGPUReadback (like android devices) causing error on elevation processing
  • Loading branch information
brnkhy committed Jul 27, 2021
1 parent a6c79ae commit 4f4a327
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal override TileResource MakeTileResource(string tilesetId)
return TileResource.MakeRawPngRaster(Id, tilesetId);
}

public RawPngRasterTile(CanonicalTileId tileId, string tilesetId) : base(tileId, tilesetId, true)
public RawPngRasterTile(CanonicalTileId tileId, string tilesetId, bool useReadonlyTexture = false) : base(tileId, tilesetId, useReadonlyTexture)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ protected override RasterTile CreateTile(CanonicalTileId tileId, string tilesetI
// }
// else
{
rasterTile = new RawPngRasterTile(tileId, tilesetId);
if (SystemInfo.supportsAsyncGPUReadback)
{
rasterTile = new RawPngRasterTile(tileId, tilesetId, true);
}
else
{
rasterTile = new RawPngRasterTile(tileId, tilesetId, false);
}
}

#if UNITY_EDITOR
Expand Down

0 comments on commit 4f4a327

Please sign in to comment.