{
glsl_to_tgsi_instruction *inst = new(mem_ctx) glsl_to_tgsi_instruction();
int num_reladdr = 0, i, j;
- bool dst_is_double[2];
+ bool dst_is_64bit[2];
op = get_opcode(ir, op, dst, src0, src1);
* GLSL [0].w -> TGSI [1].zw
*/
for (j = 0; j < 2; j++) {
- dst_is_double[j] = false;
- if (inst->dst[j].type == GLSL_TYPE_DOUBLE)
- dst_is_double[j] = true;
- else if (inst->dst[j].file == PROGRAM_OUTPUT && inst->dst[j].type == GLSL_TYPE_ARRAY) {
+ dst_is_64bit[j] = glsl_base_type_is_64bit(inst->dst[j].type);
+ if (!dst_is_64bit[j] && inst->dst[j].file == PROGRAM_OUTPUT && inst->dst[j].type == GLSL_TYPE_ARRAY) {
enum glsl_base_type type = find_array_type(this->output_arrays, this->num_output_arrays, inst->dst[j].array_id);
- if (type == GLSL_TYPE_DOUBLE)
- dst_is_double[j] = true;
+ if (glsl_base_type_is_64bit(type))
+ dst_is_64bit[j] = true;
}
}
- if (dst_is_double[0] || dst_is_double[1] ||
- inst->src[0].type == GLSL_TYPE_DOUBLE) {
+ if (dst_is_64bit[0] || dst_is_64bit[1] ||
+ glsl_base_type_is_64bit(inst->src[0].type)) {
glsl_to_tgsi_instruction *dinst = NULL;
int initial_src_swz[4], initial_src_idx[4];
int initial_dst_idx[2], initial_dst_writemask[2];
/* modify the destination if we are splitting */
for (j = 0; j < 2; j++) {
- if (dst_is_double[j]) {
+ if (dst_is_64bit[j]) {
dinst->dst[j].writemask = (i & 1) ? WRITEMASK_ZW : WRITEMASK_XY;
dinst->dst[j].index = initial_dst_idx[j];
if (i > 1) {
for (j = 0; j < 4; j++) {
int swz = GET_SWZ(initial_src_swz[j], i);
- if (dinst->src[j].type == GLSL_TYPE_DOUBLE) {
+ if (glsl_base_type_is_64bit(dinst->src[j].type)) {
dinst->src[j].index = initial_src_idx[j];
if (swz > 1) {
dinst->src[j].double_reg2 = true;
- F2D is a float src0, DLDEXP is integer src1 */
if (op == TGSI_OPCODE_F2D ||
op == TGSI_OPCODE_DLDEXP ||
- (op == TGSI_OPCODE_UCMP && dst_is_double[0])) {
+ (op == TGSI_OPCODE_UCMP && dst_is_64bit[0])) {
dinst->src[j].swizzle = MAKE_SWIZZLE4(swz, swz, swz, swz);
}
}
}
cbuf.swizzle = swizzle_for_size(ir->type->vector_elements);
- if (cbuf.type == GLSL_TYPE_DOUBLE)
+ if (glsl_base_type_is_64bit(cbuf.type))
cbuf.swizzle += MAKE_SWIZZLE4(const_offset % 16 / 8,
const_offset % 16 / 8,
const_offset % 16 / 8,
assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
if (ir->lhs->type->is_array() || ir->lhs->type->without_array()->is_matrix()) {
- if (ir->lhs->type->without_array()->is_double()) {
+ if (ir->lhs->type->without_array()->is_64bit()) {
switch (ir->lhs->type->without_array()->vector_elements) {
case 1:
l.writemask = WRITEMASK_X;
l.writemask = WRITEMASK_XYZW;
}
} else if (ir->lhs->type->is_scalar() &&
- !ir->lhs->type->is_double() &&
+ !ir->lhs->type->is_64bit() &&
ir->lhs->variable_referenced()->data.mode == ir_var_shader_out) {
/* FINISHME: This hack makes writing to gl_FragDepth, which lives in the
* FINISHME: W component of fragment shader output zero, work correctly.
delete inst;
removed++;
} else {
- if (inst->dst[0].type == GLSL_TYPE_DOUBLE) {
+ if (glsl_base_type_is_64bit(inst->dst[0].type)) {
if (inst->dead_mask == WRITEMASK_XY ||
inst->dead_mask == WRITEMASK_ZW)
inst->dst[0].writemask &= ~(inst->dead_mask);