From: Eric Anholt Date: Fri, 23 Oct 2009 21:19:52 +0000 (-0700) Subject: Merge remote branch 'origin/mesa_7_6_branch' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49d402e275cdaf46de8db5a475dfe00509141195;p=mesa.git Merge remote branch 'origin/mesa_7_6_branch' Conflicts: src/mesa/drivers/dri/intel/intel_fbo.c src/mesa/drivers/dri/intel/intel_mipmap_tree.c src/mesa/drivers/dri/intel/intel_mipmap_tree.h src/mesa/drivers/dri/intel/intel_tex_copy.c src/mesa/drivers/dri/intel/intel_tex_image.c --- 49d402e275cdaf46de8db5a475dfe00509141195 diff --cc src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 01e9d4add34,0589d82db25..96836561df2 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@@ -386,45 -378,31 +384,32 @@@ intel_miptree_set_image_offset(struct i assert(img < mt->level[level].nr_images); - mt->level[level].image_offset[img] = (x + y * mt->pitch) * mt->cpp + offset; + mt->level[level].x_offset[img] = mt->level[level].level_x + x; + mt->level[level].y_offset[img] = mt->level[level].level_y + y; - DBG("%s level %d img %d pos %d,%d image_offset %x\n", - __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]); + DBG("%s level %d img %d pos %d,%d\n", + __FUNCTION__, level, img, + mt->level[level].x_offset[img], mt->level[level].y_offset[img]); } + void - intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, - GLuint level, GLuint img, - GLuint x, GLuint y) - { - intel_miptree_set_image_offset_ex(mt, level, img, x, y, 0); - } - - - /** - * Return offset to the start of a 2D slice of a texture (a mipmap level, - * cube face, 3D Z slice). - * \param mt the texture object/miptree - * \param face cube map face in [0,5] or zero for non-cube textures - * \param level mipmap level - * \param zslice Z slice of a 3D texture, or zero for non-3D textures - */ - GLuint - intel_miptree_image_offset(const struct intel_mipmap_tree *mt, - GLuint face, GLuint level, GLuint zslice) + intel_miptree_get_image_offset(struct intel_mipmap_tree *mt, + GLuint level, GLuint face, GLuint depth, + GLuint *x, GLuint *y) { - GLuint offset = mt->level[level].level_offset; - - if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) - offset += mt->level[level].image_offset[face]; - else if (mt->target == GL_TEXTURE_3D) - offset += mt->level[level].image_offset[zslice]; - - return offset; + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) { + *x = mt->level[level].x_offset[face]; + *y = mt->level[level].y_offset[face]; + } else if (mt->target == GL_TEXTURE_3D) { + *x = mt->level[level].x_offset[depth]; + *y = mt->level[level].y_offset[depth]; + } else { + *x = mt->level[level].x_offset[0]; + *y = mt->level[level].y_offset[0]; + } } - /** * Map a teximage in a mipmap tree. * \param row_stride returns row stride in bytes @@@ -448,20 -427,25 +434,26 @@@ intel_miptree_image_map(struct intel_co if (mt->target == GL_TEXTURE_3D) { int i; - for (i = 0; i < mt->level[level].depth; i++) - image_offsets[i] = mt->level[level].image_offset[i] / mt->cpp; + for (i = 0; i < mt->level[level].depth; i++) { + + intel_miptree_get_image_offset(mt, level, face, i, + &x, &y); + image_offsets[i] = x + y * mt->pitch; + } + + return intel_region_map(intel, mt->region); } else { assert(mt->level[level].depth == 1); - assert(mt->target == GL_TEXTURE_CUBE_MAP || - mt->level[level].image_offset[0] == 0); + intel_miptree_get_image_offset(mt, level, face, 0, + &x, &y); image_offsets[0] = 0; - } - return (intel_region_map(intel, mt->region) + - intel_miptree_image_offset(mt, face, level, 0)); + return intel_region_map(intel, mt->region) + + (x + y * mt->pitch) * mt->cpp; + } } + void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt) @@@ -488,16 -472,15 +480,16 @@@ intel_miptree_image_data(struct intel_c DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { - GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); - GLuint height = dst->level[level].height; + GLuint dst_x, dst_y, height; + + intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y); - if (dst->compressed) + height = dst->level[level].height; + if(dst->compressed) height = (height + 3) / 4; + intel_region_data(intel, - dst->region, - dst_offset, - 0, 0, /* dstx, dsty */ + dst->region, 0, dst_x, dst_y, src, src_row_pitch, 0, 0, /* source x, y */ diff --cc src/mesa/drivers/dri/intel/intel_tex_image.c index dcc613449f0,2e0945c3657..9d5b2bd6b98 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@@ -200,12 -204,9 +200,12 @@@ try_pbo_upload(struct intel_context *in { struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; - GLuint dst_offset, dst_stride; + GLuint dst_x, dst_y, dst_stride; + dri_bo *dst_buffer = intel_region_buffer(intel, + intelImage->mt->region, + INTEL_WRITE_FULL); - if (unpack->BufferObj->Name == 0 || + if (!_mesa_is_bufferobj(unpack->BufferObj) || intel->ctx._ImageTransferState || unpack->SkipPixels || unpack->SkipRows) { DBG("%s: failure 1\n", __FUNCTION__); @@@ -232,10 -231,10 +231,6 @@@ LOCK_HARDWARE(intel); { dri_bo *src_buffer = intel_bufferobj_buffer(intel, pbo, INTEL_READ); -- dri_bo *dst_buffer = intel_region_buffer(intel, -- intelImage->mt->region, -- INTEL_WRITE_FULL); -- if (!intelEmitCopyBlit(intel, intelImage->mt->cpp, @@@ -263,9 -262,9 +258,9 @@@ try_pbo_zcopy(struct intel_context *int { struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; - GLuint dst_offset, dst_stride; + GLuint dst_x, dst_y, dst_stride; - if (unpack->BufferObj->Name == 0 || + if (!_mesa_is_bufferobj(unpack->BufferObj) || intel->ctx._ImageTransferState || unpack->SkipPixels || unpack->SkipRows) { DBG("%s: failure 1\n", __FUNCTION__); diff --cc src/mesa/shader/program_parse.tab.c index c0f50147bd9,c255e912ed2..90867938a47 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@@ -3389,12 -3104,12 +3389,12 @@@ yyreduce ;} break; - case 112: + case 126: /* Line 1455 of yacc.c */ -#line 1041 "program_parse.y" +#line 1238 "program_parse.y" { - if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { + if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); YYERROR; } else {