GLSL icon indicating copy to clipboard operation
GLSL copied to clipboard

Convert from tables to sections for builtins.

Open dj2 opened this issue 1 year ago • 3 comments

This Cl changes the builtin functions to use titles sections and code blocks instead of tables. This spaces things out a bit more and fixes issues where there was wrapping in the function declarations due to the size of the table columns.

Note, this depends on https://github.com/KhronosGroup/GLSL/pull/254 to have access to the GLSL syntax highlighting.

For an example:

Before

Screenshot 2024-09-13 at 21 57 24

After

Screenshot 2024-09-13 at 21 56 32

dj2 avatar Sep 14 '24 02:09 dj2

This PR is not yet complete, it's an example of what could be done, if the direction seems appropriate I'll update the rest of the builtin function tables to a similar format.

dj2 avatar Sep 14 '24 02:09 dj2

@gnl21 any thoughts on if this is worth persuing? I'm partial to the non-table layout, but that may just be me. I'm happy to update the rest of the current tables to a similar layout, but don't want to sink the effort if it's a dead end in general.

dj2 avatar Oct 11 '24 23:10 dj2

Looking at this, I think making a change like this will probably make these sections nicer. The current tables are a bit of a mess and, though we could fix some of that, some is caused by trying to fit the functions into half the page, which would be solved by doing something like this. The syntax highlighting and having individual numbers/anchors to refer to the individual functions are also benefits and it solves the problem of having to put LaTeX math outside the tables in sections of its own. I think the main downside is making the chapter much longer, so a bit more difficult to scan through.

The numbering of these sections is different in GLSL/ESSL because of ftransform that doesn't exist in ESSL (or core profile, in fact). Maybe it would be preferable to keep any empty sections like that but not that the functions don't exist so that the numbering and any references from things like extension specs is consistent?

gnl21 avatar Oct 14 '24 15:10 gnl21

I'm still working through all the builtins (there are a lot of them), so this will take a bit of time before everything is changed over. I'm leaving the numbering as is for now, I'd prefer to do that change to have empty sections as a followup given that this is already going to be a large PR.

dj2 avatar Oct 27 '24 03:10 dj2

I've got all the functions converted at this point. I have to do a read through and compare the new tables to the existing generated GLSL and ESSL specs to verify I didn't mess anything up removing and reformatting things.

dj2 avatar Dec 10 '24 04:12 dj2

K, I think this is ready for review. I didn't add any empty sections to normalize section numbers between GLSL and ESSL at this point, I think that can be done as a followup if we decide to go that route.

@gnl21 can you please give this a review?

dj2 avatar Apr 18 '25 17:04 dj2

ping

dj2 avatar May 01 '25 17:05 dj2

ping

dj2 avatar May 28 '25 18:05 dj2

Awesome, applied all of the suggestions (and thanks for the careful review, those things are really hard to spot)

dj2 avatar Jun 03 '25 17:06 dj2