elem_types[LP_JIT_IMAGE_DEPTH] = LLVMInt32TypeInContext(lc);
elem_types[LP_JIT_IMAGE_BASE] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0);
elem_types[LP_JIT_IMAGE_ROW_STRIDE] =
- elem_types[LP_JIT_IMAGE_IMG_STRIDE] = LLVMInt32TypeInContext(lc);
+ elem_types[LP_JIT_IMAGE_IMG_STRIDE] =
+ elem_types[LP_JIT_IMAGE_NUM_SAMPLES] =
+ elem_types[LP_JIT_IMAGE_SAMPLE_STRIDE] = LLVMInt32TypeInContext(lc);
image_type = LLVMStructTypeInContext(lc, elem_types,
ARRAY_SIZE(elem_types), 0);
LP_CHECK_MEMBER_OFFSET(struct lp_jit_image, img_stride,
gallivm->target, image_type,
LP_JIT_IMAGE_IMG_STRIDE);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_image, num_samples,
+ gallivm->target, image_type,
+ LP_JIT_IMAGE_NUM_SAMPLES);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_image, sample_stride,
+ gallivm->target, image_type,
+ LP_JIT_IMAGE_SAMPLE_STRIDE);
return image_type;
}
const void *base;
uint32_t row_stride;
uint32_t img_stride;
+ uint32_t num_samples;
+ uint32_t sample_stride;
};
enum {
LP_JIT_IMAGE_BASE,
LP_JIT_IMAGE_ROW_STRIDE,
LP_JIT_IMAGE_IMG_STRIDE,
+ LP_JIT_IMAGE_NUM_SAMPLES,
+ LP_JIT_IMAGE_SAMPLE_STRIDE,
LP_JIT_IMAGE_NUM_FIELDS /* number of fields above */
};
/**
jit_image->width = res->width0;
jit_image->height = res->height0;
jit_image->depth = res->depth0;
+ jit_image->num_samples = res->nr_samples;
if (llvmpipe_resource_is_texture(res)) {
uint32_t mip_offset = lp_res->mip_offsets[image->u.tex.level];
jit_image->row_stride = lp_res->row_stride[image->u.tex.level];
jit_image->img_stride = lp_res->img_stride[image->u.tex.level];
+ jit_image->sample_stride = 0;
jit_image->base = (uint8_t *)jit_image->base + mip_offset;
}
else {
jit_image->width = res->width0;
jit_image->height = res->height0;
jit_image->depth = res->depth0;
+ jit_image->num_samples = res->nr_samples;
if (llvmpipe_resource_is_texture(res)) {
uint32_t mip_offset = lp_res->mip_offsets[image->u.tex.level];
jit_image->row_stride = lp_res->row_stride[image->u.tex.level];
jit_image->img_stride = lp_res->img_stride[image->u.tex.level];
+ jit_image->sample_stride = 0;
jit_image->base = (uint8_t *)jit_image->base + mip_offset;
} else {
unsigned view_blocksize = util_format_get_blocksize(image->format);
unsigned i;
uint32_t row_stride;
uint32_t img_stride;
+ uint32_t sample_stride;
const void *addr;
assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS);
unsigned width = u_minify(img->width0, view->u.tex.level);
unsigned height = u_minify(img->height0, view->u.tex.level);
unsigned num_layers = img->depth0;
+ unsigned num_samples = img->nr_samples;
if (!lp_img->dt) {
/* regular texture - setup array of mipmap level offsets */
row_stride = lp_img->row_stride[view->u.tex.level];
img_stride = lp_img->img_stride[view->u.tex.level];
+ sample_stride = 0;
addr = (uint8_t *)addr + mip_offset;
}
else {
/* probably don't really need to fill that out */
row_stride = 0;
img_stride = 0;
+ sample_stride = 0;
/* everything specified in number of elements here. */
width = view->u.buf.size / view_blocksize;
PIPE_TRANSFER_READ);
row_stride = lp_img->row_stride[0];
img_stride = lp_img->img_stride[0];
+ sample_stride = 0;
assert(addr);
}
draw_set_mapped_image(lp->draw,
i,
width, height, num_layers,
addr,
- row_stride, img_stride, 0, 0);
+ row_stride, img_stride,
+ num_samples, sample_stride);
}
}
}
LP_LLVM_IMAGE_MEMBER(base_ptr, LP_JIT_IMAGE_BASE, TRUE)
LP_LLVM_IMAGE_MEMBER(row_stride, LP_JIT_IMAGE_ROW_STRIDE, TRUE)
LP_LLVM_IMAGE_MEMBER(img_stride, LP_JIT_IMAGE_IMG_STRIDE, TRUE)
+LP_LLVM_IMAGE_MEMBER(num_samples, LP_JIT_IMAGE_NUM_SAMPLES, TRUE)
+LP_LLVM_IMAGE_MEMBER(sample_stride, LP_JIT_IMAGE_SAMPLE_STRIDE, TRUE)
#if LP_USE_TEXTURE_CACHE
static LLVMValueRef
image->dynamic_state.base.base_ptr = lp_llvm_image_base_ptr;
image->dynamic_state.base.row_stride = lp_llvm_image_row_stride;
image->dynamic_state.base.img_stride = lp_llvm_image_img_stride;
+ image->dynamic_state.base.num_samples = lp_llvm_image_num_samples;
+ image->dynamic_state.base.sample_stride = lp_llvm_image_sample_stride;
image->dynamic_state.static_state = static_state;