early-access version 1885
This commit is contained in:
@@ -13,12 +13,10 @@ namespace Shader::Backend::GLSL {
|
||||
namespace {
|
||||
void Compare(EmitContext& ctx, IR::Inst& inst, std::string_view lhs, std::string_view rhs,
|
||||
std::string_view op, bool ordered) {
|
||||
ctx.AddU1("{}={}{}{}", inst, lhs, op, rhs, lhs, rhs);
|
||||
if (ordered) {
|
||||
ctx.Add("&&!isnan({})&&!isnan({});", lhs, rhs);
|
||||
} else {
|
||||
ctx.Add("||isnan({})||isnan({});", lhs, rhs);
|
||||
}
|
||||
const auto nan_op{ordered ? "&&!" : "||"};
|
||||
ctx.AddU1("{}={}{}{}"
|
||||
"{}isnan({}){}isnan({});",
|
||||
inst, lhs, op, rhs, nan_op, lhs, nan_op, rhs);
|
||||
}
|
||||
|
||||
bool IsPrecise(const IR::Inst& inst) {
|
||||
|
@@ -300,7 +300,7 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) {
|
||||
const std::optional<AttrInfo> type{AttrTypes(ctx, index)};
|
||||
if (!type) {
|
||||
// Attribute is disabled
|
||||
return ctx.Const(0.0f);
|
||||
return ctx.Const(element == 3 ? 1.0f : 0.0f);
|
||||
}
|
||||
if (!ctx.runtime_info.previous_stage_stores.Generic(index, element)) {
|
||||
// Varying component is not written
|
||||
|
Reference in New Issue
Block a user