google / google/gapid

Statically check whether we are using the fields from the right GL version.

Open
#1,318 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.