sp614x / optifine

1.79k stars 418 forks source link

[1.13.1 E4 pre1] OpenGL error: 1281 (Invalid value), at: Expand VBO #1950

Open SteveKunG opened 5 years ago

SteveKunG commented 5 years ago

OpenGL API ERROR: 1281 (GL_INVALID_VALUE error generated. Invalid offset and/or size.) java.lang.Exception: Stack trace at org.lwjgl.opengl.GLDebugMessageCallbackI.callback(GLDebugMessageCallbackI.java:39) at org.lwjgl.opengl.GL15.nglBufferSubData(Native Method) at org.lwjgl.opengl.GL15.glBufferSubData(GL15.java:480) at dhp.glBufferSubData(OpenGlHelper.java:1024) at net.optifine.render.VboRegion.bufferData(VboRegion.java:105) at ddu.a(VertexBuffer.java:36) at cun.a(SourceFile:14) at cwo.a(ChunkRenderDispatcher.java:308) at cwo.a(ChunkRenderDispatcher.java:270) at cwo.lambda$uploadChunk$2(ChunkRenderDispatcher.java:284) at cwo$$Lambda$1183/1668212785.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at cwo.a(ChunkRenderDispatcher.java:126) at cud.a(RenderGlobal.java:2430) at ctx.b(EntityRenderer.java:1337) at ctx.a(EntityRenderer.java:1217) at ctx.a(EntityRenderer.java:979) at cfs.c(SourceFile:850) at cfs.a(SourceFile:395) at net.minecraft.client.main.Main.main(SourceFile:144) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

Sytred commented 5 years ago
Got something similar, and was about to post it also. Only with Sphax PureBD Craft texture pack, and it seemed only when I was looking at an ocean ; although it didn't crash the game at once, and in the log would show ` 12:11:14 Config [OptiFine] Suppressed 30938 OpenGL errors
12:11:14 Config [OptiFine] OpenGL error: 1281 (Invalid value), at: Expand VBO
12:11:14 cgu [CHAT] §eOpenGL Error§f: 1281 (Invalid value)

