aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-01 08:46:12 +0200
committermarha <marha@users.sourceforge.net>2014-07-01 08:46:12 +0200
commitcfc5bafcb2db8c6e05d7be6bb7315960be08c0d8 (patch)
tree1103248fcbdd2cd7a9b6cf1d336da7b3f58d4e2b /mesalib/src/mesa/drivers/common/meta.c
parentfba3b6d1979c1d1ad0d56d46fc2d787f111c07fb (diff)
downloadvcxsrv-cfc5bafcb2db8c6e05d7be6bb7315960be08c0d8.tar.gz
vcxsrv-cfc5bafcb2db8c6e05d7be6bb7315960be08c0d8.tar.bz2
vcxsrv-cfc5bafcb2db8c6e05d7be6bb7315960be08c0d8.zip
fontconfig mesa pixman git update 1 July 2014
pixman commit 5a2edb3f2c2cfde6b25ac614e2004a9f78583d74 fontconfig commit dab60e4476ada4ad4639599ea24dd012d4a79584 mesa commit 1bfc0a11027449ae7ab7c28eb695f26de530eccf
Diffstat (limited to 'mesalib/src/mesa/drivers/common/meta.c')
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index 1a2e45320..f313f5645 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -1515,23 +1515,15 @@ static void
meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
{
const char *vs_source =
+ "#extension GL_AMD_vertex_shader_layer : enable\n"
"attribute vec4 position;\n"
- "void main()\n"
- "{\n"
- " gl_Position = position;\n"
- "}\n";
- const char *gs_source =
- "#version 150\n"
- "layout(triangles) in;\n"
- "layout(triangle_strip, max_vertices = 4) out;\n"
"uniform int layer;\n"
"void main()\n"
"{\n"
- " for (int i = 0; i < 3; i++) {\n"
- " gl_Layer = layer;\n"
- " gl_Position = gl_in[i].gl_Position;\n"
- " EmitVertex();\n"
- " }\n"
+ "#ifdef GL_AMD_vertex_shader_layer\n"
+ " gl_Layer = layer;\n"
+ "#endif\n"
+ " gl_Position = position;\n"
"}\n";
const char *fs_source =
"uniform vec4 color;\n"
@@ -1539,7 +1531,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
"{\n"
" gl_FragColor = color;\n"
"}\n";
- GLuint vs, gs = 0, fs;
+ GLuint vs, fs;
bool has_integer_textures;
_mesa_meta_setup_vertex_objects(&clear->VAO, &clear->VBO, true, 3, 0, 0);
@@ -1551,12 +1543,6 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
_mesa_ShaderSource(vs, 1, &vs_source, NULL);
_mesa_CompileShader(vs);
- if (_mesa_has_geometry_shaders(ctx)) {
- gs = _mesa_CreateShader(GL_GEOMETRY_SHADER);
- _mesa_ShaderSource(gs, 1, &gs_source, NULL);
- _mesa_CompileShader(gs);
- }
-
fs = _mesa_CreateShader(GL_FRAGMENT_SHADER);
_mesa_ShaderSource(fs, 1, &fs_source, NULL);
_mesa_CompileShader(fs);
@@ -1564,20 +1550,14 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
clear->ShaderProg = _mesa_CreateProgram();
_mesa_AttachShader(clear->ShaderProg, fs);
_mesa_DeleteShader(fs);
- if (gs != 0)
- _mesa_AttachShader(clear->ShaderProg, gs);
_mesa_AttachShader(clear->ShaderProg, vs);
_mesa_DeleteShader(vs);
_mesa_BindAttribLocation(clear->ShaderProg, 0, "position");
_mesa_ObjectLabel(GL_PROGRAM, clear->ShaderProg, -1, "meta clear");
_mesa_LinkProgram(clear->ShaderProg);
- clear->ColorLocation = _mesa_GetUniformLocation(clear->ShaderProg,
- "color");
- if (gs != 0) {
- clear->LayerLocation = _mesa_GetUniformLocation(clear->ShaderProg,
- "layer");
- }
+ clear->ColorLocation = _mesa_GetUniformLocation(clear->ShaderProg, "color");
+ clear->LayerLocation = _mesa_GetUniformLocation(clear->ShaderProg, "layer");
has_integer_textures = _mesa_is_gles3(ctx) ||
(_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130);
@@ -1587,9 +1567,14 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
const char *vs_int_source =
ralloc_asprintf(shader_source_mem_ctx,
"#version 130\n"
+ "#extension GL_AMD_vertex_shader_layer : enable\n"
"in vec4 position;\n"
+ "uniform int layer;\n"
"void main()\n"
"{\n"
+ "#ifdef GL_AMD_vertex_shader_layer\n"
+ " gl_Layer = layer;\n"
+ "#endif\n"
" gl_Position = position;\n"
"}\n");
const char *fs_int_source =
@@ -1612,8 +1597,6 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
clear->IntegerShaderProg = _mesa_CreateProgram();
_mesa_AttachShader(clear->IntegerShaderProg, fs);
_mesa_DeleteShader(fs);
- if (gs != 0)
- _mesa_AttachShader(clear->IntegerShaderProg, gs);
_mesa_AttachShader(clear->IntegerShaderProg, vs);
_mesa_DeleteShader(vs);
_mesa_BindAttribLocation(clear->IntegerShaderProg, 0, "position");
@@ -1629,13 +1612,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
clear->IntegerColorLocation =
_mesa_GetUniformLocation(clear->IntegerShaderProg, "color");
- if (gs != 0) {
- clear->IntegerLayerLocation =
- _mesa_GetUniformLocation(clear->IntegerShaderProg, "layer");
- }
+ clear->IntegerLayerLocation =
+ _mesa_GetUniformLocation(clear->IntegerShaderProg, "layer");
}
- if (gs != 0)
- _mesa_DeleteShader(gs);
}
static void
@@ -1843,7 +1822,7 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl)
/* draw quad(s) */
if (fb->MaxNumLayers > 0) {
unsigned layer;
- assert(glsl);
+ assert(glsl && clear->LayerLocation != -1);
for (layer = 0; layer < fb->MaxNumLayers; layer++) {
if (fb->_IntegerColor)
_mesa_Uniform1i(clear->IntegerLayerLocation, layer);