mesa/st: move copy image sub data to direct call

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
This commit is contained in:
Dave Airlie 2021-12-07 11:52:47 +10:00 committed by Marge Bot
parent 81eae71936
commit 878cf8cae9
5 changed files with 18 additions and 44 deletions

View File

@ -36,6 +36,8 @@
#include "textureview.h"
#include "glformats.h"
#include "state_tracker/st_cb_copyimage.h"
enum mesa_block_class {
BLOCK_CLASS_128_BITS,
BLOCK_CLASS_64_BITS
@ -567,12 +569,12 @@ copy_image_subdata(struct gl_context *ctx,
newDstZ = 0;
}
ctx->Driver.CopyImageSubData(ctx,
srcTexImage, srcRenderbuffer,
srcX, srcY, newSrcZ,
dstTexImage, dstRenderbuffer,
dstX, dstY, newDstZ,
srcWidth, srcHeight);
st_CopyImageSubData(ctx,
srcTexImage, srcRenderbuffer,
srcX, srcY, newSrcZ,
dstTexImage, dstRenderbuffer,
dstX, dstY, newDstZ,
srcWidth, srcHeight);
}
}

View File

@ -116,31 +116,6 @@ struct pipe_vertex_element;
* file should be updated too!!!
*/
struct dd_function_table {
/**
* Called by glCopyImageSubData().
*
* This function should copy one 2-D slice from src_teximage or
* src_renderbuffer to dst_teximage or dst_renderbuffer. Either the
* teximage or renderbuffer pointer will be non-null to indicate which
* is the real src/dst.
*
* If one of the textures is 3-D or is a 1-D or 2-D array
* texture, this function will be called multiple times: once for each
* slice. If one of the textures is a cube map, this function will be
* called once for each face to be copied.
*/
void (*CopyImageSubData)(struct gl_context *ctx,
struct gl_texture_image *src_teximage,
struct gl_renderbuffer *src_renderbuffer,
int src_x, int src_y, int src_z,
struct gl_texture_image *dst_teximage,
struct gl_renderbuffer *dst_renderbuffer,
int dst_x, int dst_y, int dst_z,
int src_width, int src_height);
/*@}*/
/**
* \name Vertex/fragment program functions
*/

View File

@ -624,7 +624,7 @@ fallback_copy_image(struct st_context *st,
}
}
static void
void
st_CopyImageSubData(struct gl_context *ctx,
struct gl_texture_image *src_image,
struct gl_renderbuffer *src_renderbuffer,
@ -688,9 +688,3 @@ st_CopyImageSubData(struct gl_context *ctx,
src_res, src_level, &box);
}
}
void
st_init_copy_image_functions(struct dd_function_table *functions)
{
functions->CopyImageSubData = st_CopyImageSubData;
}

View File

@ -25,9 +25,14 @@
#ifndef ST_CB_COPY_IMAGE_H
#define ST_CB_COPY_IMAGE_H
struct dd_function_table;
extern void
st_init_copy_image_functions(struct dd_function_table *functions);
void
st_CopyImageSubData(struct gl_context *ctx,
struct gl_texture_image *src_image,
struct gl_renderbuffer *src_renderbuffer,
int src_x, int src_y, int src_z,
struct gl_texture_image *dst_image,
struct gl_renderbuffer *dst_renderbuffer,
int dst_x, int dst_y, int dst_z,
int src_width, int src_height);
#endif /* ST_CB_COPY_IMAGE_H */

View File

@ -48,7 +48,6 @@
#include "st_cb_clear.h"
#include "st_cb_compute.h"
#include "st_cb_condrender.h"
#include "st_cb_copyimage.h"
#include "st_cb_drawpixels.h"
#include "st_cb_drawtex.h"
#include "st_cb_eglimage.h"
@ -924,7 +923,6 @@ st_init_driver_functions(struct pipe_screen *screen,
st_init_draw_functions(screen, functions);
st_init_blit_functions(functions);
st_init_bufferobject_functions(screen, functions);
st_init_copy_image_functions(functions);
st_init_drawtex_functions(functions);