elem_types[LP_JIT_TEXTURE_WIDTH] =
elem_types[LP_JIT_TEXTURE_HEIGHT] =
elem_types[LP_JIT_TEXTURE_DEPTH] =
+ elem_types[LP_JIT_TEXTURE_NUM_SAMPLES] =
+ elem_types[LP_JIT_TEXTURE_SAMPLE_STRIDE] =
elem_types[LP_JIT_TEXTURE_FIRST_LEVEL] =
elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32TypeInContext(lc);
elem_types[LP_JIT_TEXTURE_BASE] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0);
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, mip_offsets,
gallivm->target, texture_type,
LP_JIT_TEXTURE_MIP_OFFSETS);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, num_samples,
+ gallivm->target, texture_type,
+ LP_JIT_TEXTURE_NUM_SAMPLES);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, sample_stride,
+ gallivm->target, texture_type,
+ LP_JIT_TEXTURE_SAMPLE_STRIDE);
LP_CHECK_STRUCT_SIZE(struct lp_jit_texture,
gallivm->target, texture_type);
return texture_type;
uint32_t first_level;
uint32_t last_level;
uint32_t mip_offsets[LP_MAX_TEXTURE_LEVELS];
+ uint32_t num_samples;
+ uint32_t sample_stride;
};
LP_JIT_TEXTURE_FIRST_LEVEL,
LP_JIT_TEXTURE_LAST_LEVEL,
LP_JIT_TEXTURE_MIP_OFFSETS,
+ LP_JIT_TEXTURE_NUM_SAMPLES,
+ LP_JIT_TEXTURE_SAMPLE_STRIDE,
LP_JIT_TEXTURE_NUM_FIELDS /* number of fields above */
};
jit_tex->mip_offsets[0] = 0;
jit_tex->row_stride[0] = 0;
jit_tex->img_stride[0] = 0;
+ jit_tex->num_samples = 0;
+ jit_tex->sample_stride = 0;
}
else {
jit_tex->width = res->width0;
jit_tex->depth = res->depth0;
jit_tex->first_level = first_level;
jit_tex->last_level = last_level;
+ jit_tex->num_samples = res->nr_samples;
+ jit_tex->sample_stride = 0;
if (llvmpipe_resource_is_texture(res)) {
for (j = first_level; j <= last_level; j++) {
jit_tex->height = res->height0;
jit_tex->depth = res->depth0;
jit_tex->first_level = jit_tex->last_level = 0;
+ jit_tex->sample_stride = res->nr_samples;
+ jit_tex->sample_stride = 0;
assert(jit_tex->base);
}
}
jit_tex->mip_offsets[0] = 0;
jit_tex->row_stride[0] = 0;
jit_tex->img_stride[0] = 0;
+ jit_tex->num_samples = 0;
+ jit_tex->sample_stride = 0;
}
else {
jit_tex->width = res->width0;
jit_tex->depth = res->depth0;
jit_tex->first_level = first_level;
jit_tex->last_level = last_level;
+ jit_tex->num_samples = res->nr_samples;
+ jit_tex->sample_stride = 0;
if (llvmpipe_resource_is_texture(res)) {
for (j = first_level; j <= last_level; j++) {
jit_tex->height = res->height0;
jit_tex->depth = res->depth0;
jit_tex->first_level = jit_tex->last_level = 0;
+ jit_tex->num_samples = res->nr_samples;
+ jit_tex->sample_stride = 0;
assert(jit_tex->base);
}
}
unsigned num_layers = tex->depth0;
unsigned first_level = 0;
unsigned last_level = 0;
+ unsigned sample_stride = 0;
+ unsigned num_samples = tex->nr_samples;
if (!lp_tex->dt) {
/* regular texture - setup array of mipmap level offsets */
shader_type,
i,
width0, tex->height0, num_layers,
- first_level, last_level, 0, 0,
+ first_level, last_level,
+ num_samples, sample_stride,
addr,
row_stride, img_stride, mip_offsets);
}
LP_LLVM_TEXTURE_MEMBER(row_stride, LP_JIT_TEXTURE_ROW_STRIDE, FALSE)
LP_LLVM_TEXTURE_MEMBER(img_stride, LP_JIT_TEXTURE_IMG_STRIDE, FALSE)
LP_LLVM_TEXTURE_MEMBER(mip_offsets, LP_JIT_TEXTURE_MIP_OFFSETS, FALSE)
+LP_LLVM_TEXTURE_MEMBER(num_samples, LP_JIT_TEXTURE_NUM_SAMPLES, TRUE)
+LP_LLVM_TEXTURE_MEMBER(sample_stride, LP_JIT_TEXTURE_SAMPLE_STRIDE, TRUE)
/**
sampler->dynamic_state.base.row_stride = lp_llvm_texture_row_stride;
sampler->dynamic_state.base.img_stride = lp_llvm_texture_img_stride;
sampler->dynamic_state.base.mip_offsets = lp_llvm_texture_mip_offsets;
+ sampler->dynamic_state.base.num_samples = lp_llvm_texture_num_samples;
+ sampler->dynamic_state.base.sample_stride = lp_llvm_texture_sample_stride;
sampler->dynamic_state.base.min_lod = lp_llvm_sampler_min_lod;
sampler->dynamic_state.base.max_lod = lp_llvm_sampler_max_lod;
sampler->dynamic_state.base.lod_bias = lp_llvm_sampler_lod_bias;