diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_texture.c | 21 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 13 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_texture.c | 40 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_texture.h | 16 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_vdpau.c | 2 |
6 files changed, 12 insertions, 84 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c index 1dbc4b905..db254c214 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -485,8 +485,8 @@ st_clear_buffer_subdata(struct gl_context *ctx, static const char zeros[16] = {0}; if (!pipe->clear_buffer) { - _mesa_buffer_clear_subdata(ctx, offset, size, - clearValue, clearValueSize, bufObj); + _mesa_ClearBufferSubData_sw(ctx, offset, size, + clearValue, clearValueSize, bufObj); return; } diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index a8b19a1f3..5c520b44f 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -178,9 +178,6 @@ st_FreeTextureImageBuffer(struct gl_context *ctx, pipe_resource_reference(&stImage->pt, NULL); } - _mesa_align_free(stImage->TexData); - stImage->TexData = NULL; - free(stImage->transfer); stImage->transfer = NULL; stImage->num_transfers = 0; @@ -501,7 +498,6 @@ st_AllocTextureImageBuffer(struct gl_context *ctx, DBG("%s\n", __FUNCTION__); - assert(!stImage->TexData); assert(!stImage->pt); /* xxx this might be wrong */ /* Look if the parent texture object has space for this image */ @@ -1521,23 +1517,6 @@ copy_image_data_to_texture(struct st_context *st, pipe_resource_reference(&stImage->pt, NULL); } - else if (stImage->TexData) { - /* Copy from malloc'd memory */ - /* XXX this should be re-examined/tested with a compressed format */ - GLuint blockSize = util_format_get_blocksize(stObj->pt->format); - GLuint srcRowStride = stImage->base.Width * blockSize; - GLuint srcSliceStride = stImage->base.Height * srcRowStride; - st_texture_image_data(st, - stObj->pt, - stImage->base.Face, - dstLevel, - stImage->TexData, - srcRowStride, - srcSliceStride); - _mesa_align_free(stImage->TexData); - stImage->TexData = NULL; - } - pipe_resource_reference(&stImage->pt, stObj->pt); } diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index bd191d864..efee4b258 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -332,6 +332,7 @@ public: int glsl_version; bool native_integers; bool have_sqrt; + bool have_fma; variable_storage *find_variable_storage(ir_variable *var); @@ -836,6 +837,7 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op, case3fid(ADD, UADD, DADD); case3fid(MUL, UMUL, DMUL); case3fid(MAD, UMAD, DMAD); + case3fid(FMA, UMAD, DFMA); case3(DIV, IDIV, UDIV); case4d(MAX, IMAX, UMAX, DMAX); case4d(MIN, IMIN, UMIN, DMIN); @@ -2222,10 +2224,11 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) emit(ir, TGSI_OPCODE_IMUL_HI, result_dst, op[0], op[1]); break; case ir_triop_fma: - /* NOTE: Perhaps there should be a special opcode that enforces fused - * mul-add. Just use MAD for now. - */ - emit(ir, TGSI_OPCODE_MAD, result_dst, op[0], op[1], op[2]); + /* In theory, MAD is incorrect here. */ + if (have_fma) + emit(ir, TGSI_OPCODE_FMA, result_dst, op[0], op[1], op[2]); + else + emit(ir, TGSI_OPCODE_MAD, result_dst, op[0], op[1], op[2]); break; case ir_unop_interpolate_at_centroid: emit(ir, TGSI_OPCODE_INTERP_CENTROID, result_dst, op[0]); @@ -5564,6 +5567,8 @@ get_mesa_program(struct gl_context *ctx, v->have_sqrt = pscreen->get_shader_param(pscreen, ptarget, PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED); + v->have_fma = pscreen->get_shader_param(pscreen, ptarget, + PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED); _mesa_copy_linked_program_data(shader->Stage, shader_program, prog); _mesa_generate_parameters_list_for_uniforms(shader_program, shader, diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c index ada984189..ca7c83c21 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.c +++ b/mesalib/src/mesa/state_tracker/st_texture.c @@ -310,46 +310,6 @@ st_texture_image_unmap(struct st_context *st, *transfer = NULL; } - -/* Upload data for a particular image. - */ -void -st_texture_image_data(struct st_context *st, - struct pipe_resource *dst, - GLuint face, - GLuint level, - void *src, - GLuint src_row_stride, GLuint src_image_stride) -{ - struct pipe_context *pipe = st->pipe; - GLuint i; - const GLubyte *srcUB = src; - GLuint layers; - - if (dst->target == PIPE_TEXTURE_1D_ARRAY || - dst->target == PIPE_TEXTURE_2D_ARRAY || - dst->target == PIPE_TEXTURE_CUBE_ARRAY) - layers = dst->array_size; - else - layers = u_minify(dst->depth0, level); - - DBG("%s\n", __FUNCTION__); - - for (i = 0; i < layers; i++) { - struct pipe_box box; - u_box_2d_zslice(0, 0, face + i, - u_minify(dst->width0, level), - u_minify(dst->height0, level), - &box); - - pipe->transfer_inline_write(pipe, dst, level, PIPE_TRANSFER_WRITE, - &box, srcUB, src_row_stride, 0); - - srcUB += src_image_stride; - } -} - - /** * For debug only: get/print center pixel in the src resource. */ diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h index 6b7f8c750..d8cd7c7b5 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.h +++ b/mesalib/src/mesa/state_tracker/st_texture.h @@ -55,13 +55,7 @@ struct st_texture_image { struct gl_texture_image base; - /** Used to store texture data that doesn't fit in the parent - * object's mipmap buffer. - */ - GLubyte *TexData; - /* If stImage->pt != NULL, image data is stored here. - * Else if stImage->TexData != NULL, image is stored there. * Else there is no image data. */ struct pipe_resource *pt; @@ -230,16 +224,6 @@ st_texture_image_unmap(struct st_context *st, extern const GLuint * st_texture_depth_offsets(struct pipe_resource *pt, GLuint level); - -/* Upload an image into a texture - */ -extern void -st_texture_image_data(struct st_context *st, - struct pipe_resource *dst, - GLuint face, GLuint level, void *src, - GLuint src_row_pitch, GLuint src_image_pitch); - - /* Copy an image between two textures */ extern void diff --git a/mesalib/src/mesa/state_tracker/st_vdpau.c b/mesalib/src/mesa/state_tracker/st_vdpau.c index 6ccaf3e3f..63af1196a 100644 --- a/mesalib/src/mesa/state_tracker/st_vdpau.c +++ b/mesalib/src/mesa/state_tracker/st_vdpau.c @@ -66,7 +66,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access, struct pipe_sampler_view templ, **sampler_view; mesa_format texFormat; - getProcAddr = ctx->vdpGetProcAddress; + getProcAddr = (void *)ctx->vdpGetProcAddress; if (output) { VdpOutputSurfaceGallium *f; |