Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Platform.glFoo in headless #1834

Open
sprunk opened this issue Dec 18, 2024 · 3 comments
Open

Check Platform.glFoo in headless #1834

sprunk opened this issue Dec 18, 2024 · 3 comments
Labels
area: Lua API bug Something isn't working

Comments

@sprunk
Copy link
Collaborator

sprunk commented Dec 18, 2024

Platform.glHaveGLSL is defined to true, this is incorrect since headless doesn't actually have GLSL:

LuaPushNamedBool(L, "glHaveGLSL", true);

The task is to figure out which entries are incorrect this way, and fix them. I assume that in headless, all the glHaveFoo and glSupportFoo should be false, availableVideoModes should probably be empty, and numDisplays should probably be 0. Double-check this.

Stuff like glVersion probably stays as-is. Perhaps there could be a Platform.isHeadless or Engine.isHeadless as well?

@sprunk sprunk added bug Something isn't working area: Lua API labels Dec 18, 2024
@saurtron
Copy link
Collaborator

saurtron commented Dec 21, 2024

from github runner:

probably could do glHaveGLSL = glslVersionNum > 0, marked with <--- all the suspicious ones.

can tell its headless easily but all in all ppl probably shouldn't be checking for headless, but for min gl version or similar. still, we could compile isHeadless so ppl can check directly if they need instead of using awkward tests like glslVersionNum == 0, gpuMemorySize == 0 or string.find(glewVesion, "headless").

{
	"availableVideoModes": [],
	"cpuLogicalCores": 4,
	"cpuPhysicalCores": 2,
	"glHaveAMD": false,
	"glHaveGL4": false,
	"glHaveGLSL": true, <---
	"glHaveNVidia": false,
	"glRenderer": "",
	"glSupportClipSpaceControl": false,
	"glSupportDepthBufferBitDepth": 16,
	"glSupportFragDepthLayout": false,
	"glSupportMSAAFrameBuffer": false,
	"glSupportNonPowerOfTwoTex": true, <---
	"glSupportRestartPrimitive": false,
	"glSupportSeamlessCubeMaps": false,
	"glSupportTextureQueryLOD": true, <---
	"glVendor": "",
	"glVersion": "",
	"glVersionShort": "",
	"glewVesion": "spring headless stub GLEW version",
	"glslVersion": "",
	"glslVersionNum": 0,
	"glslVersionShort": "",
	"gpu": "Unknown",
	"gpuMemorySize": 0,
	"gpuVendor": "Unknown",
	"hwConfig": "AMD EPYC 7763 64-Core Processor; 15990MB RAM",
	"macAddrHash": "673757966",
	"numDisplays": 0,
	"osFamily": "Linux",
	"osName": "Linux 6.8.0-1017-azure",
	"osVersion": "#20-Ubuntu SMP Tue Oct 22 03:43:13 UTC 2024 (x86_64)",
	"sdlVersionCompiledMajor": 2,
	"sdlVersionCompiledMinor": 0,
	"sdlVersionCompiledPatch": 8,
	"sdlVersionLinkedMajor": 0,
	"sdlVersionLinkedMinor": 0,
	"sdlVersionLinkedPatch": 0
}

@sprunk
Copy link
Collaborator Author

sprunk commented Dec 21, 2024

Good find, though github runner may well in fact have 0 displays (and no general graphical support). Perhaps worth running on a "normal" machine as well.

@saurtron
Copy link
Collaborator

from a real computer basically the same thing:

{
	"availableVideoModes": [],
	"cpuLogicalCores": 8,
	"cpuPhysicalCores": 4,
	"glHaveAMD": false,
	"glHaveGL4": false,
	"glHaveGLSL": true,
	"glHaveNVidia": false,
	"glRenderer": "",
	"glSupportClipSpaceControl": false,
	"glSupportDepthBufferBitDepth": 16,
	"glSupportFragDepthLayout": false,
	"glSupportMSAAFrameBuffer": false,
	"glSupportNonPowerOfTwoTex": true,
	"glSupportRestartPrimitive": false,
	"glSupportSeamlessCubeMaps": false,
	"glSupportTextureQueryLOD": true,
	"glVendor": "",
	"glVersion": "",
	"glVersionShort": "",
	"glewVersion": "spring headless stub GLEW version",
	"glslVersion": "",
	"glslVersionNum": 0,
	"glslVersionShort": "",
	"gpu": "Unknown",
	"gpuMemorySize": 0,
	"gpuVendor": "Unknown",
	"numDisplays": 0,
	"osFamily": "Linux",
	"sdlVersionCompiledMajor": 2,
	"sdlVersionCompiledMinor": 0,
	"sdlVersionCompiledPatch": 8,
	"sdlVersionLinkedMajor": 0,
	"sdlVersionLinkedMinor": 0,
	"sdlVersionLinkedPatch": 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Lua API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants