【问题标题】:EXCEPTION_ACCESS_VIOLATION crash in ig9icd64.dll when blitting to the window传送到窗口时,ig9icd64.dll 中的 EXCEPTION_ACCESS_VIOLATION 崩溃
【发布时间】:2017-10-28 19:26:09
【问题描述】:

当我渲染到一个 FBO 并将这个 FBO blit 到窗口并且窗口被最小化时,Java 会抛出一个 EXCEPTION_ACCESS_VIOLATION 异常。

这是我在屏幕上进行 blitting 的代码,据我所知,它的作用。

//Bind the draw framebuffer to the default (0) 
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0); 
//Bind the read framebuffer to the fbo id
GL30.glBindFramebuffer(GL30.GL_READ_FRAMEBUFFER, frameBufferID); 
//Setting the draw buffer to the screen
GL11.glDrawBuffer(GL11.GL_BACK); 
//Settiing the read buffer to the color attachment of the fbo
GL11.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0);
if(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) == GL30.GL_FRAMEBUFFER_COMPLETE) //Checking if the framebuffer is complete
{ 
  //Blitting the frambuffer to the screen
  GL30.glBlitFramebuffer(0, 0, fboWidth, fboHeight, 0, 0, windowWidth, windowHeight, GL11.GL_COLOR_BUFFER_BIT, GL11.GL_NEAREST); 
}
//Unbinding the framebuffer
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); 

为了防止崩溃,我添加了一个检查窗口是否最小化

if(isWindowIconified) return;
//Bind the draw framebuffer to the default (0) 
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0); 
//Bind the read framebuffer to the fbo
GL30.glBindFramebuffer(GL30.GL_READ_FRAMEBUFFER, frameBufferID); 
//Setting the draw buffer to the screen
GL11.glDrawBuffer(GL11.GL_BACK);
//Settiing the read buffer to the color attachment of the fbo
GL11.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); 
if(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) == GL30.GL_FRAMEBUFFER_COMPLETE)
{ 
  //Blitting the frambuffer to the screen
  GL30.glBlitFramebuffer(0, 0, fboWidth, fboHeight, 0, 0, windowWidth, windowHeight, GL11.GL_COLOR_BUFFER_BIT, GL11.GL_NEAREST); 
}
//Unbinding the framebuffer
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);

我在初始化窗口的时候也加了这段代码

//Setting the window minimisazion callback
glfwSetWindowIconifyCallback(window, new GLFWWindowIconifyCallbackI() { 
  @Override
  public void invoke(long window, boolean iconified) {
    isWindowIconified = iconified;
  }
});

现在,当我最小化它时程序不会崩溃,但是当我按 Windows+D 进入桌面时,程序仍然崩溃。

现在回答我的问题: 防止崩溃的最佳方法是什么? 为什么会这样?

Crash Report

系统信息:

操作系统:Windows 10 家庭版,版本 10.0.15063

GPU:英特尔核芯显卡 520

驱动版本:20.19.15.4642

OpenGL 版本:4.4

【问题讨论】:

    标签: java windows opengl lwjgl framebuffer


    【解决方案1】:

    如果 Java 抛出 EXCEPTION_ACCESS_VIOLATION 异常并且它发生在 ig9icd64.dll 中,可能是因为您使用了旧的 Intel GPU 驱动程序。在这种情况下,这似乎是问题所在,因为当我使用我的 NVIDIA GPU 启动程序时它不会发生,并且在我更新我的 Intel GPU 驱动程序后它没有崩溃。

    如果您不确定错误发生在哪里,请在崩溃报告中查找“Native frames:”和“Java frames:”。最上面一行显示错误发生的位置。

    【讨论】:

      猜你喜欢
      • 2014-10-13
      • 2014-06-17
      • 2013-10-22
      • 2015-11-13
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多