aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-12 16:45:42 +0100
committermarha <marha@users.sourceforge.net>2014-03-12 16:45:42 +0100
commitcc6db22a772cc52ead6a5c11d7d02e7364f6326c (patch)
treed80b42172d703ec20ccd99c68a067505e2706899 /mesalib/src/mesa/drivers
parent2112b7dec49833ba872bd3ebcd7288930fec0796 (diff)
parentcd8b0d0de3fcb53f6d3ece8ce26d97aaab2c0914 (diff)
downloadvcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.tar.gz
vcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.tar.bz2
vcxsrv-cc6db22a772cc52ead6a5c11d7d02e7364f6326c.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa xserver xkbcomp git update 12 Mar 2014
Diffstat (limited to 'mesalib/src/mesa/drivers')
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c87
-rw-r--r--mesalib/src/mesa/drivers/common/meta.h2
-rw-r--r--mesalib/src/mesa/drivers/common/meta_blit.c6
-rw-r--r--mesalib/src/mesa/drivers/common/meta_generate_mipmap.c3
-rw-r--r--mesalib/src/mesa/drivers/dri/Makefile.am28
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am2
6 files changed, 63 insertions, 65 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index 030e1116e..76cbb41a9 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -100,7 +100,7 @@ _mesa_meta_compile_shader_with_debug(struct gl_context *ctx, GLenum target,
GLint ok, size;
GLchar *info;
- shader = _mesa_CreateShaderObjectARB(target);
+ shader = _mesa_CreateShader(target);
_mesa_ShaderSource(shader, 1, &source, NULL);
_mesa_CompileShader(shader);
@@ -110,13 +110,13 @@ _mesa_meta_compile_shader_with_debug(struct gl_context *ctx, GLenum target,
_mesa_GetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
if (size == 0) {
- _mesa_DeleteObjectARB(shader);
+ _mesa_DeleteShader(shader);
return 0;
}
info = malloc(size);
if (!info) {
- _mesa_DeleteObjectARB(shader);
+ _mesa_DeleteShader(shader);
return 0;
}
@@ -127,7 +127,7 @@ _mesa_meta_compile_shader_with_debug(struct gl_context *ctx, GLenum target,
info, source);
free(info);
- _mesa_DeleteObjectARB(shader);
+ _mesa_DeleteShader(shader);
return 0;
}
@@ -241,11 +241,11 @@ _mesa_meta_setup_blit_shader(struct gl_context *ctx,
vs = _mesa_meta_compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source);
fs = _mesa_meta_compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source);
- shader->shader_prog = _mesa_CreateProgramObjectARB();
+ shader->shader_prog = _mesa_CreateProgram();
_mesa_AttachShader(shader->shader_prog, fs);
- _mesa_DeleteObjectARB(fs);
+ _mesa_DeleteShader(fs);
_mesa_AttachShader(shader->shader_prog, vs);
- _mesa_DeleteObjectARB(vs);
+ _mesa_DeleteShader(vs);
_mesa_BindAttribLocation(shader->shader_prog, 0, "position");
_mesa_BindAttribLocation(shader->shader_prog, 1, "texcoords");
_mesa_meta_link_program_with_debug(ctx, shader->shader_prog);
@@ -733,6 +733,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
save->RasterDiscard = ctx->RasterDiscard;
if (ctx->RasterDiscard)
_mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_FALSE);
+
+ save->DrawBufferName = ctx->DrawBuffer->Name;
+ save->ReadBufferName = ctx->ReadBuffer->Name;
+ save->RenderbufferName = (ctx->CurrentRenderbuffer ?
+ ctx->CurrentRenderbuffer->Name : 0);
}
}
@@ -1079,6 +1084,16 @@ _mesa_meta_end(struct gl_context *ctx)
if (save->TransformFeedbackNeedsResume)
_mesa_ResumeTransformFeedback();
+ if (ctx->DrawBuffer->Name != save->DrawBufferName)
+ _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, save->DrawBufferName);
+
+ if (ctx->ReadBuffer->Name != save->ReadBufferName)
+ _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, save->ReadBufferName);
+
+ if (!ctx->CurrentRenderbuffer ||
+ ctx->CurrentRenderbuffer->Name != save->RenderbufferName)
+ _mesa_BindRenderbuffer(GL_RENDERBUFFER, save->RenderbufferName);
+
ctx->Meta->SaveStackDepth--;
ctx->API = save->API;
@@ -1497,27 +1512,27 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
if (clear->ShaderProg != 0)
return;
- vs = _mesa_CreateShaderObjectARB(GL_VERTEX_SHADER);
+ vs = _mesa_CreateShader(GL_VERTEX_SHADER);
_mesa_ShaderSource(vs, 1, &vs_source, NULL);
_mesa_CompileShader(vs);
if (_mesa_has_geometry_shaders(ctx)) {
- gs = _mesa_CreateShaderObjectARB(GL_GEOMETRY_SHADER);
+ gs = _mesa_CreateShader(GL_GEOMETRY_SHADER);
_mesa_ShaderSource(gs, 1, &gs_source, NULL);
_mesa_CompileShader(gs);
}
- fs = _mesa_CreateShaderObjectARB(GL_FRAGMENT_SHADER);
+ fs = _mesa_CreateShader(GL_FRAGMENT_SHADER);
_mesa_ShaderSource(fs, 1, &fs_source, NULL);
_mesa_CompileShader(fs);
- clear->ShaderProg = _mesa_CreateProgramObjectARB();
+ clear->ShaderProg = _mesa_CreateProgram();
_mesa_AttachShader(clear->ShaderProg, fs);
- _mesa_DeleteObjectARB(fs);
+ _mesa_DeleteShader(fs);
if (gs != 0)
_mesa_AttachShader(clear->ShaderProg, gs);
_mesa_AttachShader(clear->ShaderProg, vs);
- _mesa_DeleteObjectARB(vs);
+ _mesa_DeleteShader(vs);
_mesa_BindAttribLocation(clear->ShaderProg, 0, "position");
_mesa_LinkProgram(clear->ShaderProg);
@@ -1558,13 +1573,13 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
fs_int_source);
ralloc_free(shader_source_mem_ctx);
- clear->IntegerShaderProg = _mesa_CreateProgramObjectARB();
+ clear->IntegerShaderProg = _mesa_CreateProgram();
_mesa_AttachShader(clear->IntegerShaderProg, fs);
- _mesa_DeleteObjectARB(fs);
+ _mesa_DeleteShader(fs);
if (gs != 0)
_mesa_AttachShader(clear->IntegerShaderProg, gs);
_mesa_AttachShader(clear->IntegerShaderProg, vs);
- _mesa_DeleteObjectARB(vs);
+ _mesa_DeleteShader(vs);
_mesa_BindAttribLocation(clear->IntegerShaderProg, 0, "position");
/* Note that user-defined out attributes get automatically assigned
@@ -1584,7 +1599,7 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
}
}
if (gs != 0)
- _mesa_DeleteObjectARB(gs);
+ _mesa_DeleteShader(gs);
}
static void
@@ -1596,11 +1611,11 @@ meta_glsl_clear_cleanup(struct clear_state *clear)
clear->VAO = 0;
_mesa_DeleteBuffers(1, &clear->VBO);
clear->VBO = 0;
- _mesa_DeleteObjectARB(clear->ShaderProg);
+ _mesa_DeleteProgram(clear->ShaderProg);
clear->ShaderProg = 0;
if (clear->IntegerShaderProg) {
- _mesa_DeleteObjectARB(clear->IntegerShaderProg);
+ _mesa_DeleteProgram(clear->IntegerShaderProg);
clear->IntegerShaderProg = 0;
}
}
@@ -2582,14 +2597,14 @@ choose_blit_shader(GLenum target, struct blit_shader_table *table)
void
_mesa_meta_blit_shader_table_cleanup(struct blit_shader_table *table)
{
- _mesa_DeleteObjectARB(table->sampler_1d.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_2d.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_3d.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_rect.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_cubemap.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_1d_array.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_2d_array.shader_prog);
- _mesa_DeleteObjectARB(table->sampler_cubemap_array.shader_prog);
+ _mesa_DeleteProgram(table->sampler_1d.shader_prog);
+ _mesa_DeleteProgram(table->sampler_2d.shader_prog);
+ _mesa_DeleteProgram(table->sampler_3d.shader_prog);
+ _mesa_DeleteProgram(table->sampler_rect.shader_prog);
+ _mesa_DeleteProgram(table->sampler_cubemap.shader_prog);
+ _mesa_DeleteProgram(table->sampler_1d_array.shader_prog);
+ _mesa_DeleteProgram(table->sampler_2d_array.shader_prog);
+ _mesa_DeleteProgram(table->sampler_cubemap_array.shader_prog);
table->sampler_1d.shader_prog = 0;
table->sampler_2d.shader_prog = 0;
@@ -2652,7 +2667,6 @@ get_temp_image_type(struct gl_context *ctx, mesa_format format)
}
}
-
/**
* Helper for _mesa_meta_CopyTexSubImage1/2/3D() functions.
* Have to be careful with locking and meta state for pixel transfer.
@@ -2786,8 +2800,6 @@ decompress_texture_image(struct gl_context *ctx,
const GLenum target = texObj->Target;
GLenum faceTarget;
struct vertex verts[4];
- GLuint fboDrawSave, fboReadSave;
- GLuint rbSave;
GLuint samplerSave;
const bool use_glsl_version = ctx->Extensions.ARB_vertex_shader &&
ctx->Extensions.ARB_fragment_shader;
@@ -2821,11 +2833,6 @@ decompress_texture_image(struct gl_context *ctx,
break;
}
- /* save fbo bindings (not saved by _mesa_meta_begin()) */
- fboDrawSave = ctx->DrawBuffer->Name;
- fboReadSave = ctx->ReadBuffer->Name;
- rbSave = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
-
_mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE);
samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
@@ -2974,16 +2981,6 @@ decompress_texture_image(struct gl_context *ctx,
_mesa_BindSampler(ctx->Texture.CurrentUnit, samplerSave);
_mesa_meta_end(ctx);
-
- /* restore fbo bindings */
- if (fboDrawSave == fboReadSave) {
- _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, fboDrawSave);
- }
- else {
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, fboDrawSave);
- _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER_EXT, fboReadSave);
- }
- _mesa_BindRenderbuffer(GL_RENDERBUFFER_EXT, rbSave);
}
diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h
index 6029a775c..e2ccb939e 100644
--- a/mesalib/src/mesa/drivers/common/meta.h
+++ b/mesalib/src/mesa/drivers/common/meta.h
@@ -177,6 +177,8 @@ struct save_state
GLboolean Lighting;
GLboolean RasterDiscard;
GLboolean TransformFeedbackNeedsResume;
+
+ GLuint DrawBufferName, ReadBufferName, RenderbufferName;
};
/**
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c
index 907c2cdf3..31e494fb8 100644
--- a/mesalib/src/mesa/drivers/common/meta_blit.c
+++ b/mesalib/src/mesa/drivers/common/meta_blit.c
@@ -325,11 +325,11 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
vs = _mesa_meta_compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source);
fs = _mesa_meta_compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source);
- blit->msaa_shaders[shader_index] = _mesa_CreateProgramObjectARB();
+ blit->msaa_shaders[shader_index] = _mesa_CreateProgram();
_mesa_AttachShader(blit->msaa_shaders[shader_index], fs);
- _mesa_DeleteObjectARB(fs);
+ _mesa_DeleteShader(fs);
_mesa_AttachShader(blit->msaa_shaders[shader_index], vs);
- _mesa_DeleteObjectARB(vs);
+ _mesa_DeleteShader(vs);
_mesa_BindAttribLocation(blit->msaa_shaders[shader_index], 0, "position");
_mesa_BindAttribLocation(blit->msaa_shaders[shader_index], 1, "texcoords");
_mesa_meta_link_program_with_debug(ctx, blit->msaa_shaders[shader_index]);
diff --git a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
index 3db073ab1..d62819c4c 100644
--- a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -194,7 +194,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
const GLuint maxLevel = texObj->MaxLevel;
const GLint maxLevelSave = texObj->MaxLevel;
const GLboolean genMipmapSave = texObj->GenerateMipmap;
- const GLuint fboSave = ctx->DrawBuffer->Name;
const GLuint currentTexUnitSave = ctx->Texture.CurrentUnit;
const GLboolean use_glsl_version = ctx->Extensions.ARB_vertex_shader &&
ctx->Extensions.ARB_fragment_shader;
@@ -378,6 +377,4 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave);
if (genMipmapSave)
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave);
-
- _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, fboSave);
}
diff --git a/mesalib/src/mesa/drivers/dri/Makefile.am b/mesalib/src/mesa/drivers/dri/Makefile.am
index a85a5aa91..17ac76be1 100644
--- a/mesalib/src/mesa/drivers/dri/Makefile.am
+++ b/mesalib/src/mesa/drivers/dri/Makefile.am
@@ -9,37 +9,37 @@ SUBDIRS+=common
if HAVE_I915_DRI
SUBDIRS += i915
MEGADRIVERS_DEPS += i915/libi915_dri.la
-MEGADRIVERS += i915_dri.so
+MEGADRIVERS += i915_dri.@LIB_EXT@
endif
if HAVE_I965_DRI
SUBDIRS += i965
MEGADRIVERS_DEPS += i965/libi965_dri.la
-MEGADRIVERS += i965_dri.so
+MEGADRIVERS += i965_dri.@LIB_EXT@
endif
if HAVE_NOUVEAU_DRI
SUBDIRS += nouveau
MEGADRIVERS_DEPS += nouveau/libnouveau_dri.la
-MEGADRIVERS += nouveau_vieux_dri.so
+MEGADRIVERS += nouveau_vieux_dri.@LIB_EXT@
endif
if HAVE_R200_DRI
SUBDIRS += r200
MEGADRIVERS_DEPS += r200/libr200_dri.la
-MEGADRIVERS += r200_dri.so
+MEGADRIVERS += r200_dri.@LIB_EXT@
endif
if HAVE_RADEON_DRI
SUBDIRS += radeon
MEGADRIVERS_DEPS += radeon/libradeon_dri.la
-MEGADRIVERS += radeon_dri.so
+MEGADRIVERS += radeon_dri.@LIB_EXT@
endif
if HAVE_SWRAST_DRI
SUBDIRS += swrast
MEGADRIVERS_DEPS += swrast/libswrast_dri.la
-MEGADRIVERS += swrast_dri.so
+MEGADRIVERS += swrast_dri.@LIB_EXT@
endif
pkgconfigdir = $(libdir)/pkgconfig
@@ -65,24 +65,26 @@ mesa_dri_drivers_la_LIBADD = \
if NEED_MEGADRIVER
dri_LTLIBRARIES = mesa_dri_drivers.la
+if HAVE_COMPAT_SYMLINKS
# Add a link to allow setting LD_LIBRARY_PATH/LIBGL_DRIVERS_PATH to /lib of the build tree.
all-local: mesa_dri_drivers.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- $(AM_V_GEN)ln -f .libs/mesa_dri_drivers.so \
- $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so;
+ $(AM_V_at)$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+ $(AM_V_GEN)ln -f .libs/mesa_dri_drivers.@LIB_EXT@ \
+ $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.@LIB_EXT@;
$(AM_V_GEN)for i in $(MEGADRIVERS); do \
- ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so \
+ ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.@LIB_EXT@ \
$(top_builddir)/$(LIB_DIR)/$$i; \
done;
+endif
# hardlink each megadriver instance, but don't actually have
-# mesa_dri_drivers.so in the set of final installed files.
+# mesa_dri_drivers.@LIB_EXT@ in the set of final installed files.
install-data-hook:
for i in $(MEGADRIVERS); do \
- ln -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so \
+ ln -f $(DESTDIR)$(dridir)/mesa_dri_drivers.@LIB_EXT@ \
$(DESTDIR)$(dridir)/$$i; \
done;
- $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so
+ $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.@LIB_EXT@
$(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.la
endif
diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am b/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am
index 0908c8264..57e604845 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am
+++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am
@@ -69,7 +69,7 @@ options.h: t_options.h $(MOS)
@mo="$@"; \
lang=$${mo%%/*}; \
echo "Updating ($$lang) $@ from $?."; \
- mkdir -p $$lang/LC_MESSAGES; \
+ $(MKDIR_P) $$lang/LC_MESSAGES; \
msgfmt -o $@ $?
# Use this target to create or update .po files with new messages in