using swrAVX renders incorrectly at particular resolutions
Submitted by aya..@..ok.com
Assigned to mes..@..op.org
Link to original bug (#110468)
Description
Created attachment 144032 WGLINFO
At certain resolutions (360p, 720p, 1080p, 1440p and possibly others), the rendering is incorrect with GALLIUM_DRIVER=swr, using swrAVX.dll. For example, simply drawing a rectangle with glDrawElements results in an incorrectly rendered result. This works perfectly natively (with Intel's drivers) and with llvmpipe.
Steps to reproduce:
- Create a window at 720p, OpenGL 3.3 Core.
- Use the code below to set up the rectangle.
- Draw the rectangle using glDrawElements.
Code (Unfortunately, I do not know how to use glut so the window creation and rendering loop has been omitted):
#include <iostream>
int main() { // Set up OpenGL context // OpenGL 3.3 core, 720p
GLuint vao, vbo, ibo;
GLfloat position[] =
{
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f,
0.5f, 0.5f, 0.0f,
-0.5f, 0.5f, 0.0f
};
GLuint indices[] =
{
0, 1, 2,
0, 2, 3
};
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(position), position, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0);
glGenBuffers(1, &ibo);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
GLuint vertex = glCreateShader(GL_VERTEX_SHADER), fragment = glCreateShader(GL_FRAGMENT_SHADER);
{
const char* shaderSource =
"#version 330 core\n"
"layout(location = 0) in vec3 position;\n"
"\n"
"void main()\n"
"{\n"
"gl_Position = vec4(position, 1.0);\n"
"}\n"
"";
glShaderSource(vertex, 1, &shaderSource, 0);
glCompileShader(vertex);
// Check compile status
}
{
const char* shaderSource =
"#version 330 core\n"
"layout(location = 0) out vec4 col;\n"
"\n"
"void main()\n"
"{\n"
"col = vec4(0.3, 0.8, 0.2, 1.0);\n"
"}\n"
"";
glShaderSource(fragment, 1, &shaderSource, 0);
glCompileShader(fragment);
// Check compile status
}
GLuint program = glCreateProgram();
glAttachShader(program, vertex);
glAttachShader(program, fragment);
glLinkProgram(program);
glValidateProgram(program);
// Check link status
glUseProgram(program);
// Render using glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
}
Attachment 144032, "WGLINFO":
file_110468.txt
Version: 19.0