aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c27
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.h16
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format_r11g11b10f.h2
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_upload_mgr.c2
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf.c2
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wmesa.c474
-rw-r--r--mesalib/src/mesa/main/api_exec.c34
-rw-r--r--mesalib/src/mesa/main/enums.h12
-rw-r--r--mesalib/src/mesa/main/mfeatures.h4
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_msaa.c3
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c8
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c3
12 files changed, 36 insertions, 551 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index 1072a0e9a..4d6cdd7a2 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -606,10 +606,10 @@ static void get_texcoords(struct pipe_sampler_view *src,
out[2] = x2 / (float)u_minify(src_width0, level);
out[3] = y2 / (float)u_minify(src_height0, level);
} else {
- out[0] = x1;
- out[1] = y1;
- out[2] = x2;
- out[3] = y2;
+ out[0] = (float) x1;
+ out[1] = (float) y1;
+ out[2] = (float) x2;
+ out[3] = (float) y2;
}
}
@@ -664,19 +664,19 @@ static void blitter_set_texcoords(struct blitter_context_priv *ctx,
case PIPE_TEXTURE_1D_ARRAY:
for (i = 0; i < 4; i++)
- ctx->vertices[i][1][1] = layer; /*t*/
+ ctx->vertices[i][1][1] = (float) layer; /*t*/
break;
case PIPE_TEXTURE_2D_ARRAY:
for (i = 0; i < 4; i++) {
- ctx->vertices[i][1][2] = layer; /*r*/
- ctx->vertices[i][1][3] = sample; /*q*/
+ ctx->vertices[i][1][2] = (float) layer; /*r*/
+ ctx->vertices[i][1][3] = (float) sample; /*q*/
}
break;
case PIPE_TEXTURE_2D:
for (i = 0; i < 4; i++) {
- ctx->vertices[i][1][2] = sample; /*r*/
+ ctx->vertices[i][1][2] = (float) sample; /*r*/
}
break;
@@ -1010,7 +1010,7 @@ static void util_blitter_clear_custom(struct blitter_context *blitter,
blitter_set_common_draw_rect_state(ctx, FALSE);
blitter_set_dst_dimensions(ctx, width, height);
- blitter->draw_rectangle(blitter, 0, 0, width, height, depth,
+ blitter->draw_rectangle(blitter, 0, 0, width, height, (float) depth,
UTIL_BLITTER_ATTRIB_COLOR, color);
blitter_restore_vertex_states(ctx);
@@ -1569,7 +1569,8 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
blitter_set_common_draw_rect_state(ctx, FALSE);
blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
- blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height, depth,
+ blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height,
+ (float) depth,
UTIL_BLITTER_ATTRIB_NONE, NULL);
blitter_restore_vertex_states(ctx);
@@ -1881,11 +1882,11 @@ static boolean is_box_inside_resource(const struct pipe_resource *res,
}
return box->x >= 0 &&
- box->x + box->width <= width &&
+ box->x + box->width <= (int) width &&
box->y >= 0 &&
- box->y + box->height <= height &&
+ box->y + box->height <= (int) height &&
box->z >= 0 &&
- box->z + box->depth <= depth;
+ box->z + box->depth <= (int) depth;
}
static unsigned get_sample_count(const struct pipe_resource *res)
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.h b/mesalib/src/gallium/auxiliary/util/u_blitter.h
index 4f7146701..de0639377 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.h
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.h
@@ -98,16 +98,16 @@ struct blitter_context
boolean is_sample_mask_saved;
unsigned saved_sample_mask;
- int saved_num_sampler_states;
+ unsigned saved_num_sampler_states;
void *saved_sampler_states[PIPE_MAX_SAMPLERS];
- int saved_num_sampler_views;
+ unsigned saved_num_sampler_views;
struct pipe_sampler_view *saved_sampler_views[PIPE_MAX_SAMPLERS];
- int saved_num_vertex_buffers;
+ unsigned saved_num_vertex_buffers;
struct pipe_vertex_buffer saved_vertex_buffers[PIPE_MAX_ATTRIBS];
- int saved_num_so_targets;
+ unsigned saved_num_so_targets;
struct pipe_stream_output_target *saved_so_targets[PIPE_MAX_SO_BUFFERS];
struct pipe_query *saved_render_cond_query;
@@ -435,7 +435,7 @@ void util_blitter_save_scissor(struct blitter_context *blitter,
static INLINE
void util_blitter_save_fragment_sampler_states(
struct blitter_context *blitter,
- int num_sampler_states,
+ unsigned num_sampler_states,
void **sampler_states)
{
assert(num_sampler_states <= Elements(blitter->saved_sampler_states));
@@ -447,7 +447,7 @@ void util_blitter_save_fragment_sampler_states(
static INLINE void
util_blitter_save_fragment_sampler_views(struct blitter_context *blitter,
- int num_views,
+ unsigned num_views,
struct pipe_sampler_view **views)
{
unsigned i;
@@ -461,7 +461,7 @@ util_blitter_save_fragment_sampler_views(struct blitter_context *blitter,
static INLINE void
util_blitter_save_vertex_buffers(struct blitter_context *blitter,
- int num_vertex_buffers,
+ unsigned num_vertex_buffers,
struct pipe_vertex_buffer *vertex_buffers)
{
assert(num_vertex_buffers <= Elements(blitter->saved_vertex_buffers));
@@ -475,7 +475,7 @@ util_blitter_save_vertex_buffers(struct blitter_context *blitter,
static INLINE void
util_blitter_save_so_targets(struct blitter_context *blitter,
- int num_targets,
+ unsigned num_targets,
struct pipe_stream_output_target **targets)
{
unsigned i;
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_r11g11b10f.h b/mesalib/src/gallium/auxiliary/util/u_format_r11g11b10f.h
index bd64b2896..b883b318e 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_r11g11b10f.h
+++ b/mesalib/src/gallium/auxiliary/util/u_format_r11g11b10f.h
@@ -205,7 +205,7 @@ static INLINE float uf10_to_f32(uint16_t val)
float scale, decimal;
exponent -= 15;
if (exponent < 0) {
- scale = 1.0 / (1 << -exponent);
+ scale = 1.0f / (1 << -exponent);
}
else {
scale = (float) (1 << exponent);
diff --git a/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c b/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
index b62973de6..ee1c6881e 100644
--- a/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -76,7 +76,7 @@ void u_upload_unmap( struct u_upload_mgr *upload )
{
if (upload->transfer) {
struct pipe_box *box = &upload->transfer->box;
- if (upload->offset > box->x) {
+ if ((int) upload->offset > box->x) {
pipe_buffer_flush_mapped_range(upload->pipe, upload->transfer,
box->x, upload->offset - box->x);
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf.c b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
index 52db294cb..1cc83c3dd 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf.c
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
@@ -98,7 +98,7 @@ struct u_vbuf {
/* Vertex buffers for the driver.
* There are no user buffers. */
struct pipe_vertex_buffer real_vertex_buffer[PIPE_MAX_ATTRIBS];
- int nr_real_vertex_buffers;
+ unsigned nr_real_vertex_buffers;
boolean vertex_buffers_dirty;
/* The index buffer. */
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
index 1580e5727..5728d3aa4 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
@@ -417,480 +417,6 @@ static void clear(struct gl_context *ctx, GLbitfield mask)
}
-/**********************************************************************/
-/***** PIXEL Functions *****/
-/**********************************************************************/
-
-#define FLIP(Y) (rb->Height - (Y) - 1)
-
-
-/**
- ** Front Buffer reading/writing
- ** These are slow, but work with all non-indexed visual types.
- **/
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(pwc->hDC);
- HBITMAP bmp=0;
- HDC mdc=0;
- typedef union
- {
- unsigned i;
- struct {
- unsigned b:8, g:8, r:8, a:8;
- };
- } BGRA;
- BGRA *bgra, c;
- GLuint i;
-
- if (n < 16) { // the value 16 is just guessed
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x+i, y,
- RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- SetPixel(pwc->hDC, x+i, y,
- RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
- }
- }
- else {
- if (!pwfb) {
- _mesa_problem(NULL, "wmesa: write_rgba_span_front on unknown hdc");
- return;
- }
- bgra=malloc(n*sizeof(BGRA));
- if (!bgra) {
- _mesa_problem(NULL, "wmesa: write_rgba_span_front: out of memory");
- return;
- }
- c.a=0;
- if (mask) {
- for (i=0; i<n; i++) {
- if (mask[i]) {
- c.r=rgba[i][RCOMP];
- c.g=rgba[i][GCOMP];
- c.b=rgba[i][BCOMP];
- c.a=rgba[i][ACOMP];
- bgra[i]=c;
- }
- else
- bgra[i].i=0;
- }
- }
- else {
- for (i=0; i<n; i++) {
- c.r=rgba[i][RCOMP];
- c.g=rgba[i][GCOMP];
- c.b=rgba[i][BCOMP];
- c.a=rgba[i][ACOMP];
- bgra[i]=c;
- }
- }
- bmp=CreateBitmap(n, 1, 1, 32, bgra);
- mdc=CreateCompatibleDC(pwfb->hDC);
- SelectObject(mdc, bmp);
- y=FLIP(y);
- BitBlt(pwfb->hDC, x, y, n, 1, mdc, 0, 0, SRCCOPY);
- SelectObject(mdc, 0);
- DeleteObject(bmp);
- DeleteDC(mdc);
- free(bgra);
- }
-}
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaContext pwc = wmesa_context(ctx);
- (void) ctx;
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x[i], FLIP(y[i]),
- RGB(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]));
-}
-
-
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- GLuint i;
- COLORREF Color;
- y = FLIP(y);
- for (i=0; i<n; i++) {
- Color = GetPixel(pwc->hDC, x+i, y);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- GLuint i;
- COLORREF Color;
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- Color = GetPixel(pwc->hDC, x[i], y2);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
-}
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 32-bit */
-
-#define WMSETPIXEL32(pwc, y, x, r, g, b) { \
-LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
-*lpdw = BGR32((r),(g),(b)); }
-
-
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPDWORD lpdw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpdw[i] = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpdw++ = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
-}
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL32(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- DWORD pixel;
- LPDWORD lpdw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- for (i=0; i<n; i++) {
- pixel = lpdw[i];
- rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
- rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
- rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- DWORD pixel;
- LPDWORD lpdw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
- pixel = *lpdw;
- rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
- rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
- rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 24-bit */
-
-#define WMSETPIXEL24(pwc, y, x, r, g, b) { \
-LPBYTE lpb = ((LPBYTE)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (3 * x)); \
-lpb[0] = (b); \
-lpb[1] = (g); \
-lpb[2] = (r); }
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPBYTE lpb;
-
- (void) ctx;
-
- y=FLIP(y);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i]) {
- lpb[3*i] = rgba[i][BCOMP];
- lpb[3*i+1] = rgba[i][GCOMP];
- lpb[3*i+2] = rgba[i][RCOMP];
- }
- }
- else {
- for (i=0; i<n; i++) {
- *lpb++ = rgba[i][BCOMP];
- *lpb++ = rgba[i][GCOMP];
- *lpb++ = rgba[i][RCOMP];
- }
- }
-}
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL24(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- LPBYTE lpb;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- for (i=0; i<n; i++) {
- rgba[i][RCOMP] = lpb[3*i+2];
- rgba[i][GCOMP] = lpb[3*i+1];
- rgba[i][BCOMP] = lpb[3*i];
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- LPBYTE lpb;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]);
- rgba[i][RCOMP] = lpb[3*i+2];
- rgba[i][GCOMP] = lpb[3*i+1];
- rgba[i][BCOMP] = lpb[3*i];
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 16-bit */
-
-#define WMSETPIXEL16(pwc, y, x, r, g, b) { \
-LPWORD lpw = ((LPWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
-*lpw = BGR16((r),(g),(b)); }
-
-
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPWORD lpw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpw[i] = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpw++ = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
-}
-
-
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- (void) ctx;
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL16(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i, pixel;
- LPWORD lpw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- for (i=0; i<n; i++) {
- pixel = lpw[i];
- /* Windows uses 5,5,5 for 16-bit */
- rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
- rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
- rgba[i][BCOMP] = (pixel & 0x001f) << 3;
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i, pixel;
- LPWORD lpw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
- pixel = *lpw;
- /* Windows uses 5,5,5 for 16-bit */
- rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
- rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
- rgba[i][BCOMP] = (pixel & 0x001f) << 3;
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-
/**********************************************************************/
/***** BUFFER Functions *****/
diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c
index a5e5f26d2..d2f14ce1a 100644
--- a/mesalib/src/mesa/main/api_exec.c
+++ b/mesalib/src/mesa/main/api_exec.c
@@ -112,9 +112,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (exec == NULL)
return NULL;
-#if _HAVE_FULL_GL
_mesa_loopback_init_api_table(ctx, exec);
-#endif
/* load the dispatch slots we understand */
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
@@ -306,7 +304,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_BindTexture(exec, _mesa_BindTexture);
SET_DeleteTextures(exec, _mesa_DeleteTextures);
SET_GenTextures(exec, _mesa_GenTextures);
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_AreTexturesResident(exec, _mesa_AreTexturesResident);
SET_ColorPointer(exec, _mesa_ColorPointer);
@@ -336,14 +333,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_TexCoordPointer(exec, _mesa_TexCoordPointer);
SET_VertexPointer(exec, _mesa_VertexPointer);
}
-#endif
/* 1.2 */
-#if _HAVE_FULL_GL
SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D);
SET_TexImage3D(exec, _mesa_TexImage3D);
SET_TexSubImage3D(exec, _mesa_TexSubImage3D);
-#endif
/* OpenGL 1.2 GL_ARB_imaging */
SET_BlendColor(exec, _mesa_BlendColor);
@@ -370,11 +364,9 @@ _mesa_create_exec_table(struct gl_context *ctx)
#endif
/* 3. GL_EXT_polygon_offset */
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT);
}
-#endif
/* 6. GL_EXT_texture3d */
#if 0
@@ -407,7 +399,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
#endif
/* 30. GL_EXT_vertex_array */
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT);
SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT);
@@ -416,7 +407,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT);
SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT);
}
-#endif
/* 37. GL_EXT_blend_minmax */
#if 0
@@ -424,52 +414,40 @@ _mesa_create_exec_table(struct gl_context *ctx)
#endif
/* 54. GL_EXT_point_parameters */
-#if _HAVE_FULL_GL
if (ctx->API != API_OPENGLES2) {
SET_PointParameterfEXT(exec, _mesa_PointParameterf);
SET_PointParameterfvEXT(exec, _mesa_PointParameterfv);
}
-#endif
/* 95. GL_ARB_ES2_compatibility */
SET_ClearDepthf(exec, _mesa_ClearDepthf);
SET_DepthRangef(exec, _mesa_DepthRangef);
/* 97. GL_EXT_compiled_vertex_array */
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_LockArraysEXT(exec, _mesa_LockArraysEXT);
SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT);
}
-#endif
/* 148. GL_EXT_multi_draw_arrays */
-#if _HAVE_FULL_GL
SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT);
-#endif
/* 173. GL_INGR_blend_func_separate */
-#if _HAVE_FULL_GL
SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT);
-#endif
/* 196. GL_MESA_resize_buffers */
-#if _HAVE_FULL_GL
if (_mesa_is_desktop_gl(ctx)) {
SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA);
}
-#endif
/* 197. GL_MESA_window_pos */
/* part of _mesa_init_rastpos_dispatch(exec); */
/* 200. GL_IBM_multimode_draw_arrays */
-#if _HAVE_FULL_GL
if (ctx->API != API_OPENGLES2) {
SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM);
SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM);
}
-#endif
/* 233. GL_NV_vertex_program */
if (ctx->API == API_OPENGL) {
@@ -490,19 +468,15 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
/* 262. GL_NV_point_sprite */
-#if _HAVE_FULL_GL
if (_mesa_is_desktop_gl(ctx)) {
SET_PointParameteriNV(exec, _mesa_PointParameteri);
SET_PointParameterivNV(exec, _mesa_PointParameteriv);
}
-#endif
/* 268. GL_EXT_stencil_two_side */
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT);
}
-#endif
/* 285. GL_NV_primitive_restart */
if (ctx->API != API_OPENGLES2) {
@@ -526,30 +500,23 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* ARB 1. GL_ARB_multitexture */
-#if _HAVE_FULL_GL
SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB);
}
-#endif
/* ARB 3. GL_ARB_transpose_matrix */
-#if _HAVE_FULL_GL
if (ctx->API == API_OPENGL) {
SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB);
SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB);
SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB);
SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB);
}
-#endif
/* ARB 5. GL_ARB_multisample */
-#if _HAVE_FULL_GL
SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB);
-#endif
/* ARB 12. GL_ARB_texture_compression */
-#if _HAVE_FULL_GL
if (ctx->API != API_OPENGLES2) {
SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB);
SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB);
@@ -565,7 +532,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (ctx->API != API_OPENGLES2) {
SET_GetnCompressedTexImageARB(exec, _mesa_GetnCompressedTexImageARB);
}
-#endif
/* ARB 14. GL_ARB_point_parameters */
/* reuse EXT_point_parameters functions */
diff --git a/mesalib/src/mesa/main/enums.h b/mesalib/src/mesa/main/enums.h
index 7733df22f..8f4069426 100644
--- a/mesalib/src/mesa/main/enums.h
+++ b/mesalib/src/mesa/main/enums.h
@@ -38,8 +38,6 @@
#include "mfeatures.h"
-#if defined(_HAVE_FULL_GL) && _HAVE_FULL_GL
-
extern const char *_mesa_lookup_enum_by_nr( int nr );
/* Get the name of an enum given that it is a primitive type. Avoids
@@ -49,14 +47,4 @@ const char *_mesa_lookup_prim_by_nr( unsigned nr );
extern int _mesa_lookup_enum_by_name( const char *symbol );
-#else
-
-/** No-op */
-#define _mesa_lookup_enum_by_name( s ) 0
-
-/** No-op */
-#define _mesa_lookup_enum_by_nr( n ) "unknown"
-
-#endif
-
#endif
diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h
index 829c0563b..55e9cf9c4 100644
--- a/mesalib/src/mesa/main/mfeatures.h
+++ b/mesalib/src/mesa/main/mfeatures.h
@@ -31,10 +31,6 @@
#ifndef FEATURES_H
#define FEATURES_H
-#ifndef _HAVE_FULL_GL
-#define _HAVE_FULL_GL 1
-#endif
-
#ifndef FEATURE_ES1
#define FEATURE_ES1 0
#endif
diff --git a/mesalib/src/mesa/state_tracker/st_atom_msaa.c b/mesalib/src/mesa/state_tracker/st_atom_msaa.c
index ea9eb9a6d..9baa4fcf2 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_msaa.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_msaa.c
@@ -51,7 +51,8 @@ static void update_sample_mask( struct st_context *st )
/* unlike in gallium/d3d10 the mask is only active if msaa is enabled */
if (st->ctx->Multisample.SampleCoverage) {
unsigned nr_bits;
- nr_bits = st->ctx->Multisample.SampleCoverageValue * (float)sample_count;
+ nr_bits = (unsigned)
+ (st->ctx->Multisample.SampleCoverageValue * (float)sample_count);
/* there's lot of ways how to do this. We just use first few bits,
since we have no knowledge of sample positions here. When
app-supplied mask though is used too might need to be smarter.
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 5bf3dc699..b19dc67bf 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -375,6 +375,8 @@ guess_and_alloc_texture(struct st_context *st,
*/
if ((stObj->base.Sampler.MinFilter == GL_NEAREST ||
stObj->base.Sampler.MinFilter == GL_LINEAR ||
+ (stObj->base.BaseLevel == 0 &&
+ stObj->base.MaxLevel == 0) ||
stImage->base._BaseFormat == GL_DEPTH_COMPONENT ||
stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) &&
!stObj->base.GenerateMipmap &&
@@ -1111,11 +1113,15 @@ copy_image_data_to_texture(struct st_context *st,
/* Copy potentially with the blitter:
*/
GLuint src_level;
- if (stImage->pt != stObj->pt)
+ if (stImage->pt->last_level == 0)
src_level = 0;
else
src_level = stImage->base.Level;
+ assert(src_level <= stImage->pt->last_level);
+ assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width);
+ assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
+
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
stImage->pt, src_level, /* src texture, level */
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index 08a41c3e2..0560f3a8a 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -298,7 +298,8 @@ static void init_format_extensions(struct st_context *st,
{
struct pipe_screen *screen = st->pipe->screen;
GLboolean *extensions = (GLboolean *) &st->ctx->Extensions;
- int i, j;
+ unsigned i;
+ int j;
int num_formats = Elements(mapping->format);
int num_ext = Elements(mapping->extension_offset);