Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More file extension associations for GLSL shaders #5358

Open
farnoy opened this issue May 6, 2021 · 4 comments · Fixed by #5566
Open

More file extension associations for GLSL shaders #5358

farnoy opened this issue May 6, 2021 · 4 comments · Fixed by #5566

Comments

@farnoy
Copy link

farnoy commented May 6, 2021

The GLSL config is missing some file extensions for new shader stages.

https://github.com/github/linguist/blob/8011321f1394b5c3fc1f8ef242775af640df8f7d/lib/linguist/languages.yml#L1801-L1806

The up to date list of stages is as follows:

    .vert   for a vertex shader
    .tesc   for a tessellation control shader
    .tese   for a tessellation evaluation shader
    .geom   for a geometry shader
    .frag   for a fragment shader
    .comp   for a compute shader
    .mesh   for a mesh shader
    .task   for a task shader
    .rgen    for a ray generation shader
    .rint    for a ray intersection shader
    .rahit   for a ray any hit shader
    .rchit   for a ray closest hit shader
    .rmiss   for a ray miss shader
    .rcall   for a ray callable shader
@Nixinova
Copy link
Contributor

Nixinova commented May 7, 2021

Usage of each of those not already added:

@lildude
Copy link
Member

lildude commented Oct 20, 2021

.rchit and .rmiss have now been added as part of #5566 . Usage for the others proposed in that PR weren't sufficient for inclusion.

@lildude lildude linked a pull request Oct 20, 2021 that will close this issue
4 tasks
@alexd2580
Copy link

I second adding .comp as an extension.
While it is rather generic, it is the official extension name for GLSL compute shaders https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
The majority of .comp files on GH (14K vs 8K) can be confidently called GLSL because of their use of long specific GLSL keywords like gl_GlobalInvocationID, push_constant:
https://github.com/search?q=path%3A*.comp+%28gl_GlobalInvocationID+OR+gl_LocalInvocationID+OR+gl_NumWorkGroups+OR+gl_WorkGroupSize+OR+local_size_x+OR+push_constant+OR+GL_GOOGLE_include_directive+OR+glsl%29&type=code
The above query has a lot of false negatives, which is fine, given the current state.

@lildude
Copy link
Member

lildude commented Jun 7, 2023

@alexd2580 feel free to submit a PR to add support as a generic extension. This will require an accurate heuristic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants