From: Dave Airlie Date: Fri, 19 Jul 2019 05:04:55 +0000 (+1000) Subject: gallivm: move first/last level jit texture members. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1e8fcef47545db29950a6b2baf400dd0c6085a5;p=mesa.git gallivm: move first/last level jit texture members. This lets us create an image structure with the same basic types as the texture one. Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index d4c89a85146..2bc924b6939 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -145,12 +145,6 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name) LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, depth, target, texture_type, DRAW_JIT_TEXTURE_DEPTH); - LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, first_level, - target, texture_type, - DRAW_JIT_TEXTURE_FIRST_LEVEL); - LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, last_level, - target, texture_type, - DRAW_JIT_TEXTURE_LAST_LEVEL); LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, base, target, texture_type, DRAW_JIT_TEXTURE_BASE); @@ -160,6 +154,12 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name) LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, img_stride, target, texture_type, DRAW_JIT_TEXTURE_IMG_STRIDE); + LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, first_level, + target, texture_type, + DRAW_JIT_TEXTURE_FIRST_LEVEL); + LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, last_level, + target, texture_type, + DRAW_JIT_TEXTURE_LAST_LEVEL); LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, mip_offsets, target, texture_type, DRAW_JIT_TEXTURE_MIP_OFFSETS); diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h index 1556ea5c7ac..26ca32ff8d2 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.h +++ b/src/gallium/auxiliary/draw/draw_llvm.h @@ -49,11 +49,11 @@ struct draw_jit_texture uint32_t width; uint32_t height; uint32_t depth; - uint32_t first_level; - uint32_t last_level; const void *base; uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS]; uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS]; + uint32_t first_level; + uint32_t last_level; uint32_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS]; }; @@ -83,11 +83,11 @@ enum { DRAW_JIT_TEXTURE_WIDTH = 0, DRAW_JIT_TEXTURE_HEIGHT, DRAW_JIT_TEXTURE_DEPTH, - DRAW_JIT_TEXTURE_FIRST_LEVEL, - DRAW_JIT_TEXTURE_LAST_LEVEL, DRAW_JIT_TEXTURE_BASE, DRAW_JIT_TEXTURE_ROW_STRIDE, DRAW_JIT_TEXTURE_IMG_STRIDE, + DRAW_JIT_TEXTURE_FIRST_LEVEL, + DRAW_JIT_TEXTURE_LAST_LEVEL, DRAW_JIT_TEXTURE_MIP_OFFSETS, DRAW_JIT_TEXTURE_NUM_FIELDS /* number of fields above */ }; diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index de21abf212a..6270340ef61 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -71,12 +71,6 @@ create_jit_texture_type(struct gallivm_state *gallivm) LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, depth, gallivm->target, texture_type, LP_JIT_TEXTURE_DEPTH); - LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, first_level, - gallivm->target, texture_type, - LP_JIT_TEXTURE_FIRST_LEVEL); - LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level, - gallivm->target, texture_type, - LP_JIT_TEXTURE_LAST_LEVEL); LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, base, gallivm->target, texture_type, LP_JIT_TEXTURE_BASE); @@ -86,6 +80,12 @@ create_jit_texture_type(struct gallivm_state *gallivm) LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, img_stride, gallivm->target, texture_type, LP_JIT_TEXTURE_IMG_STRIDE); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, first_level, + gallivm->target, texture_type, + LP_JIT_TEXTURE_FIRST_LEVEL); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level, + gallivm->target, texture_type, + LP_JIT_TEXTURE_LAST_LEVEL); LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, mip_offsets, gallivm->target, texture_type, LP_JIT_TEXTURE_MIP_OFFSETS); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 6dc3147df2a..7868cf4eefa 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -53,11 +53,11 @@ struct lp_jit_texture uint32_t width; /* same as number of elements */ uint32_t height; uint32_t depth; /* doubles as array size */ - uint32_t first_level; - uint32_t last_level; const void *base; uint32_t row_stride[LP_MAX_TEXTURE_LEVELS]; uint32_t img_stride[LP_MAX_TEXTURE_LEVELS]; + uint32_t first_level; + uint32_t last_level; uint32_t mip_offsets[LP_MAX_TEXTURE_LEVELS]; }; @@ -82,11 +82,11 @@ enum { LP_JIT_TEXTURE_WIDTH = 0, LP_JIT_TEXTURE_HEIGHT, LP_JIT_TEXTURE_DEPTH, - LP_JIT_TEXTURE_FIRST_LEVEL, - LP_JIT_TEXTURE_LAST_LEVEL, LP_JIT_TEXTURE_BASE, LP_JIT_TEXTURE_ROW_STRIDE, LP_JIT_TEXTURE_IMG_STRIDE, + LP_JIT_TEXTURE_FIRST_LEVEL, + LP_JIT_TEXTURE_LAST_LEVEL, LP_JIT_TEXTURE_MIP_OFFSETS, LP_JIT_TEXTURE_NUM_FIELDS /* number of fields above */ };