aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-07 08:23:46 +0200
committermarha <marha@users.sourceforge.net>2013-10-07 08:23:46 +0200
commit81fd17c8678e89cea6610b8b2996b028b21eb5dc (patch)
treed2c201976b3cd000658870071ab7b533359de039 /mesalib/src/gallium/auxiliary
parent5593a3d2f370e3e12a043110bf2e395c938980d6 (diff)
downloadvcxsrv-81fd17c8678e89cea6610b8b2996b028b21eb5dc.tar.gz
vcxsrv-81fd17c8678e89cea6610b8b2996b028b21eb5dc.tar.bz2
vcxsrv-81fd17c8678e89cea6610b8b2996b028b21eb5dc.zip
xserver fontconfig libXdmcp mesa pixmand xkeyboard-config git update 7 oct 2013
xserver commit ccbe17b1c6da1ad9d085fc8133cdd15dc7004a4a xkeyboard-config commit c8326b7d12b20eccfd38d661b95d9b23d8a56e27 libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854 pixman commit c89f4c826695dbb5df0817d84f845dbd3e28b7a7 fontconfig commit 604c2a683f1357fc65bad372b5d25a90099f827f mesa commit cfbfb50cb8d47b7f6975828b504936f9324f3b12
Diffstat (limited to 'mesalib/src/gallium/auxiliary')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c15
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_math.h52
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_pack_color.h8
3 files changed, 65 insertions, 10 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index be839d439..a51b9ef20 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -528,9 +528,10 @@ static void blitter_restore_textures(struct blitter_context_priv *ctx)
unsigned i;
/* Fragment sampler states. */
- pipe->bind_fragment_sampler_states(pipe,
- ctx->base.saved_num_sampler_states,
- ctx->base.saved_sampler_states);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
+ ctx->base.saved_num_sampler_states,
+ ctx->base.saved_sampler_states);
+
ctx->base.saved_num_sampler_states = ~0;
/* Fragment sampler views. */
@@ -1309,7 +1310,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
views[1] = pipe->create_sampler_view(pipe, src->texture, &templ);
pipe->set_fragment_sampler_views(pipe, 2, views);
- pipe->bind_fragment_sampler_states(pipe, 2, samplers);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 2, samplers);
pipe_sampler_view_reference(&views[1], NULL);
} else if (blit_stencil) {
@@ -1324,12 +1325,14 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
view = pipe->create_sampler_view(pipe, src->texture, &templ);
pipe->set_fragment_sampler_views(pipe, 1, &view);
- pipe->bind_fragment_sampler_states(pipe, 1, &sampler_state);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
+ 0, 1, &sampler_state);
pipe_sampler_view_reference(&view, NULL);
} else {
pipe->set_fragment_sampler_views(pipe, 1, &src);
- pipe->bind_fragment_sampler_states(pipe, 1, &sampler_state);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT,
+ 0, 1, &sampler_state);
}
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h
index 702d4e9d4..478a4aa4d 100644
--- a/mesalib/src/gallium/auxiliary/util/u_math.h
+++ b/mesalib/src/gallium/auxiliary/util/u_math.h
@@ -162,7 +162,59 @@ float log2f(float f)
#endif
+#if __STDC_VERSION__ < 199901L && !defined(__cplusplus)
+static INLINE long int
+lrint(double d)
+{
+ long int rounded = (long int)(d + 0.5);
+
+ if (d - floor(d) == 0.5) {
+ if (rounded % 2 != 0)
+ rounded += (d > 0) ? -1 : 1;
+ }
+
+ return rounded;
+}
+
+static INLINE long int
+lrintf(float f)
+{
+ long int rounded = (long int)(f + 0.5f);
+
+ if (f - floorf(f) == 0.5f) {
+ if (rounded % 2 != 0)
+ rounded += (f > 0) ? -1 : 1;
+ }
+
+ return rounded;
+}
+static INLINE long long int
+llrint(double d)
+{
+ long long int rounded = (long long int)(d + 0.5);
+
+ if (d - floor(d) == 0.5) {
+ if (rounded % 2 != 0)
+ rounded += (d > 0) ? -1 : 1;
+ }
+
+ return rounded;
+}
+
+static INLINE long long int
+llrintf(float f)
+{
+ long long int rounded = (long long int)(f + 0.5f);
+
+ if (f - floorf(f) == 0.5f) {
+ if (rounded % 2 != 0)
+ rounded += (f > 0) ? -1 : 1;
+ }
+
+ return rounded;
+}
+#endif /* C99 */
#define POW2_TABLE_SIZE_LOG2 9
#define POW2_TABLE_SIZE (1 << POW2_TABLE_SIZE_LOG2)
diff --git a/mesalib/src/gallium/auxiliary/util/u_pack_color.h b/mesalib/src/gallium/auxiliary/util/u_pack_color.h
index 102ad6051..36252738d 100644
--- a/mesalib/src/gallium/auxiliary/util/u_pack_color.h
+++ b/mesalib/src/gallium/auxiliary/util/u_pack_color.h
@@ -528,12 +528,12 @@ util_pack_z(enum pipe_format format, double z)
case PIPE_FORMAT_Z16_UNORM:
if (z == 1.0)
return 0xffff;
- return (uint32_t) (z * 0xffff);
+ return (uint32_t) lrint(z * 0xffff);
case PIPE_FORMAT_Z32_UNORM:
/* special-case to avoid overflow */
if (z == 1.0)
return 0xffffffff;
- return (uint32_t) (z * 0xffffffff);
+ return (uint32_t) llrint(z * 0xffffffff);
case PIPE_FORMAT_Z32_FLOAT:
fui.f = (float)z;
return fui.ui;
@@ -541,12 +541,12 @@ util_pack_z(enum pipe_format format, double z)
case PIPE_FORMAT_Z24X8_UNORM:
if (z == 1.0)
return 0xffffff;
- return (uint32_t) (z * 0xffffff);
+ return (uint32_t) lrint(z * 0xffffff);
case PIPE_FORMAT_S8_UINT_Z24_UNORM:
case PIPE_FORMAT_X8Z24_UNORM:
if (z == 1.0)
return 0xffffff00;
- return ((uint32_t) (z * 0xffffff)) << 8;
+ return ((uint32_t) lrint(z * 0xffffff)) << 8;
case PIPE_FORMAT_S8_UINT:
/* this case can get it via util_pack_z_stencil() */
return 0;