シェーダー領域の整列と容量判定を補正
このコミットが含まれているのは:
2ファイル変更
+5
-2
検索条件に一致するファイルはありません
@@ -818,7 +818,7 @@ namespace LuaScript.Engine
|
||||
|
||||
private void EnsureWorker(int width, int height, int stringCapacity)
|
||||
{
|
||||
long required = NativeProtocol.PixelOffset(stringCapacity) + (long)width * height * 4;
|
||||
long required = NativeProtocol.PixelOffset(stringCapacity) + (long)width * height * 4 + NativeProtocol.ShaderRegionBytes;
|
||||
if (_alive && _process is { HasExited: false } && _stringParamsCapacity == stringCapacity && required <= _allocatedSize)
|
||||
return;
|
||||
|
||||
|
||||
@@ -187,6 +187,9 @@ namespace LuaScript.Engine
|
||||
public static long ShaderImageOffset(long bufferSize) => ShaderConstantsOffset(bufferSize) + ShaderConstantsMax * 4;
|
||||
|
||||
public static long BufferSize(int width, int height, int stringCapacity) =>
|
||||
PixelOffset(stringCapacity) + Math.Max((long)width * height * 4, MaxPixelBufferSize) + ShaderRegionBytes;
|
||||
PixelOffset(stringCapacity) + PixelRegionSize(width, height) + ShaderRegionBytes;
|
||||
|
||||
public static long PixelRegionSize(int width, int height) =>
|
||||
(Math.Max((long)width * height * 4, MaxPixelBufferSize) + 7) & ~7L;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする