Skip to content

Commit 10df7bc

Browse files
authored
Merge pull request DeusData#2761 from tmonestudio/feat/glsl-stage-mapping
feat(language): map GLSL compute, geometry and tessellation stages
2 parents a74d528 + b5eacb1 commit 10df7bc

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/discover/language.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ static const ext_entry_t EXT_TABLE[] = {
135135
{".F95", CBM_LANG_FORTRAN},
136136

137137
/* GLSL */
138+
{".comp", CBM_LANG_GLSL},
138139
{".frag", CBM_LANG_GLSL},
140+
{".geom", CBM_LANG_GLSL},
139141
{".glsl", CBM_LANG_GLSL},
142+
{".tesc", CBM_LANG_GLSL},
143+
{".tese", CBM_LANG_GLSL},
140144
{".vert", CBM_LANG_GLSL},
141145

142146
/* Go */

‎tests/test_language.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,15 @@ TEST(lang_ext_vert) {
500500
ASSERT_EQ(cbm_language_for_extension(".vert"), CBM_LANG_GLSL);
501501
PASS();
502502
}
503+
/* Compute, geometry and tessellation stages are GLSL too (glslang naming). */
504+
TEST(lang_ext_glsl_other_stages) {
505+
ASSERT_EQ(cbm_language_for_extension(".comp"), CBM_LANG_GLSL);
506+
ASSERT_EQ(cbm_language_for_extension(".geom"), CBM_LANG_GLSL);
507+
ASSERT_EQ(cbm_language_for_extension(".tesc"), CBM_LANG_GLSL);
508+
ASSERT_EQ(cbm_language_for_extension(".tese"), CBM_LANG_GLSL);
509+
PASS();
510+
}
511+
503512
TEST(lang_ext_frag) {
504513
ASSERT_EQ(cbm_language_for_extension(".frag"), CBM_LANG_GLSL);
505514
PASS();
@@ -1654,6 +1663,7 @@ SUITE(language) {
16541663
RUN_TEST(lang_ext_glsl);
16551664
RUN_TEST(lang_ext_vert);
16561665
RUN_TEST(lang_ext_frag);
1666+
RUN_TEST(lang_ext_glsl_other_stages);
16571667
RUN_TEST(lang_ext_ini);
16581668
RUN_TEST(lang_ext_cfg);
16591669
RUN_TEST(lang_ext_conf);

0 commit comments

Comments
 (0)