| 
				
			 | 
			
			 | 
			@@ -59,6 +59,10 @@ target_to_target(GLenum target) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			#endif | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/** | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * Allocate a new pipe_texture object | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 */ | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			struct pipe_texture * | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			st_texture_create(struct st_context *st, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                  enum pipe_texture_target target, | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -100,17 +104,16 @@ st_texture_create(struct st_context *st, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/* Can the image be pulled into a unified mipmap texture.  This mirrors | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * the completeness test in a lot of ways. | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/** | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * Check if a texture image be pulled into a unified mipmap texture. | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * This mirrors the completeness test in a lot of ways. | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * Not sure whether I want to pass gl_texture_image here. | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 */ | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			GLboolean | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			st_texture_match_image(struct pipe_texture *pt, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                          struct gl_texture_image *image, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                          GLuint face, GLuint level) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			st_texture_match_image(const struct pipe_texture *pt, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                       const struct gl_texture_image *image, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                       GLuint face, GLuint level) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			{ | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   /* Images with borders are never pulled into mipmap textures.  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			    */ | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -189,6 +192,7 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   return pipe_surface_map(stImage->surface); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			void | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			st_texture_image_unmap(struct st_texture_image *stImage) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			{ | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -201,7 +205,8 @@ st_texture_image_unmap(struct st_texture_image *stImage) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/* Upload data to a rectangular sub-region.  Lots of choices how to do this: | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/** | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * Upload data to a rectangular sub-region.  Lots of choices how to do this: | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * - memcpy by span to current destination | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 * - upload data as new buffer and blit | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -261,13 +266,14 @@ st_texture_image_data(struct pipe_context *pipe, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   } | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			/* Copy mipmap image between textures | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			 */ | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			void | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			st_texture_image_copy(struct pipe_context *pipe, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                         struct pipe_texture *dst, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                         GLuint face, GLuint level, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                         struct pipe_texture *src) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                      struct pipe_texture *dst, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                      GLuint face, GLuint level, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			                      struct pipe_texture *src) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			{ | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   GLuint width = src->width[level]; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   GLuint height = src->height[level]; | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -278,6 +284,7 @@ st_texture_image_copy(struct pipe_context *pipe, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   if (dst->compressed) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      height /= 4; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   for (i = 0; i < depth; i++) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      dst_surface = pipe->get_tex_surface(pipe, dst, face, level, i); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      src_surface = pipe->get_tex_surface(pipe, src, face, level, i); | 
		
		
	
	
		
			
			| 
				
			 | 
			
			 | 
			@@ -292,5 +299,4 @@ st_texture_image_copy(struct pipe_context *pipe, | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      pipe_surface_reference(&dst_surface, NULL); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			      pipe_surface_reference(&src_surface, NULL); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			   } | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} |