aurora: Move lighting func to SRC_REG only

This commit is contained in:
Luke Street 2022-03-09 00:44:52 -05:00
parent 5097a700f5
commit 3a4308e173
1 changed files with 15 additions and 15 deletions

View File

@ -541,6 +541,19 @@ var<storage, read> v_packed_uvs: Vec2Block;
info.uniformSize += 32;
vtxOutAttrs += fmt::format(FMT_STRING("\n @location({}) cc{}: vec4<f32>;"), locIdx++, i);
if (config.channelMatSrcs[i] == GX::SRC_VTX) {
if (config.denormalizedVertexAttributes) {
if (!info.usesVtxColor) {
vtxInAttrs += fmt::format(FMT_STRING("\n , @location({}) in_clr: vec4<f32>"), locIdx);
vtxXfrAttrs += fmt::format(FMT_STRING("\n out.cc{} = in_clr;"), i);
}
fragmentFnPre += fmt::format(FMT_STRING("\n var rast{0} = in.cc{0};"), i);
} else {
Log.report(logvisor::Fatal, FMT_STRING("SRC_VTX unsupported with normalized vertex attributes"));
}
info.usesVtxColor = true;
} else {
// TODO only perform lighting on CC0 when enabled
vtxXfrAttrs += fmt::format(FMT_STRING(R"""(
{{
@ -563,19 +576,6 @@ var<storage, read> v_packed_uvs: Vec2Block;
}}
out.cc{0} = clamp(lighting, vec4<f32>(0.0), vec4<f32>(1.0));
}})"""), i, MaxLights);
if (config.channelMatSrcs[i] == GX::SRC_VTX) {
if (config.denormalizedVertexAttributes) {
if (!info.usesVtxColor) {
vtxInAttrs += fmt::format(FMT_STRING("\n , @location({}) in_clr: vec4<f32>"), locIdx);
vtxXfrAttrs += fmt::format(FMT_STRING("\n out.cc{} = in_clr;"), i);
}
fragmentFnPre += fmt::format(FMT_STRING("\n var rast{0} = in.cc{0};"), i);
} else {
Log.report(logvisor::Fatal, FMT_STRING("SRC_VTX unsupported with normalized vertex attributes"));
}
info.usesVtxColor = true;
} else {
fragmentFnPre += fmt::format(FMT_STRING("\n var rast{0} = in.cc{0};"), i);
}
}