Page MenuHomeWildfire Games

Refactor HWDetect and rendering options fully
Needs ReviewPublic

Authored by wraitii on May 28 2019, 11:50 AM.

Details

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

By adding a new configuration level with priority higher than CFG_USER, we can refactor HWDetect and our loading of rendering options entirely, making it much easier to add new rendering options.

Test Plan

Look at the code and agree this is nicer, compile, test in-game.

Event Timeline

wraitii created this revision.May 28 2019, 11:50 AM
Owners added a subscriber: Restricted Owners Package.May 28 2019, 11:50 AM

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1527/display/redirect

fabio added a subscriber: fabio.Mon, Sep 2, 12:56 PM

Reference to S3TC may as well mostly removed altogether, just quit with an error if not detected. See https://trac.wildfiregames.com/ticket/4803

wraitii updated this revision to Diff 9607.Mon, Sep 2, 9:32 PM

Merge shadows change from old D1930 and remove s3TC stuff. It seems like the S3TC code remaining in lib/tex.cpp could also be removed now, but I need to check and also this sounds more involved.

Vulcan added a comment.Mon, Sep 2, 9:38 PM

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

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

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

Linter detected issues:
Executing section Source...

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

source/ps/VideoMode.h
|  23| class·CVideoMode
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCVideoMode{' is invalid C code. Use --std or --language to configure the language.

source/ps/VideoMode.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
| 335| 335| 
| 336| 336| global.RunHardwareDetection = function(settings)
| 337| 337| {
| 338|    |-	//print(JSON.stringify(settings, null, 1)+"\n");
|    | 338|+	// print(JSON.stringify(settings, null, 1)+"\n");
| 339| 339| 
| 340| 340| 	var output = RunDetection(settings);
| 341| 341| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
| 339| 339| 
| 340| 340| 	var output = RunDetection(settings);
| 341| 341| 
| 342|    |-	//print(JSON.stringify(output, null, 1)+"\n");
|    | 342|+	// print(JSON.stringify(output, null, 1)+"\n");
| 343| 343| 
| 344| 344| 	for (var i = 0; i < output.warnings.length; ++i)
| 345| 345| 		warn(output.warnings[i]);

binaries/data/mods/mod/hwdetect/hwdetect.js
| 179| »   var·disable_audio·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_audio' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 180| »   var·disable_s3tc·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_s3tc' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 181| »   var·disable_shadows·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_shadows' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 182| »   var·disable_shadowpcf·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_shadowpcf' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 183| »   var·disable_allwater·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_allwater' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 184| »   var·disable_fancywater·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_fancywater' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 185| »   var·enable_glsl·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_glsl' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 186| »   var·enable_postproc·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_postproc' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 187| »   var·enable_smoothlos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_smoothlos' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 188| »   var·override_renderpath·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'override_renderpath' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 179| »   var·disable_audio·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_audio' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 180| »   var·disable_s3tc·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_s3tc' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 181| »   var·disable_shadows·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_shadows' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 182| »   var·disable_shadowpcf·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_shadowpcf' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 183| »   var·disable_allwater·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_allwater' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 184| »   var·disable_fancywater·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_fancywater' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 185| »   var·enable_glsl·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_glsl' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 186| »   var·enable_postproc·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_postproc' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 187| »   var·enable_smoothlos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_smoothlos' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 188| »   var·override_renderpath·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'override_renderpath' to 'undefined'.
Executing section cli...

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

Stan added a subscriber: Stan.Mon, Sep 2, 10:42 PM
Stan added inline comments.
binaries/data/mods/mod/hwdetect/hwdetect.js
355–356

Should be removed if you nuke the option, shouldn't it.

source/ps/GameSetup/Config.h
40

Oversight ? Else the option must go too.

elexis added a subscriber: elexis.Wed, Sep 4, 3:28 AM

There is #5538, I was wondering whether thats the same, related, or unrelated, but I didn't get to investigate.

In D1931#93796, @elexis wrote:

There is #5538, I was wondering whether thats the same, related, or unrelated, but I didn't get to investigate.

Combined with D1930, this actually overwrites user.cfg settings too, just not command-line. As it stands, it overwrites defaults, but not user, so it is indeed #5538. The question is 'should it be easy for a user to set a setting that we detected it can't use?'

I'm guessing we could enforce in the UI that you can't set these settings, so then we would rarely have new users with incompatible user.cfg, but the option would be there. Alternatively, command line options.

wraitii updated this revision to Diff 9660.Sat, Sep 7, 5:49 PM

Add a new HWDETECT configuration level, above user but below Command, and use that for hwdetect.

wraitii edited the summary of this revision. (Show Details)
Vulcan added a comment.Sat, Sep 7, 5:52 PM

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

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

Vulcan added a comment.Sat, Sep 7, 6:04 PM

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

Linter detected issues:
Executing section Source...

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

source/ps/VideoMode.h
|  23| class·CVideoMode
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCVideoMode{' is invalid C code. Use --std or --language to configure the language.

source/ps/ConfigDB.h
|  54| class·CConfigDB·:·public·Singleton<CConfigDB>
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCConfigDB:' is invalid C code. Use --std or --language to configure the language.

source/ps/VideoMode.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
| 335| 335| 
| 336| 336| global.RunHardwareDetection = function(settings)
| 337| 337| {
| 338|    |-	//print(JSON.stringify(settings, null, 1)+"\n");
|    | 338|+	// print(JSON.stringify(settings, null, 1)+"\n");
| 339| 339| 
| 340| 340| 	var output = RunDetection(settings);
| 341| 341| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
|    |++++| /zpool0/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
| 339| 339| 
| 340| 340| 	var output = RunDetection(settings);
| 341| 341| 
| 342|    |-	//print(JSON.stringify(output, null, 1)+"\n");
|    | 342|+	// print(JSON.stringify(output, null, 1)+"\n");
| 343| 343| 
| 344| 344| 	for (var i = 0; i < output.warnings.length; ++i)
| 345| 345| 		warn(output.warnings[i]);

binaries/data/mods/mod/hwdetect/hwdetect.js
| 179| »   var·disable_audio·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_audio' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 180| »   var·disable_s3tc·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_s3tc' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 181| »   var·disable_shadows·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_shadows' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 182| »   var·disable_shadowpcf·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_shadowpcf' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 183| »   var·disable_allwater·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_allwater' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 184| »   var·disable_fancywater·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'disable_fancywater' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 185| »   var·enable_glsl·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_glsl' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 186| »   var·enable_postproc·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_postproc' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 187| »   var·enable_smoothlos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'enable_smoothlos' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 188| »   var·override_renderpath·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'override_renderpath' to undefined.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 179| »   var·disable_audio·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_audio' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 180| »   var·disable_s3tc·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_s3tc' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 181| »   var·disable_shadows·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_shadows' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 182| »   var·disable_shadowpcf·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_shadowpcf' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 183| »   var·disable_allwater·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_allwater' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 184| »   var·disable_fancywater·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'disable_fancywater' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 185| »   var·enable_glsl·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_glsl' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 186| »   var·enable_postproc·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_postproc' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 187| »   var·enable_smoothlos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'enable_smoothlos' to 'undefined'.

binaries/data/mods/mod/hwdetect/hwdetect.js
| 188| »   var·override_renderpath·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'override_renderpath' to 'undefined'.
Executing section cli...

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