EXCEPTION_ACCESS_VIOLATION 向 window 传送时在 ig9icd64.dll 中崩溃
EXCEPTION_ACCESS_VIOLATION crash in ig9icd64.dll when blitting to the window
当我渲染到一个 FBO 并将这个 FBO blit 到 window 并且 window 被最小化时 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);
为了防止崩溃,我添加了一个检查以检查 window 是否已最小化
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);
我在初始化window
的时候也加了这段代码
//Setting the window minimisazion callback
glfwSetWindowIconifyCallback(window, new GLFWWindowIconifyCallbackI() {
@Override
public void invoke(long window, boolean iconified) {
isWindowIconified = iconified;
}
});
现在最小化程序不会崩溃,但是当我按Windows+D进入桌面时程序仍然会崩溃。
现在回答我的问题:
防止崩溃的最佳方法是什么?
为什么会这样?
系统信息:
OS: Windows 10 主页,版本 10.0.15063
GPU:英特尔核芯显卡 520
驱动版本:20.19.15.4642
OpenGL 版本:4.4
如果 Java 抛出 EXCEPTION_ACCESS_VIOLATION 异常并且它发生在 ig9icd64.dll 中,这可能是因为您使用旧的 Intel GPU 驱动程序。在这种情况下,这似乎是问题所在,因为当我使用我的 NVIDIA GPU 启动程序时它不会发生,并且在我更新我的 Intel GPU 驱动程序后它没有崩溃。
如果您不确定错误发生的位置,请在崩溃报告中查找 "Native frames:" 和 "Java frames:"。最上面的行显示错误发生的位置。
当我渲染到一个 FBO 并将这个 FBO blit 到 window 并且 window 被最小化时 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);
为了防止崩溃,我添加了一个检查以检查 window 是否已最小化
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);
我在初始化window
的时候也加了这段代码//Setting the window minimisazion callback
glfwSetWindowIconifyCallback(window, new GLFWWindowIconifyCallbackI() {
@Override
public void invoke(long window, boolean iconified) {
isWindowIconified = iconified;
}
});
现在最小化程序不会崩溃,但是当我按Windows+D进入桌面时程序仍然会崩溃。
现在回答我的问题: 防止崩溃的最佳方法是什么? 为什么会这样?
系统信息:
OS: Windows 10 主页,版本 10.0.15063
GPU:英特尔核芯显卡 520
驱动版本:20.19.15.4642
OpenGL 版本:4.4
如果 Java 抛出 EXCEPTION_ACCESS_VIOLATION 异常并且它发生在 ig9icd64.dll 中,这可能是因为您使用旧的 Intel GPU 驱动程序。在这种情况下,这似乎是问题所在,因为当我使用我的 NVIDIA GPU 启动程序时它不会发生,并且在我更新我的 Intel GPU 驱动程序后它没有崩溃。
如果您不确定错误发生的位置,请在崩溃报告中查找 "Native frames:" 和 "Java frames:"。最上面的行显示错误发生的位置。