Statically check whether we are using the fields from the right GL version.
Open
GAPIL
P3
triaged
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
GLES 2.0 commands should not be using GLES 3.0 constants (unless added by extension).
The validator should be able to verify this is true.
I am thinking about something like this:
`
@if(Version.GLES20 || Version.EXT_draw_buffers)
GLint MaxDrawBuffers
@if(Version.GLES20)
cmd Foo() {
_ := ctx.Constants.MaxDrawBuffers // ok
}
@if(Version.GLES30)
cmd Bar() {
_ := ctx.Constants.MaxDrawBuffers // error
}
`
Think of the @if as #if blocks - would the code compile with #define GLES20 1 and #define GLES30 0?
Similarly, we should hide fields in the client if the @if says they are not applicable to the current version.
Contributor guide
Assessment
This issue has not been assessed yet.