Squashed commit of the following:
[mesa.git] / src / gallium / drivers / r300 / r300_blit.c
index 513cc0f5d44e433d9051ac85232fc65a3f776cb1..b99879afdd3095476beb1a041de3b5b0b87746f7 100644 (file)
@@ -36,6 +36,7 @@ static void r300_blitter_save_states(struct r300_context* r300)
     util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state);
     util_blitter_save_viewport(r300->blitter, &r300->viewport);
     util_blitter_save_clip(r300->blitter, &r300->clip);
+    util_blitter_save_vertex_elements(r300->blitter, r300->velems);
 }
 
 /* Clear currently bound buffers. */
@@ -112,9 +113,9 @@ static void r300_hw_copy(struct pipe_context* pipe,
     util_blitter_save_fragment_sampler_states(
         r300->blitter, state->sampler_count, (void**)state->sampler_states);
 
-    util_blitter_save_fragment_sampler_textures(
+    util_blitter_save_fragment_sampler_views(
         r300->blitter, state->texture_count,
-        (struct pipe_texture**)state->textures);
+        state->fragment_sampler_views);
 
     /* Do a copy */
     util_blitter_copy(r300->blitter,
@@ -136,8 +137,8 @@ void r300_surface_copy(struct pipe_context* pipe,
 
     if (!pipe->screen->is_format_supported(pipe->screen,
                                            old_format, src->texture->target,
-                                           PIPE_TEXTURE_USAGE_RENDER_TARGET |
-                                           PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+                                           PIPE_BIND_RENDER_TARGET |
+                                           PIPE_BIND_SAMPLER_VIEW, 0)) {
         switch (util_format_get_blocksize(old_format)) {
             case 1:
                 new_format = PIPE_FORMAT_I8_UNORM;
@@ -148,6 +149,9 @@ void r300_surface_copy(struct pipe_context* pipe,
             case 4:
                 new_format = PIPE_FORMAT_B8G8R8A8_UNORM;
                 break;
+            case 8:
+                new_format = PIPE_FORMAT_R16G16B16A16_UNORM;
+                break;
             default:
                 debug_printf("r300: surface_copy: Unhandled format: %s. Falling back to software.\n"
                              "r300: surface_copy: Software fallback doesn't work for tiled textures.\n",