我一直在尝试永久修复此错误,并且将其范围缩小到调整窗口大小,然后使用此特定的着色器。
我尝试过的东西:
计算机使用的是Intel HD 4600 + Windows 8.1
这是崩溃日志。
>OS-Version: 6.2.9200 () 0x300-0x1
>ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 55FDAD5C)
>55FDAD5C (ig75icd32): (filename not available): DrvSetLayerPaletteEntries
>ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 55FFB4F3)
>55FFB4F3 (ig75icd32): (filename not available): DrvSetLayerPaletteEntries
>ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 5621162E)
>5621162E (ig75icd32): (filename not available): DllMain
>btg\glitchpainter.cpp (238): GlitchPainter::Render
GlitchPainter :: Render :: 238
glUniform1f(location, value)
ERROR_INVALID_ADDRESS 487 (0x1E7)尝试访问无效的地址。
使用的着色器
#version 150
in fData {
vec2 TexCoord;
} frag;
uniform float Val1;
uniform float Power;
out vec4 outputColor;
void main()
{
float noise = fract(sin(dot(frag.TexCoord * (Val1 + 0.1618033988f), vec2(0.1618033988f, 0.3141592653f))) * 14142.13562f);
outputColor = vec4(1.f, 1.f, 1.f, 1.f) * noise * 0.5f * Power;
}
调整大小后将调用RestartWindow()
。
void Window::RestartWindow()
{
// Setting up the Window
m_RenderWindow->create(m_Settings.VideoMode, m_Settings.TitleText, m_Settings.WindowStyle, m_Settings.ContextSettings);
m_RenderWindow->setVerticalSyncEnabled(m_Settings.vSync);
m_RenderWindow->setFramerateLimit(m_Settings.FrameRate);
// Work around because border-less is weird with SFML
if (m_Settings.Borderless) m_RenderWindow->setPosition({ 0, 0 });
// Moving the window to the center (The Camera System will take care of this later)
sf::View view = m_RenderWindow->getView();
view.setCenter(sf::Vector2f(0, 0));
view.zoom(Global::ZoomFactor);
m_RenderWindow->setView(view);
// Getting the system handle
m_HWND = m_RenderWindow->getSystemHandle();
// This will force the renderer to reload
Global::ReloadRenderer = true;
}
void Renderer::Reload()
{
g_Storage->GetShaderFactory()->FlushVA();
g_Storage->GetShaderFactory()->TryLoadVA();
// Remove previous resources
Flush();
// Creating a new frame buffer for post-fx's
glCheck(glGenFramebuffers(1, &Global::PostFXFrameBuffer));
if (Global::PostFXFrameBuffer == SHADER_VAR_NOT_YET_LOADED)
{
g_ErrorReport("Could not generate frame buffer.");
}
// Creating and setting parameters for the post fx sampler
glCheck(glGenSamplers(1, &Global::PostFXSampler));
glCheck(glSamplerParameteri(Global::PostFXSampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
glCheck(glSamplerParameteri(Global::PostFXSampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
if (Global::PostFXSampler == SHADER_VAR_NOT_YET_LOADED)
{
g_ErrorReport("Could not generate sampler.");
}
// Creating and binding the color attachment with the postfx frame buffer
glGenTextures(1, &Global::PostFXColorAttachment);
glCheck(glBindFramebuffer(GL_FRAMEBUFFER, Global::PostFXFrameBuffer));
glBindTexture(GL_TEXTURE_2D, Global::PostFXColorAttachment);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, Global::ScaledWidth, Global::ScaledHeight, 0, GL_RGB, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glCheck(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, Global::PostFXColorAttachment, 0));
if (Global::PostFXColorAttachment == SHADER_VAR_NOT_YET_LOADED)
{
g_ErrorReport("Could not generate color attachment.");
}
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE)
{
g_ErrorReport("Framebuffer creation failed with: %d", (int)status);
ErrorSystem::Get()->FatalExit(L"Framebuffer creation failed.");
}
g_BetaReport("FB: %d, Sampler: %d, ColorAttachment: %d", Global::PostFXFrameBuffer, Global::PostFXSampler, Global::PostFXColorAttachment);
// The renderer have been reloaded
Global::ReloadRenderer = false;
}
void Renderer::Flush()
{
if (Global::PostFXFrameBuffer != SHADER_VAR_NOT_YET_LOADED)
{
glCheck(glDeleteFramebuffers(1, &Global::PostFXFrameBuffer));
Global::PostFXFrameBuffer = SHADER_VAR_NOT_YET_LOADED;
}
if (Global::PostFXSampler != SHADER_VAR_NOT_YET_LOADED)
{
glCheck(glDeleteSamplers(1, &Global::PostFXSampler));
Global::PostFXSampler = SHADER_VAR_NOT_YET_LOADED;
}
if (Global::PostFXColorAttachment != SHADER_VAR_NOT_YET_LOADED)
{
glDeleteTextures(1, &Global::PostFXColorAttachment);
Global::PostFXColorAttachment = SHADER_VAR_NOT_YET_LOADED;
}
}