` I seemingly fixed it by turning "Enable VBOs" off.

Zefferis commented 5 years ago

I have more to add for this.

I encountered the same error code with my texture pack by doing the following:

  1. Video Settings > VBOs: ON
  2. Video Settings > Performance > Render Regions: ON
  3. Have a texture pack enabled with "problem texture"

My Texture pack contained a file that caused this issue:

.minecraft\resourcepacks\KoG Textures 2.1.0 fast\assets\minecraft\optifine\ctm\2_gravel_overlay


matchBlocks=stone
method=overlay
faces=top sides
tiles=0-16
connectBlocks=gravel
#tintIndex=0
#layer=translucent
#sand red_sand stone cobblestone mossy_cobblestone sandstone dirt podzol farmland grass_path mycelium

 When the gravel overlay specifically has the ``matchBlocks=stone`` it causes a OpenGL Error: 1281 (Invalid Value)

[20:14:27] [main/ERROR]: OpenGL API ERROR: 1281 (GL_INVALID_VALUE error generated. neither nor can be negative.) java.lang.Exception: Stack trace at org.lwjgl.opengl.GLDebugMessageCallbackI.callback(GLDebugMessageCallbackI.java:39) [lwjgl-opengl-3.1.6.jar:build 14] at org.lwjgl.opengl.GL14.nglMultiDrawArrays(Native Method) ~[lwjgl-opengl-3.1.6.jar:build 14] at org.lwjgl.opengl.GL14.glMultiDrawArrays(GL14.java:349) [lwjgl-opengl-3.1.6.jar:build 14] at ctz.glMultiDrawArrays(GlStateManager.java:1124) [ctz.class:?] at net.optifine.render.VboRegion.finishDraw(VboRegion.java:313) [VboRegion.class:?] at cum.drawRegion(VboRenderList.java:109) [cum.class:?] at cum.a(VboRenderList.java:50) [cum.class:?] at cud.a(RenderGlobal.java:1710) [cud.class:?] at cud.a(RenderGlobal.java:1685) [cud.class:?] at ctx.b(EntityRenderer.java:1504) [ctx.class:?] at ctx.a(EntityRenderer.java:1217) [ctx.class:?] at ctx.a(EntityRenderer.java:979) [ctx.class:?] at cfs.c(SourceFile:850) [cfs.class:?] at cfs.a(SourceFile:395) [cfs.class:?] at net.minecraft.client.main.Main.main(SourceFile:144) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]



OpenGL: 
GeForce GTX 1060 with Max-Q Design/PCIe/SSE2, version 4.6.0 NVIDIA 416.34, NVIDIA Corporation

Optifine Version:
1.13.1 HD U E3

Server:
git-Paper-375 1.13.1 (Paper)
sp614x commented 5 years ago

@Zefferis can you post a minimal resource pack that triggers the problem?

Zefferis commented 5 years ago

@sp614x

Here ya go

when flying through a world, ( places that can generate gravel for instance ) with an overlay for gravel; it causes this.

I believe a few other overlay blocks cause this but I lost my note on which ones :(

quick way to cause it to happen, use seed: 6209738985621030524 coordinates: "/tp -134 95 1626"

In this particular case, it only requires a gravel overlay to list stone as match block, other blocks are fine (as far as I can tell).

VBOs: ON Render Region: ON

OpenGL Error 1281.zip

sp614x commented 5 years ago

Testing OF 1.13.2 E5_pre6 + RP "OpenGL Error 1281.zip" + VBOs + Render Regions. Everything is OK, no OpenGL errors:

image

Also tested on a new world, seed 6209738985621030524 + "/tp -134 95 1626". Terrain generation is a bit slow, but no OpenGL errors.

Barteks2x commented 5 years ago

As I said on discord, I can almost always reproduce it by using F3+A right after fast movement that causes loading new chunks. Depending on the terrain, it may need very fast movement (max spectator speed on superflat), or creative flight is enough (on default world type).

It doesn't need any special resource pack, no special coordinates are needed. I think the only reason it may be easier to reproduce in some world/coordinates/resourcepack is that it makes chunk updates slower. It also doesn't need CTM to be enabled. I was only able to reproduce it with high render distance values, but that may have been just a coincidence.

sp614x commented 5 years ago

Looks like a race condition between the chunk loading threads and the forced chunks reload.

SteveKunG commented 5 years ago

This also happened when entering to The Nether.

2018-12-09_23 48 53

Current Resource Packs list 2018-12-09_23 50 10

Zefferis commented 5 years ago

Another individual who had this problem had an nvidia graphics card; perhaps related?

DarthSnorkel commented 5 years ago

I have a GTX1050 and get a similar error This error happens when I enable use VBO I am using sphaxPureBDcraft x256 latest.log

Lord-Vlad commented 5 years ago

2019-07-31_13 23 22

I got this in my log:

OpenGL API ERROR: 1281 (GL_INVALID_VALUE error generated. neither "first" nor "count" can be negative.)
java.lang.Exception: Stack trace
    at org.lwjgl.opengl.GL14C.nglMultiDrawArrays(Native Method)
    at org.lwjgl.opengl.GL14C.glMultiDrawArrays(GL14C.java:153)
    at org.lwjgl.opengl.GL14.glMultiDrawArrays(GL14.java:352)
    at com.mojang.blaze3d.platform.GlStateManager.glMultiDrawArrays(GlStateManager.java:1221)
    at net.optifine.render.VboRegion.finishDraw(VboRegion.java:325)
    at dnp.drawRegion(VboRenderList.java:110)
    at dnp.a(VboRenderList.java:40)
    at dng.a(WorldRenderer.java:1555)
    at dng.a(WorldRenderer.java:1531)
    at dnc.b(GameRenderer.java:1307)
    at dnc.a(GameRenderer.java:1032)
    at dnc.a(GameRenderer.java:792)
    at cyc.e(SourceFile:954)
    at cyc.b(SourceFile:410)
    at net.minecraft.client.main.Main.main(SourceFile:155)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:159)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:30)
SteveKunG commented 5 years ago

Since 1.13.2 I cannot reproduce this. Closing this?

Newkdehenkeil commented 5 years ago

I've the same error, but I don't have a GtForce or a Nvidia...I've a Intel HD 4000 and I play in 1.12.2 or 1.8 2019-08-18_19 45 57

flarefluffsune commented 4 years ago

I was wondering what this was popping up in my minecraft lately, but I'm getting the same issue. Using 1.14.4 Minecraft, Latest Optifine and latest forge build 28.1.99, with the Clarity 1.14 texture pack. And I use an nVidia GTX 1050.

2019-12-03_13 26 55

jackjt8 commented 4 years ago

GPU / Driver: RTX 2070 Driver 445.87 Tested with OptiFine: 1.13.2 HD_U_E7, 1.13.2 HD_U_F5, 1.14.4 HD_U_F5 Resource pack: Excalibur v1.4

Something about having VBOs & Render Regions ON while using a resource pack with CTM is causing this for me. Disabling any of these three fixes the problem but of course that's not ideal.

Suppressing Open GL Errors is probably the better "solution" here given we can still benefit from VBOs, Region Regions, & CTMs... But then we won't be able to see any other OpenGL Errors if they occur.

latest.log