mesa: Remove unnecessary -f from $(RM).
[mesa.git] / src / mesa / state_tracker / st_cb_drawpixels.c
index 4e79511d606da34c6b51dc641cd4e96c392c97cc..939fc2065457edc365a3f6f54da238a6cc29af89 100644 (file)
@@ -483,7 +483,7 @@ make_texture(struct st_context *st,
 {
    struct gl_context *ctx = st->ctx;
    struct pipe_context *pipe = st->pipe;
-   gl_format mformat;
+   mesa_format mformat;
    struct pipe_resource *pt;
    enum pipe_format pipeFormat;
    GLenum baseInternalFormat;
@@ -491,25 +491,22 @@ make_texture(struct st_context *st,
    /* Choose a pixel format for the temp texture which will hold the
     * image to draw.
     */
-   pipeFormat = st_choose_matching_format(pipe->screen, PIPE_BIND_SAMPLER_VIEW,
+   pipeFormat = st_choose_matching_format(st, PIPE_BIND_SAMPLER_VIEW,
                                           format, type, unpack->SwapBytes);
 
-   if (pipeFormat != PIPE_FORMAT_NONE) {
-      mformat = st_pipe_format_to_mesa_format(pipeFormat);
-      baseInternalFormat = _mesa_get_format_base_format(mformat);
-   }
-   else {
+   if (pipeFormat == PIPE_FORMAT_NONE) {
       /* Use the generic approach. */
       GLenum intFormat = internal_format(ctx, format, type);
 
-      baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
       pipeFormat = st_choose_format(st, intFormat, format, type,
                                     PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
                                     FALSE);
       assert(pipeFormat != PIPE_FORMAT_NONE);
-      mformat = st_pipe_format_to_mesa_format(pipeFormat);
    }
 
+   mformat = st_pipe_format_to_mesa_format(pipeFormat);
+   baseInternalFormat = _mesa_get_format_base_format(mformat);
+
    pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
    if (!pixels)
       return NULL;
@@ -542,7 +539,7 @@ make_texture(struct st_context *st,
        */
       success = _mesa_texstore(ctx, 2,           /* dims */
                                baseInternalFormat, /* baseInternalFormat */
-                               mformat,          /* gl_format */
+                               mformat,          /* mesa_format */
                                transfer->stride, /* dstRowStride, bytes */
                                &dest,            /* destSlices */
                                width, height, 1, /* size */
@@ -779,16 +776,14 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
       vp.scale[0] =  0.5f * w;
       vp.scale[1] = -0.5f * h;
       vp.scale[2] = 0.5f;
-      vp.scale[3] = 1.0f;
       vp.translate[0] = 0.5f * w;
       vp.translate[1] = 0.5f * h;
       vp.translate[2] = 0.5f;
-      vp.translate[3] = 0.0f;
       cso_set_viewport(cso, &vp);
    }
 
    cso_set_vertex_elements(cso, 3, st->velems_util_draw);
-   cso_set_stream_outputs(st->cso_context, 0, NULL, 0);
+   cso_set_stream_outputs(st->cso_context, 0, NULL, NULL);
 
    /* texture state: */
    cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num_sampler_view, sv);
@@ -1364,7 +1359,7 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
        !ctx->Stencil.Enabled &&
        !ctx->FragmentProgram.Enabled &&
        !ctx->VertexProgram.Enabled &&
-       !ctx->Shader.CurrentFragmentProgram &&
+       !ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT] &&
        ctx->DrawBuffer->_NumColorDrawBuffers == 1 &&
        !ctx->Query.CondRenderQuery &&
        !ctx->Query.CurrentOcclusionObject) {