Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit ba90df2

Browse files
committed
make the maxRasterImage size configurable
1 parent 756267e commit ba90df2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Runtime/editor/window_config.cs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ namespace Unity.UIWidgets.editor {
44
public class WindowConfig {
55
public readonly bool disableRasterCache;
66

7+
public static float MaxRasterImageSize = 4096;
8+
79
static bool? _disableComputeBuffer = null;
810

911
public static bool disableComputeBuffer {

Runtime/ui/renderer/compositeCanvas/flow/raster_cache.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using Unity.UIWidgets.editor;
34
using Unity.UIWidgets.foundation;
45
using Unity.UIWidgets.ui;
56
using UnityEngine;
@@ -228,8 +229,8 @@ static bool _canRasterizePicture(Picture picture) {
228229
}
229230

230231
//https://forum.unity.com/threads/rendertexture-create-failed-rendertexture-too-big.58667/
231-
if (picture.paintBounds.size.width > 4096 ||
232-
picture.paintBounds.size.height > 4096) {
232+
if (picture.paintBounds.size.width > WindowConfig.MaxRasterImageSize ||
233+
picture.paintBounds.size.height > WindowConfig.MaxRasterImageSize) {
233234
return false;
234235
}
235236

0 commit comments

Comments
 (0)