[iortcw] 09/95: All: Rend2: Detect Intel graphics and avoid/use certain operations there
Simon McVittie
smcv at debian.org
Fri Sep 8 10:41:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51
in repository iortcw.
commit e7b35844d738332409bb1e2e4efb9813d15f36fb
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Thu Dec 8 16:05:27 2016 -0500
All: Rend2: Detect Intel graphics and avoid/use certain operations there
---
MP/code/rend2/qgl.h | 2 +-
MP/code/rend2/tr_backend.c | 8 +++++---
MP/code/rend2/tr_dsa.c | 6 +++---
MP/code/rend2/tr_dsa.h | 4 ++--
MP/code/rend2/tr_extensions.c | 5 +++++
MP/code/rend2/tr_fbo.c | 2 +-
MP/code/rend2/tr_image.c | 2 +-
MP/code/rend2/tr_local.h | 2 ++
MP/code/rend2/tr_vbo.c | 4 ++--
MP/code/renderer/qgl.h | 2 +-
SP/code/rend2/qgl.h | 2 +-
SP/code/rend2/tr_backend.c | 8 +++++---
SP/code/rend2/tr_dsa.c | 6 +++---
SP/code/rend2/tr_dsa.h | 4 ++--
SP/code/rend2/tr_extensions.c | 5 +++++
SP/code/rend2/tr_fbo.c | 2 +-
SP/code/rend2/tr_image.c | 2 +-
SP/code/rend2/tr_local.h | 2 ++
SP/code/rend2/tr_vbo.c | 4 ++--
SP/code/renderer/qgl.h | 2 +-
20 files changed, 46 insertions(+), 28 deletions(-)
diff --git a/MP/code/rend2/qgl.h b/MP/code/rend2/qgl.h
index 552e279..79eac8f 100644
--- a/MP/code/rend2/qgl.h
+++ b/MP/code/rend2/qgl.h
@@ -705,7 +705,7 @@ extern void (APIENTRYP qglPNTrianglesfATI)(GLenum pname, GLfloat param);
GLE(GLvoid, TextureParameteriEXT, GLuint texture, GLenum target, GLenum pname, GLint param) \
GLE(GLvoid, TextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) \
GLE(GLvoid, TextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) \
- GLE(GLvoid, CopyTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) \
+ GLE(GLvoid, CopyTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) \
GLE(GLvoid, CompressedTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, CompressedTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, GenerateTextureMipmapEXT, GLuint texture, GLenum target) \
diff --git a/MP/code/rend2/tr_backend.c b/MP/code/rend2/tr_backend.c
index b908761..9d26607 100644
--- a/MP/code/rend2/tr_backend.c
+++ b/MP/code/rend2/tr_backend.c
@@ -1241,7 +1241,9 @@ const void *RB_DrawSurfs( const void *data ) {
else if (tr.renderFbo == NULL && tr.renderDepthImage)
{
// If we're rendering directly to the screen, copy the depth to a texture
- qglCopyTextureImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 0, 0, glConfig.vidWidth, glConfig.vidHeight, 0);
+ // This is incredibly slow on Intel Graphics, so just skip it on there
+ if (!glRefConfig.intelGraphics)
+ qglCopyTextureSubImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, 0, 0, 0, 0, glConfig.vidWidth, glConfig.vidHeight);
}
if (tr.hdrDepthFbo)
@@ -1747,14 +1749,14 @@ const void *RB_CapShadowMap(const void *data)
{
if (tr.shadowCubemaps[cmd->map])
{
- qglCopyTextureImage2DEXT(tr.shadowCubemaps[cmd->map]->texnum, GL_TEXTURE_CUBE_MAP_POSITIVE_X + cmd->cubeSide, 0, GL_RGBA8, backEnd.refdef.x, glConfig.vidHeight - ( backEnd.refdef.y + PSHADOW_MAP_SIZE ), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, 0);
+ qglCopyTextureSubImage2DEXT(tr.shadowCubemaps[cmd->map]->texnum, GL_TEXTURE_CUBE_MAP_POSITIVE_X + cmd->cubeSide, 0, 0, 0, backEnd.refdef.x, glConfig.vidHeight - ( backEnd.refdef.y + PSHADOW_MAP_SIZE ), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE);
}
}
else
{
if (tr.pshadowMaps[cmd->map])
{
- qglCopyTextureImage2DEXT(tr.pshadowMaps[cmd->map]->texnum, GL_TEXTURE_2D, 0, GL_RGBA8, backEnd.refdef.x, glConfig.vidHeight - (backEnd.refdef.y + PSHADOW_MAP_SIZE), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, 0);
+ qglCopyTextureSubImage2DEXT(tr.pshadowMaps[cmd->map]->texnum, GL_TEXTURE_2D, 0, 0, 0, backEnd.refdef.x, glConfig.vidHeight - (backEnd.refdef.y + PSHADOW_MAP_SIZE), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE);
}
}
}
diff --git a/MP/code/rend2/tr_dsa.c b/MP/code/rend2/tr_dsa.c
index f738a5d..8fde841 100644
--- a/MP/code/rend2/tr_dsa.c
+++ b/MP/code/rend2/tr_dsa.c
@@ -113,11 +113,11 @@ GLvoid APIENTRY GLDSA_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint
qglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
}
-GLvoid APIENTRY GLDSA_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+GLvoid APIENTRY GLDSA_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
GL_BindMultiTexture(glDsaState.texunit, target, texture);
- qglCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ qglCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
GLvoid APIENTRY GLDSA_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
diff --git a/MP/code/rend2/tr_dsa.h b/MP/code/rend2/tr_dsa.h
index ea9e0ad..9248a88 100644
--- a/MP/code/rend2/tr_dsa.h
+++ b/MP/code/rend2/tr_dsa.h
@@ -33,8 +33,8 @@ GLvoid APIENTRY GLDSA_TextureImage2DEXT(GLuint texture, GLenum target, GLint lev
GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
GLvoid APIENTRY GLDSA_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLvoid APIENTRY GLDSA_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLvoid APIENTRY GLDSA_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
GLvoid APIENTRY GLDSA_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
GLvoid APIENTRY GLDSA_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
diff --git a/MP/code/rend2/tr_extensions.c b/MP/code/rend2/tr_extensions.c
index 9c62182..59eee43 100644
--- a/MP/code/rend2/tr_extensions.c
+++ b/MP/code/rend2/tr_extensions.c
@@ -63,6 +63,11 @@ void GLimp_InitExtraExtensions()
ri.Error(ERR_FATAL, "OpenGL 2.0 required!");
ri.Printf(PRINT_ALL, "...using OpenGL %s\n", glConfig.version_string);
+ // Check if we need Intel graphics specific fixes.
+ glRefConfig.intelGraphics = qfalse;
+ if (strstr((char *)qglGetString(GL_RENDERER), "Intel"))
+ glRefConfig.intelGraphics = qtrue;
+
// set DSA fallbacks
#define GLE(ret, name, ...) qgl##name = GLDSA_##name;
QGL_EXT_direct_state_access_PROCS;
diff --git a/MP/code/rend2/tr_fbo.c b/MP/code/rend2/tr_fbo.c
index aa5148c..6b7ab01 100644
--- a/MP/code/rend2/tr_fbo.c
+++ b/MP/code/rend2/tr_fbo.c
@@ -271,7 +271,7 @@ void FBO_Init(void)
R_IssuePendingRenderCommands();
hdrFormat = GL_RGBA8;
- if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat)
+ if (r_hdr->integer && glRefConfig.textureFloat)
hdrFormat = GL_RGBA16F_ARB;
if (glRefConfig.framebufferMultisample)
diff --git a/MP/code/rend2/tr_image.c b/MP/code/rend2/tr_image.c
index df4f940..1d03b2a 100644
--- a/MP/code/rend2/tr_image.c
+++ b/MP/code/rend2/tr_image.c
@@ -2840,7 +2840,7 @@ void R_CreateBuiltinImages( void ) {
height = glConfig.vidHeight;
hdrFormat = GL_RGBA8;
- if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat)
+ if (r_hdr->integer && glRefConfig.textureFloat)
hdrFormat = GL_RGBA16F_ARB;
rgbFormat = GL_RGBA8;
diff --git a/MP/code/rend2/tr_local.h b/MP/code/rend2/tr_local.h
index fc066ae..18fb33d 100644
--- a/MP/code/rend2/tr_local.h
+++ b/MP/code/rend2/tr_local.h
@@ -1504,6 +1504,8 @@ typedef struct {
int openglMajorVersion;
int openglMinorVersion;
+ qboolean intelGraphics;
+
qboolean drawRangeElements;
qboolean multiDrawArrays;
qboolean occlusionQuery;
diff --git a/MP/code/rend2/tr_vbo.c b/MP/code/rend2/tr_vbo.c
index 7b68f43..0ac63a4 100644
--- a/MP/code/rend2/tr_vbo.c
+++ b/MP/code/rend2/tr_vbo.c
@@ -360,8 +360,8 @@ void R_BindVao(vao_t * vao)
{
qglBindVertexArray(vao->vao);
- // why you no save GL_ELEMENT_ARRAY_BUFFER binding, Intel?
- if (1)
+ // Intel Graphics doesn't save GL_ELEMENT_ARRAY_BUFFER binding with VAO binding.
+ if (glRefConfig.intelGraphics || vao == tess.vao)
qglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vao->indexesIBO);
// tess VAO always has buffers bound
diff --git a/MP/code/renderer/qgl.h b/MP/code/renderer/qgl.h
index 8cfac2f..6f69d23 100644
--- a/MP/code/renderer/qgl.h
+++ b/MP/code/renderer/qgl.h
@@ -764,7 +764,7 @@ extern void (APIENTRYP qglPNTrianglesfATI)(GLenum pname, GLfloat param);
GLE(GLvoid, TextureParameteriEXT, GLuint texture, GLenum target, GLenum pname, GLint param) \
GLE(GLvoid, TextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) \
GLE(GLvoid, TextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) \
- GLE(GLvoid, CopyTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) \
+ GLE(GLvoid, CopyTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) \
GLE(GLvoid, CompressedTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, CompressedTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, GenerateTextureMipmapEXT, GLuint texture, GLenum target) \
diff --git a/SP/code/rend2/qgl.h b/SP/code/rend2/qgl.h
index 222e0a1..bac919c 100644
--- a/SP/code/rend2/qgl.h
+++ b/SP/code/rend2/qgl.h
@@ -705,7 +705,7 @@ extern void (APIENTRYP qglPNTrianglesfATI)(GLenum pname, GLfloat param);
GLE(GLvoid, TextureParameteriEXT, GLuint texture, GLenum target, GLenum pname, GLint param) \
GLE(GLvoid, TextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) \
GLE(GLvoid, TextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) \
- GLE(GLvoid, CopyTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) \
+ GLE(GLvoid, CopyTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) \
GLE(GLvoid, CompressedTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, CompressedTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, GenerateTextureMipmapEXT, GLuint texture, GLenum target) \
diff --git a/SP/code/rend2/tr_backend.c b/SP/code/rend2/tr_backend.c
index d411d79..d3478d3 100644
--- a/SP/code/rend2/tr_backend.c
+++ b/SP/code/rend2/tr_backend.c
@@ -1491,7 +1491,9 @@ const void *RB_DrawSurfs( const void *data ) {
else if (tr.renderFbo == NULL && tr.renderDepthImage)
{
// If we're rendering directly to the screen, copy the depth to a texture
- qglCopyTextureImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 0, 0, glConfig.vidWidth, glConfig.vidHeight, 0);
+ // This is incredibly slow on Intel Graphics, so just skip it on there
+ if (!glRefConfig.intelGraphics)
+ qglCopyTextureSubImage2DEXT(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, 0, 0, 0, 0, glConfig.vidWidth, glConfig.vidHeight);
}
if (tr.hdrDepthFbo)
@@ -1997,14 +1999,14 @@ const void *RB_CapShadowMap(const void *data)
{
if (tr.shadowCubemaps[cmd->map])
{
- qglCopyTextureImage2DEXT(tr.shadowCubemaps[cmd->map]->texnum, GL_TEXTURE_CUBE_MAP_POSITIVE_X + cmd->cubeSide, 0, GL_RGBA8, backEnd.refdef.x, glConfig.vidHeight - ( backEnd.refdef.y + PSHADOW_MAP_SIZE ), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, 0);
+ qglCopyTextureSubImage2DEXT(tr.shadowCubemaps[cmd->map]->texnum, GL_TEXTURE_CUBE_MAP_POSITIVE_X + cmd->cubeSide, 0, 0, 0, backEnd.refdef.x, glConfig.vidHeight - ( backEnd.refdef.y + PSHADOW_MAP_SIZE ), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE);
}
}
else
{
if (tr.pshadowMaps[cmd->map])
{
- qglCopyTextureImage2DEXT(tr.pshadowMaps[cmd->map]->texnum, GL_TEXTURE_2D, 0, GL_RGBA8, backEnd.refdef.x, glConfig.vidHeight - (backEnd.refdef.y + PSHADOW_MAP_SIZE), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, 0);
+ qglCopyTextureSubImage2DEXT(tr.pshadowMaps[cmd->map]->texnum, GL_TEXTURE_2D, 0, 0, 0, backEnd.refdef.x, glConfig.vidHeight - (backEnd.refdef.y + PSHADOW_MAP_SIZE), PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE);
}
}
}
diff --git a/SP/code/rend2/tr_dsa.c b/SP/code/rend2/tr_dsa.c
index f738a5d..8fde841 100644
--- a/SP/code/rend2/tr_dsa.c
+++ b/SP/code/rend2/tr_dsa.c
@@ -113,11 +113,11 @@ GLvoid APIENTRY GLDSA_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint
qglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
}
-GLvoid APIENTRY GLDSA_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+GLvoid APIENTRY GLDSA_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
GL_BindMultiTexture(glDsaState.texunit, target, texture);
- qglCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ qglCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
GLvoid APIENTRY GLDSA_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
diff --git a/SP/code/rend2/tr_dsa.h b/SP/code/rend2/tr_dsa.h
index ea9e0ad..9248a88 100644
--- a/SP/code/rend2/tr_dsa.h
+++ b/SP/code/rend2/tr_dsa.h
@@ -33,8 +33,8 @@ GLvoid APIENTRY GLDSA_TextureImage2DEXT(GLuint texture, GLenum target, GLint lev
GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
GLvoid APIENTRY GLDSA_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLvoid APIENTRY GLDSA_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLvoid APIENTRY GLDSA_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
GLvoid APIENTRY GLDSA_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
GLvoid APIENTRY GLDSA_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
diff --git a/SP/code/rend2/tr_extensions.c b/SP/code/rend2/tr_extensions.c
index 9c62182..59eee43 100644
--- a/SP/code/rend2/tr_extensions.c
+++ b/SP/code/rend2/tr_extensions.c
@@ -63,6 +63,11 @@ void GLimp_InitExtraExtensions()
ri.Error(ERR_FATAL, "OpenGL 2.0 required!");
ri.Printf(PRINT_ALL, "...using OpenGL %s\n", glConfig.version_string);
+ // Check if we need Intel graphics specific fixes.
+ glRefConfig.intelGraphics = qfalse;
+ if (strstr((char *)qglGetString(GL_RENDERER), "Intel"))
+ glRefConfig.intelGraphics = qtrue;
+
// set DSA fallbacks
#define GLE(ret, name, ...) qgl##name = GLDSA_##name;
QGL_EXT_direct_state_access_PROCS;
diff --git a/SP/code/rend2/tr_fbo.c b/SP/code/rend2/tr_fbo.c
index aa5148c..6b7ab01 100644
--- a/SP/code/rend2/tr_fbo.c
+++ b/SP/code/rend2/tr_fbo.c
@@ -271,7 +271,7 @@ void FBO_Init(void)
R_IssuePendingRenderCommands();
hdrFormat = GL_RGBA8;
- if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat)
+ if (r_hdr->integer && glRefConfig.textureFloat)
hdrFormat = GL_RGBA16F_ARB;
if (glRefConfig.framebufferMultisample)
diff --git a/SP/code/rend2/tr_image.c b/SP/code/rend2/tr_image.c
index 5b35db8..5c9c72f 100644
--- a/SP/code/rend2/tr_image.c
+++ b/SP/code/rend2/tr_image.c
@@ -2844,7 +2844,7 @@ void R_CreateBuiltinImages( void ) {
height = glConfig.vidHeight;
hdrFormat = GL_RGBA8;
- if (r_hdr->integer && glRefConfig.framebufferObject && glRefConfig.textureFloat)
+ if (r_hdr->integer && glRefConfig.textureFloat)
hdrFormat = GL_RGBA16F_ARB;
rgbFormat = GL_RGBA8;
diff --git a/SP/code/rend2/tr_local.h b/SP/code/rend2/tr_local.h
index 8930563..8646128 100644
--- a/SP/code/rend2/tr_local.h
+++ b/SP/code/rend2/tr_local.h
@@ -1517,6 +1517,8 @@ typedef struct {
int openglMajorVersion;
int openglMinorVersion;
+ qboolean intelGraphics;
+
qboolean drawRangeElements;
qboolean multiDrawArrays;
qboolean occlusionQuery;
diff --git a/SP/code/rend2/tr_vbo.c b/SP/code/rend2/tr_vbo.c
index 7b68f43..0ac63a4 100644
--- a/SP/code/rend2/tr_vbo.c
+++ b/SP/code/rend2/tr_vbo.c
@@ -360,8 +360,8 @@ void R_BindVao(vao_t * vao)
{
qglBindVertexArray(vao->vao);
- // why you no save GL_ELEMENT_ARRAY_BUFFER binding, Intel?
- if (1)
+ // Intel Graphics doesn't save GL_ELEMENT_ARRAY_BUFFER binding with VAO binding.
+ if (glRefConfig.intelGraphics || vao == tess.vao)
qglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vao->indexesIBO);
// tess VAO always has buffers bound
diff --git a/SP/code/renderer/qgl.h b/SP/code/renderer/qgl.h
index 113689b..b271188 100644
--- a/SP/code/renderer/qgl.h
+++ b/SP/code/renderer/qgl.h
@@ -764,7 +764,7 @@ extern void (APIENTRYP qglPNTrianglesfATI)(GLenum pname, GLfloat param);
GLE(GLvoid, TextureParameteriEXT, GLuint texture, GLenum target, GLenum pname, GLint param) \
GLE(GLvoid, TextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) \
GLE(GLvoid, TextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) \
- GLE(GLvoid, CopyTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) \
+ GLE(GLvoid, CopyTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) \
GLE(GLvoid, CompressedTextureImage2DEXT, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, CompressedTextureSubImage2DEXT, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) \
GLE(GLvoid, GenerateTextureMipmapEXT, GLuint texture, GLenum target) \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list