mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Don't use persistently mapped buffers on Intel Ivy Bridge GPUs on Windows. glClientWaitSync can hang with those drivers, apparently.
This commit is contained in:
@@ -147,6 +147,15 @@ bool OpenGL::initContext()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOVE_WINDOWS
|
||||||
|
if (getVendor() == VENDOR_INTEL && gl.isCoreProfile())
|
||||||
|
{
|
||||||
|
const char *device = (const char *) glGetString(GL_RENDERER);
|
||||||
|
if (strstr(device, "HD Graphics 4000") || strstr(device, "HD Graphics 2500"))
|
||||||
|
bugs.clientWaitSyncStalls = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
contextInitialized = true;
|
contextInitialized = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -152,6 +152,13 @@ public:
|
|||||||
**/
|
**/
|
||||||
bool generateMipmapsRequiresTexture2DEnable;
|
bool generateMipmapsRequiresTexture2DEnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report: Intel HD 4000 on Windows hangs during glClientWaitSync.
|
||||||
|
* I found this when googling the issue:
|
||||||
|
* https://github.com/mjn33/planetgen/commit/235e23873a22e219fffdd9ede706c1051aa0f107
|
||||||
|
**/
|
||||||
|
bool clientWaitSyncStalls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other bugs which have workarounds that don't use conditional code at
|
* Other bugs which have workarounds that don't use conditional code at
|
||||||
* the moment:
|
* the moment:
|
||||||
|
|||||||
@@ -538,14 +538,17 @@ love::graphics::StreamBuffer *CreateStreamBuffer(BufferType mode, size_t size)
|
|||||||
{
|
{
|
||||||
if (gl.isCoreProfile())
|
if (gl.isCoreProfile())
|
||||||
{
|
{
|
||||||
// AMD's pinned memory seems to be faster than persistent mapping, on
|
if (!gl.bugs.clientWaitSyncStalls)
|
||||||
// AMD GPUs.
|
{
|
||||||
if (GLAD_AMD_pinned_memory)
|
// AMD's pinned memory seems to be faster than persistent mapping,
|
||||||
return new StreamBufferPinnedMemory(mode, size);
|
// on AMD GPUs.
|
||||||
else if (GLAD_VERSION_4_4 || GLAD_ARB_buffer_storage)
|
if (GLAD_AMD_pinned_memory)
|
||||||
return new StreamBufferPersistentMapSync(mode, size);
|
return new StreamBufferPinnedMemory(mode, size);
|
||||||
else
|
else if (GLAD_VERSION_4_4 || GLAD_ARB_buffer_storage)
|
||||||
return new StreamBufferSubDataOrphan(mode, size);
|
return new StreamBufferPersistentMapSync(mode, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new StreamBufferSubDataOrphan(mode, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return new StreamBufferClientMemory(mode, size);
|
return new StreamBufferClientMemory(mode, size);
|
||||||
|
|||||||
Reference in New Issue
Block a user