graphicsfuzz
graphicsfuzz copied to clipboard
generator: reference and donor GLSL versions should match
At the moment, donors are found from a directory of GLSL shader jobs. Only the .frag files are considered, yet code will be injected into compute shaders, sometimes making them invalid. Similarly, version 100 code might be injected into 300 es code, making the produced shader invalid. The GLSL version of the donors is similar to version 100, but there is no explicit version. We would like to enforce that the donors and references have the same GLSL version. With this, there should be no need for any conversion, but some things might fail. E.g. previously, injecting code that contains _GLF_COLOR
could not happen (there would only be gl_FragColor), but now it will happen. Maybe that will work fine, maybe it will need fixing.
We want the following:
- The donors directory can contain shader jobs with a mixture of compute, vertex, and fragment shaders.
- All input references and donors must have the same GLSL version; if they don't, an error will occur when the generator tries to parse the donor (i.e. don't parse all donors at the start just to check them!)
- Donors of the correct type (fragment, vertex, or compute) will be chosen based on the current shader type that is being mutated.
- [ ] Make the generator fail if the version of the donor being parsed does not match the version of the target shader.
- [ ] Make it so shaders of the correct type (fragment, vertex, or compute) are chosen based on the type of the target shader. ...