inst->saturate = instr->dest.saturate;
break;
- case nir_op_fsin: {
- fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_F);
- inst = bld.emit(SHADER_OPCODE_SIN, tmp, op[0]);
- if (instr->dest.saturate) {
- inst->dst = result;
- inst->saturate = true;
- } else {
- bld.MUL(result, tmp, brw_imm_f(0.99997));
- }
+ case nir_op_fsin:
+ inst = bld.emit(SHADER_OPCODE_SIN, result, op[0]);
+ inst->saturate = instr->dest.saturate;
break;
- }
- case nir_op_fcos: {
- fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_F);
- inst = bld.emit(SHADER_OPCODE_COS, tmp, op[0]);
- if (instr->dest.saturate) {
- inst->dst = result;
- inst->saturate = true;
- } else {
- bld.MUL(result, tmp, brw_imm_f(0.99997));
- }
+ case nir_op_fcos:
+ inst = bld.emit(SHADER_OPCODE_COS, result, op[0]);
+ inst->saturate = instr->dest.saturate;
break;
- }
case nir_op_fddx:
if (fs_key->high_quality_derivatives) {
* When we XOR the sources, the top bit is 0 if they are the same and 1
* if they are different. We can then use a conditional modifier to
* turn that into a predicate. This leads us to an XOR.l instruction.
+ *
+ * Technically, according to the PRM, you're not allowed to use .l on a
+ * XOR instruction. However, emperical experiments and Curro's reading
+ * of the simulator source both indicate that it's safe.
*/
fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_D);
inst = bld.XOR(tmp, op[0], op[1]);
fs_reg coordinate, shadow_comparitor, lod, lod2, sample_index, mcs, tex_offset;
- /* Our hardware requires a LOD for buffer textures */
+ /* The hardware requires a LOD for buffer textures */
if (instr->sampler_dim == GLSL_SAMPLER_DIM_BUF)
lod = brw_imm_d(0);