diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index adafeddb15b..0b37a37b631 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -1402,6 +1402,26 @@ void gfx6_math(struct brw_codegen *p, (src1.type == BRW_TYPE_HF && devinfo->ver >= 9)); } + /* This workaround says that we cannot use scalar broadcast with HF types. + * However, for is_scalar values, all 16 elements contain the same value, so + * we can replace a <0,1,0> region with <16,16,1> without ill effect. + */ + if (intel_needs_workaround(devinfo, 22016140776)) { + if (src0.is_scalar && src0.type == BRW_TYPE_HF) { + src0.vstride = BRW_VERTICAL_STRIDE_16; + src0.width = BRW_WIDTH_16; + src0.hstride = BRW_HORIZONTAL_STRIDE_1; + src0.swizzle = BRW_SWIZZLE_XYZW; + } + + if (src1.is_scalar && src1.type == BRW_TYPE_HF) { + src1.vstride = BRW_VERTICAL_STRIDE_16; + src1.width = BRW_WIDTH_16; + src1.hstride = BRW_HORIZONTAL_STRIDE_1; + src1.swizzle = BRW_SWIZZLE_XYZW; + } + } + brw_inst_set_math_function(devinfo, insn, function); brw_set_dest(p, insn, dest); diff --git a/src/intel/compiler/brw_fs_validate.cpp b/src/intel/compiler/brw_fs_validate.cpp index 7c579caba3e..c9a4a9c7595 100644 --- a/src/intel/compiler/brw_fs_validate.cpp +++ b/src/intel/compiler/brw_fs_validate.cpp @@ -418,7 +418,8 @@ brw_fs_validate(const fs_visitor &s) * potential problems sooner rather than later. */ for (unsigned i = 0; i < inst->sources; i++) { - fsv_assert(!is_uniform(inst->src[i]) || + fsv_assert(inst->src[i].is_scalar || + !is_uniform(inst->src[i]) || inst->src[i].type != BRW_TYPE_HF); } }