-
Notifications
You must be signed in to change notification settings - Fork 6k
Add glad library for glfw. #12265
Add glad library for glfw. #12265
Conversation
Merge pull request from flutter/engine
|
@stuartmorgan Please review the dependency patch for #9822 |
|
@cloudwebrtc are the C headers/sources here being copied from another repo? If so, the way we add third-party dependencies is via an entry in the DEPS file in the engine that clones this to |
|
I believe these are generated, rather than something we could pull with DEPS. But in that case we need a readme in the folder that clearly explains where it came from, how it's generated, how to update it, etc. |
|
@cbracken @stuartmorgan The I think there are two options here: 1, If we don't want a duplicate file in flutter/engine, we can modify I looked at the new version of 2, Copy the I personally prefer the first one, create a |
As I explained before, I don't this this is a good idea. From what I can see
This doesn't seem conceptually much different from the above, although at least it makes the dependencies explicit.
If that's the authoritative source, then we should do that. I thought that's what I had suggested before, and assumed is what this patch was.
It's not clear to me why this is a goal.
Assuming that the version generated for use in a GLFW example app stays compatible with our needs. |
|
It seems that https://gen.glad.sh is the authoritative source, I found it in the glfw official source file and has a link with parameters. In the case where the gl version number is fixed, the generated file does not seem to change. |
|
@stuartmorgan I created a README.md, please review. |
third_party/glad/README.md
Outdated
| The `GLAD` library is used for the texture of glfw, which is used to create textures to render RGBA data. | ||
|
|
||
| # Notice | ||
| The current `glad` source is a copy from `fuchsia/third_party/glfw/deps` and the first version is copied from https://fuchsia.googlesource.com/third_party/glfw/+/999f3556fdd80983b10051746264489f2cb1ef16/deps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not comfortable with checking in a file that we don't apparently understand how to create from the authoritative source, and thus don't know how to update ourselves if we needed to update it.
The version of this file on master contains the exact details of constructing it from the source, which seems far better. I'm not clear on why we can't do the same thing here instead of relying on this older copy of unclear origin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I have always thought that the glad version must be with glfw. After I tested that the glad file from http://glad.sh can still work fine, I proved that I was wrong, glfw and glad are working independently. So, you said that generating glad from an authoritative source is correct. I am working on the engine's texture rendering test and will update the PR later.
|
@stuartmorgan PR updated, please review. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more questions but this looks structurally like what we want now.
Also I think you need to merge in the current master to resolve the CI errors.
|
@stuartmorgan All done, please review again. |
|
@stuartmorgan Updated, please review again. |
| Var('dart_git') + '/when.git' + '@' + '0.2.0', | ||
|
|
||
| 'src/flutter/third_party/glad/scripts': | ||
| Var('github_git') + '/Dav1dde/glad.git' + '@' + 'de6c39e3040c987323b8ed078c36442f4fb681b3', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbracken Do we want a mirror of this? It seems like we have other direct GitHub dependencies, but I'm not sure if there's a policy for when that's allowed.
|
I changed it to run |
|
I can do a full re-review later, but from a quick look:
This part is still missing. The |
I don’t know much about how the action works, you mean scripts/glad/files/gl.xml as inputs to the action? |
|
An action runs when any of its inputs are newer than the outputs. For incremental build to work reliably you need to list every file that, were it to change, should cause the script to run again. As a said above, that is all of the python files used by the script, as well as any data files. |
|
I need to use all the following files as inputs to the action. Is this correct? This is a list of files for the https://github.com/Dav1dde/glad/tree/master/glad repository. |
|
You need to list every file that affects the output of the script. Whether or not that's every file in the repository I don't know; you'll need to look at the details of the script. |
|
Thanks, I can try to do it. |
|
@cloudwebrtc any luck with the new approach? |
|
@cbracken Sorry for the late update, @stuartmorgan I have added the relevant files to inputs and tested them. Modifying any .py file can trigger |
|
@stuartmorgan Please review again. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The license script is still unhappy about the new files in the Flutter part of the tree that have different licenses. @cbracken @Hixie is the right approach here to point DEPS to the buildroot's third-party (as we usually do for DEPS) and put our added wrapper script somewhere not in third_party like build?
|
Adding @cbracken as a reviewer for the question above. |
|
Closing per #9822 (comment). We can revisit if we end up needing GLFW texture support. |
#9822 Depends on this patch.