17 lines
619 B
Java
17 lines
619 B
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package com.mojang.blaze3d.buffers;
|
|
|
|
import com.mojang.blaze3d.buffers.GpuBuffer;
|
|
|
|
public record GpuBufferSlice(GpuBuffer buffer, int offset, int length) {
|
|
public GpuBufferSlice slice(int offset, int length) {
|
|
if (offset < 0 || length < 0 || offset + length > this.length) {
|
|
throw new IllegalArgumentException("Offset of " + offset + " and length " + length + " would put new slice outside existing slice's range (of " + this.offset + "," + this.length + ")");
|
|
}
|
|
return new GpuBufferSlice(this.buffer, this.offset + offset, length);
|
|
}
|
|
}
|
|
|