emit_glasm: Enable ARB_draw_buffers when needed

This commit is contained in:
ReinUsesLisp 2021-05-16 17:52:30 -03:00 committed by ameerj
parent 3c06293e20
commit db2f0f4108
2 changed files with 5 additions and 1 deletions

View file

@ -283,6 +283,10 @@ void SetupOptions(std::string& header, Info info) {
if (info.uses_subgroup_shuffles) {
header += "OPTION NV_shader_thread_shuffle;";
}
const auto non_zero_frag_colors{info.stores_frag_color | std::views::drop(1)};
if (std::ranges::find(non_zero_frag_colors, true) != non_zero_frag_colors.end()) {
header += "OPTION ARB_draw_buffers;";
}
}
std::string_view StageHeader(Stage stage) {