[D3D12] Don't add .xyzw swizzle to stores
This commit is contained in:
parent
2b482352d0
commit
1ae30e5775
|
@ -742,16 +742,21 @@ void HlslShaderTranslator::EmitStoreResult(const InstructionResult& result,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool has_const_writes = false;
|
bool has_const_writes = false;
|
||||||
uint32_t component_write_count = 0;
|
uint32_t component_write_count;
|
||||||
EmitSource(".");
|
if (result.is_standard_swizzle()) {
|
||||||
for (uint32_t i = 0; i < 4; ++i) {
|
component_write_count = 4;
|
||||||
if (result.write_mask[i]) {
|
} else {
|
||||||
if (result.components[i] == SwizzleSource::k0 ||
|
component_write_count = 0;
|
||||||
result.components[i] == SwizzleSource::k1) {
|
EmitSource(".");
|
||||||
has_const_writes = true;
|
for (uint32_t i = 0; i < 4; ++i) {
|
||||||
|
if (result.write_mask[i]) {
|
||||||
|
if (result.components[i] == SwizzleSource::k0 ||
|
||||||
|
result.components[i] == SwizzleSource::k1) {
|
||||||
|
has_const_writes = true;
|
||||||
|
}
|
||||||
|
++component_write_count;
|
||||||
|
EmitSource("%c", GetCharForSwizzle(GetSwizzleFromComponentIndex(i)));
|
||||||
}
|
}
|
||||||
++component_write_count;
|
|
||||||
EmitSource("%c", GetCharForSwizzle(GetSwizzleFromComponentIndex(i)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EmitSource(" = ");
|
EmitSource(" = ");
|
||||||
|
@ -802,10 +807,13 @@ void HlslShaderTranslator::EmitStoreResult(const InstructionResult& result,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EmitSource("xe_pv.");
|
EmitSource("xe_pv");
|
||||||
for (uint32_t i = 0; i < 4; ++i) {
|
if (!result.is_standard_swizzle()) {
|
||||||
if (result.write_mask[i]) {
|
EmitSource(".");
|
||||||
EmitSource("%c", GetCharForSwizzle(result.components[i]));
|
for (uint32_t i = 0; i < 4; ++i) {
|
||||||
|
if (result.write_mask[i]) {
|
||||||
|
EmitSource("%c", GetCharForSwizzle(result.components[i]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue