printf(", ");
print_texture_reg(/*texture->in_reg_full*/true, texture->in_reg_select, texture->in_reg_upper);
- printf(".%c%c, ", "xyzw"[texture->in_reg_swizzle_left],
- "xyzw"[texture->in_reg_swizzle_right]);
+ print_swizzle_vec4(texture->in_reg_swizzle, false, false);
/* TODO: can offsets be full words? */
if (texture->has_offset) {
/* While not zero in general, for these simple instructions the
* following unknowns are zero, so we don't include them */
- if (texture->unknown1 ||
- texture->unknown2 ||
+ if (texture->unknown2 ||
texture->unknown3 ||
texture->unknown4 ||
texture->unknownA ||
texture->unknownB ||
texture->unknown8 ||
texture->unknown9) {
- printf("// unknown1 = 0x%x\n", texture->unknown1);
printf("// unknown2 = 0x%x\n", texture->unknown2);
printf("// unknown3 = 0x%x\n", texture->unknown3);
printf("// unknown4 = 0x%x\n", texture->unknown4);
unsigned in_reg_select : 1;
unsigned in_reg_upper : 1;
+ unsigned in_reg_swizzle : 8;
- unsigned in_reg_swizzle_left : 2;
- unsigned in_reg_swizzle_right : 2;
-
- unsigned unknown1 : 2;
-
- unsigned unknown8 : 4;
+ unsigned unknown8 : 2;
unsigned out_full : 1;
.texture_handle = texture_index,
.sampler_handle = sampler_index,
- /* TODO: Don't force xyzw */
- .swizzle = SWIZZLE(COMPONENT_X, COMPONENT_Y, COMPONENT_Z, COMPONENT_W),
+ /* TODO: Regalloc it in */
+ .swizzle = SWIZZLE_XYZW,
.mask = 0xF,
/* TODO: half */
//.in_reg_full = 1,
+ .in_reg_swizzle = SWIZZLE_XYZW,
.out_full = 1,
.filter = 1,
ins.texture.in_reg_select = in_reg;
ins.texture.out_reg_select = out_reg;
- /* TODO: Dynamic swizzle input selection, half-swizzles? */
- if (instr->sampler_dim == GLSL_SAMPLER_DIM_3D) {
- ins.texture.in_reg_swizzle_right = COMPONENT_X;
- ins.texture.in_reg_swizzle_left = COMPONENT_Y;
- //ins.texture.in_reg_swizzle_third = COMPONENT_Z;
- } else {
- ins.texture.in_reg_swizzle_left = COMPONENT_X;
- ins.texture.in_reg_swizzle_right = COMPONENT_Y;
- //ins.texture.in_reg_swizzle_third = COMPONENT_X;
- }
-
emit_mir_instruction(ctx, ins);
/* Simultaneously alias the destination and emit a move for it. The move will be eliminated if possible */