dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.asin.mediump_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan.highp_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan.mediump_vec2_fragment,Fail
-dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan2.highp_vec2_fragment,Fail
-dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan2.mediump_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.1,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.5,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.6,Fail
#include "radeon_compiler.h"
#include "radeon_dataflow.h"
+#include "r300_fragprog_swizzle.h"
/**
*/
unsigned int rc_swizzle_to_writemask(unsigned int swz)
rc_register_file File;
int Index;
unsigned int SrcType;
+ unsigned int Swizzle;
};
struct can_use_presub_data {
struct can_use_presub_data * data,
rc_register_file file,
unsigned int index,
- unsigned int src_type)
+ unsigned int swizzle)
{
struct src_select * select;
select = &data->Selects[data->SelectCount++];
select->File = file;
select->Index = index;
- select->SrcType = src_type;
+ select->SrcType = rc_source_type_swz(swizzle);
+ select->Swizzle = swizzle;
}
/**
return;
can_use_presub_data_add_select(d, src->File, src->Index,
- rc_source_type_swz(src->Swizzle));
+ src->Swizzle);
}
unsigned int rc_inst_can_use_presub(
+ struct radeon_compiler * c,
struct rc_instruction * inst,
rc_presubtract_op presub_op,
unsigned int presub_writemask,
can_use_presub_data_add_select(&d,
presub_src0->File,
presub_src0->Index,
- src_type0);
+ presub_src0->Swizzle);
if (num_presub_srcs > 1) {
src_type1 = rc_source_type_swz(presub_src1->Swizzle);
can_use_presub_data_add_select(&d,
presub_src1->File,
presub_src1->Index,
- src_type1);
+ presub_src1->Swizzle);
/* Even if both of the presub sources read from the same
* register, we still need to use 2 different source selects
unsigned int j;
unsigned int src_type = d.Selects[i].SrcType;
for (j = i + 1; j < d.SelectCount; j++) {
+ /* Even if the sources are the same now, they will not be the
+ * same later, if we have to rewrite some non-native swizzle. */
+ if(!c->is_r500 && (
+ !r300_swizzle_is_native_basic(d.Selects[i].Swizzle) ||
+ !r300_swizzle_is_native_basic(d.Selects[j].Swizzle)))
+ continue;
if (d.Selects[i].File == d.Selects[j].File
&& d.Selects[i].Index == d.Selects[j].Index) {
src_type &= ~d.Selects[j].SrcType;
unsigned int rc_source_type_mask(unsigned int mask);
unsigned int rc_inst_can_use_presub(
+ struct radeon_compiler * c,
struct rc_instruction * inst,
rc_presubtract_op presub_op,
unsigned int presub_writemask,
rc_pair_read_arg_fn read_pair_cb,
rc_read_write_mask_fn write_cb)
{
+ reader_data->C = c;
reader_data->Abort = 0;
reader_data->ReaderCount = 0;
reader_data->ReadersReserved = 0;
};
struct rc_reader_data {
+ struct radeon_compiler * C;
+
unsigned int Abort;
unsigned int AbortOnRead;
unsigned int AbortOnWrite;
rc_register_file file = src->File;
struct rc_reader_data * reader_data = data;
- if(!rc_inst_can_use_presub(inst,
+ if(!rc_inst_can_use_presub(reader_data->C,
+ inst,
reader_data->Writer->U.I.PreSub.Opcode,
rc_swizzle_to_writemask(src->Swizzle),
src,
struct rc_reader_data * reader_data = data;
rc_presubtract_op * presub_opcode = reader_data->CbData;
- if (!rc_inst_can_use_presub(inst, *presub_opcode,
+ if (!rc_inst_can_use_presub(reader_data->C,
+ inst,
+ *presub_opcode,
reader_data->Writer->U.I.DstReg.WriteMask,
src,
&reader_data->Writer->U.I.SrcReg[0],
struct rc_instruction add_inst, replace_inst;
int ret;
+ struct r300_fragment_program_compiler c = {};
+ init_compiler(&c.Base, RC_FRAGMENT_PROGRAM, 0, 0);
+
test_begin(result);
init_rc_normal_instruction(&add_inst, add_str);
init_rc_normal_instruction(&replace_inst, replace_str);
- ret = rc_inst_can_use_presub(&replace_inst, RC_PRESUB_ADD, 0,
+ ret = rc_inst_can_use_presub(&c.Base, &replace_inst, RC_PRESUB_ADD, 0,
&replace_inst.U.I.SrcReg[0],
&add_inst.U.I.SrcReg[0], &add_inst.U.I.SrcReg[1]);