#include "lp_bld_debug.h"
#include "lp_bld_printf.h"
#include "lp_bld_sample.h"
+#include "lp_bld_struct.h"
static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context *bld)
struct lp_build_context *uint_bld = &bld_base->uint_bld;
LLVMValueRef indirect_index = NULL;
struct lp_build_context *bld_fetch = stype_to_fetch(bld_base, stype);
-
+ unsigned dimension = 0;
+ LLVMValueRef dimension_index;
+ LLVMValueRef consts_ptr;
+
/* XXX: Handle fetching xyzw components as a vector */
assert(swizzle != ~0);
+ if (reg->Register.Dimension) {
+ assert(!reg->Dimension.Indirect);
+ dimension = reg->Dimension.Index;
+ assert(dimension < LP_MAX_TGSI_CONST_BUFFERS);
+ }
+
+ dimension_index = lp_build_const_int32(gallivm, dimension);
+ consts_ptr = lp_build_array_get(gallivm, bld->consts_ptr, dimension_index);
+
if (reg->Register.Indirect) {
indirect_index = get_indirect_index(bld,
reg->Register.File,
index_vec = lp_build_add(uint_bld, index_vec, swizzle_vec);
/* Gather values from the constant buffer */
- return build_gather(bld_fetch, bld->consts_ptr, index_vec);
+ return build_gather(bld_fetch, consts_ptr, index_vec);
}
else {
LLVMValueRef index; /* index into the const buffer */
index = lp_build_const_int32(gallivm, reg->Register.Index*4 + swizzle);
- scalar_ptr = LLVMBuildGEP(builder, bld->consts_ptr,
+ scalar_ptr = LLVMBuildGEP(builder, consts_ptr,
&index, 1, "");
if (stype != TGSI_TYPE_FLOAT && stype != TGSI_TYPE_UNTYPED) {
switch (inst->Texture.Texture) {
case TGSI_TEXTURE_1D:
case TGSI_TEXTURE_SHADOW1D:
- case TGSI_TEXTURE_SHADOW2D:
- case TGSI_TEXTURE_SHADOWCUBE:
num_coords = 1;
has_lod = 1;
break;
case TGSI_TEXTURE_2D:
+ case TGSI_TEXTURE_SHADOW2D:
case TGSI_TEXTURE_CUBE:
+ case TGSI_TEXTURE_SHADOWCUBE:
case TGSI_TEXTURE_1D_ARRAY:
case TGSI_TEXTURE_SHADOW1D_ARRAY:
num_coords = 2;