Following the discussion on rP9121:
Currently we use (kinda outdated) files from the ogre engine to parse our GLSL code.
It would be nice to put them in a third party folder so they can be upgraded later.
This patch does step 1 "moving" and the next one will do the "update part"
Details
- Reviewers
elexis Silier - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP23215: Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original…
Check that the game still builds and nothing is broken.
Agree the file needs to be moved.
Test that shader errors are still reported
Test that shaders still work
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- master
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 10215 Build 17344: Vulcan Build Jenkins Build 17343: Vulcan Build (Windows) Jenkins Build 17342: arc lint + arc unit
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/OgreGLSLPreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/OgreGLSLPreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. source/graphics/OgreGLSLPreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/940/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/OgreGLSLPreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/OgreGLSLPreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. source/graphics/OgreGLSLPreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/941/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/427/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/942/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/428/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/PreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/PreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. source/graphics/PreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/943/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/429/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/PreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/PreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. source/graphics/PreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/944/display/redirect
@Angen thoughts on this patch? All it does is move code to third party.
@linkmauve in case you want to look at the GLSL preprocessor code
For the record I chatted on the Ogre Gitter, and they are still making some fixes to it + the ones we currently have because we are a lot versions behind...
@StanleySweet then you might be interested in this: https://github.com/OGRECave/ogre/issues/614
source/third_party/ogre3d_preprocessor/OgreGLSLPreprocessor.cpp | ||
---|---|---|
236 | LOGERROR is missing :) |
source/third_party/ogre3d_preprocessor/OgreGLSLPreprocessor.cpp | ||
---|---|---|
234 | static cast iTokenLen? |
Tests are passing.
Shader errors are reported.
From what I have seen shaders do work as without patch.
If it is third party file it should be in that folder.
source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.h | ||
---|---|---|
1 | here |
I can't tell from that if you have read the patch too or only blackbox tested it.
If it is third party file it should be in that folder.
Does accepting mean trusting the author or verifying that the patch is correct?
There have been different models proposed for the review system.
In one model the patch is verified (i.e. somehow attempted to be proven to be correct and complete), in another model it's only black box testing (apply the patch and then accept if there are no errors while running the game briefly).
If the latter is the chosen model, then one cannot identify whether the idea of the patch is correct or whether the patch should be changed it works only at face value but has a coneptual issues.
If the objective of the review system is to improve code quality over just one author testing that his patch works at face value, nothing is gained while more people pay with more time.
Noting how the correctness of the implementation has been examined when accepting a patch allows:
- determining which aspects of a patch had been examined
- locating possible oversights
- eases bugtracking and revisiting of the code later on (even for the author and reviewers later on as well as one loses memory of minor code decisions after a while).
For example for this patch:
- Are the premake and logger change correct and complete?
- Are the changes to OgreGLSLPreprocessor.cpp complete to achieve the purpose of the diff to this file?
- I couldn't follow the many iterations. Is the latest name choice the best of the name choices iterated?
Reason of this diff is to move Preprocessor file to third party files, what is completed and moving a file does not break its functionality.
This patch does step 1 "moving" and the next one will do the "update part"
File was included in rP9121 using header file OgreGLSLPreprocessor.h . In fact, file itself has name OgreGLSLPreprocessor.cpp in https://github.com/OGRECave/ogre so naming is adequate.
I suppose that removing dependency from pyrogenesis was done based on
I suppose third party libs should not depend on Pyrogenesis code.
what makes sense, so functionality from logger was almost restored because there is missing line as I pointed out on IRC
09:10 < Angen> https://code.wildfiregames.com/rP9121
09:10 < Angen> you are still missing this line
09:10 < Angen> LogManager::getSingleton ().logMessage (line);
But since that would require to add another file OgreLogManager.h and default logger is replaced in PreprocessorWrapper.cpp with custom one
CPreprocessor::ErrorHandler = CPreprocessorWrapper::PyrogenesisShaderError;
it would be wasted include.
Custom logger is basically copy-paste from one replaced with previous code, so again moving same logic somewhere else what means functionality is not changed as long as correct version of logger is assigned what is done.
There have been some other tweaks to OgreGLSLPreprocessor.cpp like removing namespace, using debug_assert or style changes.
Also there have been replaced debug_assert -> ENSURE.
But main objective is to move that file to third party folder and update it in next step.
One thing I now noticed is that "third_party/ogre3d_preprocessor" should be preferably included in "graphics" project rather than in "atlas" as it should be included somewhere to get cpp part build.
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1196/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/680/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1197/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/681/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1198/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/682/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1199/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/683/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1208/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/692/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1209/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/693/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1210/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/694/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1215/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/699/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/700/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/PreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" source/graphics/PreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/PreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1216/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/701/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/graphics/PreprocessorWrapper.cpp | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2015" year instead of "2019" source/graphics/PreprocessorWrapper.h | 1| /*·Copyright·(C)·2019·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2013" year instead of "2019" source/graphics/PreprocessorWrapper.h | 29| class·CPreprocessorWrapper | | [MAJOR] CPPCheckBear (syntaxError): | | Code 'classCPreprocessorWrapper{' is invalid C code. Use --std or --language to configure the language. Executing section JS... Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1217/display/redirect