Page MenuHomeWildfire Games

Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original name. Also restore the Wrapper name to reflect what it's wrapping and move it to renderer
Needs ReviewPublic

Authored by Stan on Sun, Sep 29, 7:00 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

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"

Test Plan

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

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/872/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/356/display/redirect

Stan updated this revision to Diff 10015.Sun, Sep 29, 7:10 PM

Try to fix the diff

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/873/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/357/display/redirect

Stan updated this revision to Diff 10016.Sun, Sep 29, 7:41 PM

Remove all changes and just run svn diff -x -U5000 > file.diff

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/874/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/358/display/redirect

Stan updated this revision to Diff 10026.Mon, Sep 30, 3:23 PM

Now in git format from a git repo ladies and gentlemen.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/364/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/ps/tests/test_Preprocessor.h
|   1| /*·Copyright·(C)·2016·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2016"

source/ps/tests/test_Preprocessor.h
|  22| class·TestPreprocessor·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestPreprocessor:' is invalid C code. Use --std or --language to configure the language.

source/ps/PreprocessorWrapper.h
|   1| /*·Copyright·(C)·2012·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2012"

source/ps/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/880/display/redirect

Stan updated this revision to Diff 10028.Mon, Sep 30, 3:36 PM

Update headers.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/366/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/ps/tests/test_Preprocessor.h
|  22| class·TestPreprocessor·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestPreprocessor:' is invalid C code. Use --std or --language to configure the language.

source/ps/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/882/display/redirect

elexis edited the summary of this revision. (Show Details)Tue, Oct 1, 3:17 PM
elexis added a subscriber: elexis.Tue, Oct 1, 3:28 PM

This diff was created following some build warning report, discussed in rP9121.

I had uploaded P180 which shows the differences between that file now and the one committed to Pyrogenesis.

Given that the file is duplicate in essence and literally to a large degree, and since we might not intend to modify the code soon,
it seems right to me to move it over.
If we were to modify it further than error loggin, we would probably write custom code.

Notice that we might still want to modify the code slightly.

For /libraries/source/ there is the original source + patches, for source/third_party/` there isn't, the files are present with patches applied, which seems a bit messy, but the current paradigm.

build/premake/premake5.lua
748

I suppose this would be a nice addition that it is excluded from the projects that don't need it, and that this is more transparent that there is this one-file dependency.

It sounds a bit scary, like including the entire library. Perhaps it could be renamed to third_party/ogre3d_preprocessor until further content was added.

source/ps/Preprocessor.cpp
39

Probably necessary change:

I suppose third party libs should not depend on Pyrogenesis code.
So this pyrogenesis specific addition should be superseded somehow.

It appears like one could overwrite the error reporter in a Pyrogenesis file, see L242

CPreprocessor::ErrorHandlerFunc CPreprocessor::ErrorHandler = DefaultError;

Stan updated this revision to Diff 10032.Tue, Oct 1, 4:24 PM
Stan edited the test plan for this revision. (Show Details)

We must note that the error callback was removed in https://github.com/OGRECave/ogre/commit/856c276ebd4cb7100f4b133b0e5b29cbc8558653

Vulcan added a comment.Tue, Oct 1, 4:25 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/884/display/redirect

Stan marked an inline comment as done.Tue, Oct 1, 4:25 PM
Stan added inline comments.
build/premake/premake5.lua
748

I can recheck but I believe I added it in those two places because they were the only one requiring it.

Vulcan added a comment.Tue, Oct 1, 4:26 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/368/display/redirect

Stan updated this revision to Diff 10034.Tue, Oct 1, 4:44 PM
  • ogre3d → ogre3d_preprocessor.
  • Try to fix build.
Vulcan added a comment.Tue, Oct 1, 4:47 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/886/display/redirect

Vulcan added a comment.Tue, Oct 1, 4:48 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/370/display/redirect

Stan updated this revision to Diff 10035.Tue, Oct 1, 4:56 PM
Stan marked an inline comment as done.
Vulcan added a comment.Tue, Oct 1, 4:57 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/371/display/redirect

Vulcan added a comment.Tue, Oct 1, 4:57 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/887/display/redirect

Stan updated this revision to Diff 10048.Wed, Oct 2, 10:50 AM
Stan retitled this revision from Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original name. to Move Ogre3D GLSL Preprocessor to a third_party folder and restore its original name. Also restore the Wrapper name to reflect what it's wrapping and move it to renderer.
Stan edited the test plan for this revision. (Show Details)

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/379/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/ps/tests/test_Preprocessor.h
|  22| class·TestPreprocessor·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestPreprocessor:' is invalid C code. Use --std or --language to configure the language.

source/renderer/OgreGLSLPreprocessorWrapper.cpp
|   1| /*·Copyright·(C)·2012·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2015" year instead of "2012"

source/renderer/OgreGLSLPreprocessorWrapper.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2013" year instead of "2019"

source/renderer/OgreGLSLPreprocessorWrapper.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/895/display/redirect

Stan updated this revision to Diff 10049.Wed, Oct 2, 11:14 AM
Stan added a subscriber: vladislavbelov.

Update copyright. @vladislavbelov I think the license bear does strange things.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/380/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/renderer/OgreGLSLPreprocessorWrapper.cpp
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2015" year instead of "2019"

source/ps/tests/test_Preprocessor.h
|  22| class·TestPreprocessor·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestPreprocessor:' is invalid C code. Use --std or --language to configure the language.

source/renderer/OgreGLSLPreprocessorWrapper.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2013" year instead of "2019"

source/renderer/OgreGLSLPreprocessorWrapper.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/896/display/redirect

Stan updated this revision to Diff 10105.Tue, Oct 8, 11:43 AM
  • Replace std::string by CStr8 (We need the length because the code casts Token to const char)
  • Move * pointer to the left
  • Move everything to graphics
  • Move tests next to the new code

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/423/display/redirect

Stan added a comment.Tue, Oct 8, 11:47 AM

Diff with original version

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/938/display/redirect

Stan updated this revision to Diff 10106.Tue, Oct 8, 12:10 PM

Try to fix tests

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/424/display/redirect

Stan updated this revision to Diff 10107.Tue, Oct 8, 12:20 PM
  • Add setup function
  • use std::string and c_str()

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/939/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/425/display/redirect

Stan updated this revision to Diff 10108.Tue, Oct 8, 12:28 PM

Move declaration to constructor

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/426/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/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

Stan updated this revision to Diff 10111.Tue, Oct 8, 1:47 PM

Rename Wrapper to fit the classes in that folder.

Vulcan added a comment.Tue, Oct 8, 1:49 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/427/display/redirect

Vulcan added a comment.Tue, Oct 8, 1:51 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/942/display/redirect

Stan updated this revision to Diff 10113.Tue, Oct 8, 1:56 PM

Include fix.

Vulcan added a comment.Tue, Oct 8, 1:58 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/428/display/redirect

Stan updated this revision to Diff 10114.Tue, Oct 8, 2:05 PM

Fix ifndef now that the file got back its name.

Vulcan added a comment.Tue, Oct 8, 2:05 PM

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

Vulcan added a comment.Tue, Oct 8, 2:07 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/429/display/redirect

Vulcan added a comment.Tue, Oct 8, 2:14 PM

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