glsl: Address Rodrigo's feedback
This commit is contained in:
parent
85399e119d
commit
4759db28d0
13 changed files with 87 additions and 75 deletions
|
@ -13,8 +13,13 @@ namespace {
|
|||
constexpr std::string_view SWIZZLE{"xyzw"};
|
||||
void CompositeInsert(EmitContext& ctx, std::string_view result, std::string_view composite,
|
||||
std::string_view object, u32 index) {
|
||||
ctx.Add("{}={};", result, composite);
|
||||
ctx.Add("{}.{}={};", result, SWIZZLE[index], object);
|
||||
if (result == composite) {
|
||||
// The result is aliased with the composite
|
||||
ctx.Add("{}.{}={};", composite, SWIZZLE[index], object);
|
||||
} else {
|
||||
ctx.Add("{}={};", result, composite);
|
||||
ctx.Add("{}.{}={};", result, SWIZZLE[index], object);
|
||||
}
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue