MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / bufferData

Method bufferData

src/main/java/net/optifine/render/VboRegion.java:40–85  ·  view source on GitHub ↗
(ByteBuffer data, VboRange range)

Source from the content-addressed store, hash-verified

38 }
39
40 public void bufferData(ByteBuffer data, VboRange range)
41 {
42 int i = range.getPosition();
43 int j = range.getSize();
44 int k = this.toVertex((long)data.limit());
45
46 if (k <= 0)
47 {
48 if (i >= 0)
49 {
50 range.setPosition(-1);
51 range.setSize(0);
52 this.rangeList.remove(range.getNode());
53 this.sizeUsed -= j;
54 }
55 }
56 else
57 {
58 if (k > j)
59 {
60 range.setPosition(this.positionTop);
61 range.setSize(k);
62 this.positionTop += k;
63
64 if (i >= 0)
65 {
66 this.rangeList.remove(range.getNode());
67 }
68
69 this.rangeList.addLast(range.getNode());
70 }
71
72 range.setSize(k);
73 this.sizeUsed += k - j;
74 this.checkVboSize(range.getPositionNext());
75 long l = this.toBytes(range.getPosition());
76 this.bindBuffer();
77 OpenGlHelper.glBufferSubData(OpenGlHelper.GL_ARRAY_BUFFER, l, data);
78 this.unbindBuffer();
79
80 if (this.positionTop > this.sizeUsed * 11 / 10)
81 {
82 this.compactRanges(1);
83 }
84 }
85 }
86
87 private void compactRanges(int countMax)
88 {

Callers 1

func_181722_aMethod · 0.80

Calls 15

toVertexMethod · 0.95
checkVboSizeMethod · 0.95
toBytesMethod · 0.95
bindBufferMethod · 0.95
glBufferSubDataMethod · 0.95
unbindBufferMethod · 0.95
compactRangesMethod · 0.95
getNodeMethod · 0.80
addLastMethod · 0.80
getPositionNextMethod · 0.80
getPositionMethod · 0.65
setPositionMethod · 0.65

Tested by

no test coverage detected