From: Roland Scheidegger Date: Fri, 21 May 2010 18:02:22 +0000 (+0200) Subject: Merge branch 'gallium-msaa' X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3293bcdc80cdfa20a2381aae2b94505bdf95d857;p=profile%2Fivi%2Fmesa.git Merge branch 'gallium-msaa' Conflicts: src/mesa/state_tracker/st_gen_mipmap.c src/mesa/state_tracker/st_texture.c --- 3293bcdc80cdfa20a2381aae2b94505bdf95d857 diff --cc src/gallium/drivers/r300/r300_state.c index 11c10e2,4f41530..67e0936 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@@ -402,8 -400,17 +402,15 @@@ static void r300_set_clip_state(struct draw_set_clip_state(r300->draw, state); r300->clip_state.size = 2; } - - r300->clip_state.dirty = TRUE; } + static void + r300_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) + { + } + + /* Create a new depth, stencil, and alpha state based on the CSO dsa state. * * This contains the depth buffer, stencil buffer, alpha test, and such. diff --cc src/mesa/state_tracker/st_cb_drawpixels.c index 932e8ed,ad20004..f74d8cd --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@@ -969,8 -968,11 +969,9 @@@ st_CopyPixels(GLcontext *ctx, GLint src enum pipe_format srcFormat, texFormat; GLboolean invertTex = GL_FALSE; GLint readX, readY, readW, readH; + GLuint sample_count; struct gl_pixelstore_attrib pack = ctx->DefaultPacking; - pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL); - st_validate_state(st); if (type == GL_STENCIL) { diff --cc src/mesa/state_tracker/st_gen_mipmap.c index e656908,5cf8b4a..2d587df --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@@ -324,7 -300,11 +324,11 @@@ st_generate_mipmap(GLcontext *ctx, GLen if (!pt) return; - /* find expected last mipmap level to generate */ + /* not sure if this ultimately actually should work, + but we're not supporting multisampled textures yet. */ + assert(pt->nr_samples < 2); + - /* find expected last mipmap level */ ++ /* find expected last mipmap level to generate*/ lastLevel = compute_num_levels(ctx, texObj, target) - 1; if (lastLevel == 0) diff --cc src/mesa/state_tracker/st_texture.c index 2d36473,d0d1c5c..dbdf1ea --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@@ -279,43 -242,61 +279,38 @@@ print_center_pixel(struct pipe_context void st_texture_image_copy(struct pipe_context *pipe, struct pipe_resource *dst, GLuint dstLevel, - struct pipe_resource *src, + struct pipe_resource *src, GLuint srcLevel, GLuint face) { - struct pipe_screen *screen = pipe->screen; GLuint width = u_minify(dst->width0, dstLevel); GLuint height = u_minify(dst->height0, dstLevel); GLuint depth = u_minify(dst->depth0, dstLevel); - struct pipe_surface *src_surface; - struct pipe_surface *dst_surface; + struct pipe_subresource dstsub, srcsub; GLuint i; - assert(src->width0 == dst->width0); - assert(src->height0 == dst->height0); + assert(u_minify(src->width0, srcLevel) == width); + assert(u_minify(src->height0, srcLevel) == height); + assert(u_minify(src->depth0, srcLevel) == depth); + dstsub.face = face; + dstsub.level = dstLevel; + srcsub.face = face; - ++ srcsub.level = srcLevel; + /* Loop over 3D image slices */ for (i = 0; i < depth; i++) { - GLuint srcLevel; - - /* find src texture level of needed size */ - for (srcLevel = 0; srcLevel <= src->last_level; srcLevel++) { - if (u_minify(src->width0, srcLevel) == width && - u_minify(src->height0, srcLevel) == height) { - break; - } - } - assert(u_minify(src->width0, srcLevel) == width); - assert(u_minify(src->height0, srcLevel) == height); - -#if 0 - { - struct pipe_screen *screen = pipe->screen; - src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i, - PIPE_BUFFER_USAGE_CPU_READ); - ubyte *map = screen->surface_map(screen, src_surface, PIPE_BUFFER_USAGE_CPU_READ); - map += src_surface->width * src_surface->height * 4 / 2; - printf("%s center pixel: %d %d %d %d (pt %p[%d] -> %p[%d])\n", - __FUNCTION__, - map[0], map[1], map[2], map[3], - src, srcLevel, dst, dstLevel); - - screen->surface_unmap(screen, src_surface); - pipe_surface_reference(&src_surface, NULL); + + if (0) { + print_center_pixel(pipe, src); } -#endif - srcsub.level = srcLevel; - dst_surface = screen->get_tex_surface(screen, dst, face, dstLevel, i, - PIPE_BIND_BLIT_DESTINATION); - - src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i, - PIPE_BIND_BLIT_SOURCE); - - pipe->surface_copy(pipe, - dst_surface, - 0, 0, /* destX, Y */ - src_surface, - 0, 0, /* srcX, Y */ - width, height); - - pipe_surface_reference(&src_surface, NULL); - pipe_surface_reference(&dst_surface, NULL); + pipe->resource_copy_region(pipe, + dst, + dstsub, + 0, 0, i,/* destX, Y, Z */ + src, + srcsub, + 0, 0, i,/* srcX, Y, Z */ + width, height); } }