aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-27 10:45:05 +0100
committermarha <marha@users.sourceforge.net>2013-02-27 10:45:05 +0100
commitc74ef795c7282681616decc36a9a81cd1b1b6ec7 (patch)
treebeb5f13ba78bd7920eae918b6aa5db5bac83f0da /mesalib/src/gallium
parentf51268259621a21d14e40b8a41c5803a5c2ce706 (diff)
downloadvcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.gz
vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.bz2
vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.zip
libX11 mesa pixman xkeyboard-config
xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9 libX11 commit b687440c28c7da6ee0ae44514d20248db5161606 pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1 mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71
Diffstat (limited to 'mesalib/src/gallium')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c26
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug_stack.c5
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_dump_defines.c31
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_inlines.h16
4 files changed, 67 insertions, 11 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index 95224020c..e37be4e0a 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -103,7 +103,10 @@ struct blitter_context_priv
void *velem_state_readbuf;
/* Sampler state. */
- void *sampler_state, *sampler_state_linear;
+ void *sampler_state;
+ void *sampler_state_linear;
+ void *sampler_state_rect;
+ void *sampler_state_rect_linear;
/* Rasterizer state. */
void *rs_state, *rs_state_scissor, *rs_discard_state;
@@ -223,10 +226,15 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler_state.normalized_coords = 1;
ctx->sampler_state = pipe->create_sampler_state(pipe, &sampler_state);
+ sampler_state.normalized_coords = 0;
+ ctx->sampler_state_rect = pipe->create_sampler_state(pipe, &sampler_state);
sampler_state.min_img_filter = PIPE_TEX_FILTER_LINEAR;
sampler_state.mag_img_filter = PIPE_TEX_FILTER_LINEAR;
+ sampler_state.normalized_coords = 1;
ctx->sampler_state_linear = pipe->create_sampler_state(pipe, &sampler_state);
+ sampler_state.normalized_coords = 0;
+ ctx->sampler_state_rect_linear = pipe->create_sampler_state(pipe, &sampler_state);
/* rasterizer state */
memset(&rs_state, 0, sizeof(rs_state));
@@ -365,8 +373,10 @@ void util_blitter_destroy(struct blitter_context *blitter)
ctx->delete_fs_state(pipe, ctx->fs_col_int[i]);
}
- pipe->delete_sampler_state(pipe, ctx->sampler_state);
+ pipe->delete_sampler_state(pipe, ctx->sampler_state_rect_linear);
+ pipe->delete_sampler_state(pipe, ctx->sampler_state_rect);
pipe->delete_sampler_state(pipe, ctx->sampler_state_linear);
+ pipe->delete_sampler_state(pipe, ctx->sampler_state);
u_upload_destroy(ctx->upload);
FREE(ctx);
}
@@ -1317,9 +1327,17 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
src_samples <= 1 &&
(dstbox->width != abs(srcbox->width) ||
dstbox->height != abs(srcbox->height))) {
- sampler_state = ctx->sampler_state_linear;
+ if (src_target == PIPE_TEXTURE_RECT) {
+ sampler_state = ctx->sampler_state_rect_linear;
+ } else {
+ sampler_state = ctx->sampler_state_linear;
+ }
} else {
- sampler_state = ctx->sampler_state;
+ if (src_target == PIPE_TEXTURE_RECT) {
+ sampler_state = ctx->sampler_state_rect;
+ } else {
+ sampler_state = ctx->sampler_state;
+ }
}
/* Set samplers. */
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug_stack.c b/mesalib/src/gallium/auxiliary/util/u_debug_stack.c
index 558b911f2..50a248a97 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug_stack.c
+++ b/mesalib/src/gallium/auxiliary/util/u_debug_stack.c
@@ -48,10 +48,7 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace,
if(!nr_frames)
return;
-#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
- __asm__ __volatile__("mov (%%ebp),%0": "=r" (frame_pointer));
- frame_pointer = (const void **)frame_pointer[0];
-#elif defined(PIPE_CC_GCC)
+#if defined(PIPE_CC_GCC)
frame_pointer = ((const void **)__builtin_frame_address(1));
#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
__asm {
diff --git a/mesalib/src/gallium/auxiliary/util/u_dump_defines.c b/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
index 692d4447c..cc6268773 100644
--- a/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
+++ b/mesalib/src/gallium/auxiliary/util/u_dump_defines.c
@@ -73,6 +73,23 @@ util_dump_enum_continuous(unsigned value,
}
+/**
+ * Same as DEFINE_UTIL_DUMP_CONTINUOUS but with static assertions to detect
+ * failures to update lists.
+ */
+#define DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(_name, _count) \
+ const char * \
+ util_dump_##_name(unsigned value, boolean shortened) \
+ { \
+ STATIC_ASSERT(Elements(util_dump_##_name##_names) == _count); \
+ STATIC_ASSERT(Elements(util_dump_##_name##_short_names) == _count); \
+ if(shortened) \
+ return util_dump_enum_continuous(value, Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
+ else \
+ return util_dump_enum_continuous(value, Elements(util_dump_##_name##_names), util_dump_##_name##_names); \
+ }
+
+
static const char *
util_dump_blend_factor_names[] = {
UTIL_DUMP_INVALID_NAME, /* 0x0 */
@@ -262,7 +279,11 @@ util_dump_tex_target_names[] = {
"PIPE_TEXTURE_1D",
"PIPE_TEXTURE_2D",
"PIPE_TEXTURE_3D",
- "PIPE_TEXTURE_CUBE"
+ "PIPE_TEXTURE_CUBE",
+ "PIPE_TEXTURE_RECT",
+ "PIPE_TEXTURE_1D_ARRAY",
+ "PIPE_TEXTURE_2D_ARRAY",
+ "PIPE_TEXTURE_CUBE_ARRAY",
};
static const char *
@@ -271,10 +292,14 @@ util_dump_tex_target_short_names[] = {
"1d",
"2d",
"3d",
- "cube"
+ "cube",
+ "rect",
+ "1d_array",
+ "2d_array",
+ "cube_array",
};
-DEFINE_UTIL_DUMP_CONTINUOUS(tex_target)
+DEFINE_UTIL_DUMP_CONTINUOUS_COUNT(tex_target, PIPE_MAX_TEXTURE_TYPES)
static const char *
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h
index 2ff90c982..ba745ebb5 100644
--- a/mesalib/src/gallium/auxiliary/util/u_inlines.h
+++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h
@@ -582,6 +582,22 @@ util_copy_constant_buffer(struct pipe_constant_buffer *dst,
}
}
+static INLINE unsigned
+util_max_layer(struct pipe_resource *r, unsigned level)
+{
+ switch (r->target) {
+ case PIPE_TEXTURE_CUBE:
+ return 6 - 1;
+ case PIPE_TEXTURE_3D:
+ return u_minify(r->depth0, level) - 1;
+ case PIPE_TEXTURE_1D_ARRAY:
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_CUBE_ARRAY:
+ return r->array_size - 1;
+ default:
+ return 0;
+ }
+}
#ifdef __cplusplus
}