シェーダー領域の整列と容量判定を補正

このコミットが含まれているのは:
routersys committed 2026-07-04 12:08:09 +09:00
1 親 9e1da1839e
コミット 103b612082
2ファイル変更
+5 -2

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -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;
+4 -1
ファイルの表示
@@ -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;
}
}