Cocoa Port: Tune up the DeSmuME runtime information in the troubleshooting forms.

- Add line for the Video Output Engine. Backend type (OpenGL or Metal), version, and renderer information are all reported.
- Remove section breaking dashes, as this causes GitHub's comment parser to reformat the runtime info in unpredictable ways.
- To compensate for removing the section breaking dashes, add delimiters for the beginning and the ending of the runtime information.
- If the Active Cheat Count is 0, then just report "NO" for Cheats, as this is functionally equivalent, but less confusing to read.
This commit is contained in:
rogerman 2022-04-07 13:29:30 -07:00
parent 2efb260b44
commit 6833e3159d
6 changed files with 85 additions and 8 deletions

View File

@ -3937,7 +3937,7 @@ enum OGLVertexAttributeID
static const GLint filterVtxBuffer[8] = {-1, -1, 1, -1, -1, 1, 1, 1};
void GetGLVersionOGL(GLint *outMajor, GLint *outMinor, GLint *outRevision)
static void GetGLVersionOGL(GLint *outMajor, GLint *outMinor, GLint *outRevision)
{
const char *oglVersionString = (const char *)glGetString(GL_VERSION);
if (oglVersionString == NULL)
@ -4076,6 +4076,11 @@ void DeleteHQnxLUTs_OGL(GLenum textureIndex, GLuint &texLQ2xLUT, GLuint &texHQ2x
OGLContextInfo::OGLContextInfo()
{
GetGLVersionOGL(&_versionMajor, &_versionMinor, &_versionRevision);
const char *oglRendererString = (const char *)glGetString(GL_RENDERER);
memset(_rendererString, 0, sizeof(_rendererString));
strlcpy(_rendererString, oglRendererString, sizeof(_rendererString) - 1);
_shaderSupport = ShaderSupport_Unsupported;
_useShader150 = false;
@ -4090,6 +4095,26 @@ ShaderSupportTier OGLContextInfo::GetShaderSupport()
return this->_shaderSupport;
}
int OGLContextInfo::GetVersionMajor() const
{
return (int)this->_versionMajor;
}
int OGLContextInfo::GetVersionMinor() const
{
return (int)this->_versionMinor;
}
int OGLContextInfo::GetVersionRevision() const
{
return (int)this->_versionRevision;
}
const char* OGLContextInfo::GetRendererString() const
{
return this->_rendererString;
}
bool OGLContextInfo::IsUsingShader150()
{
return this->_useShader150;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2014-2018 DeSmuME team
Copyright (C) 2014-2022 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -65,6 +65,7 @@ protected:
GLint _versionMajor;
GLint _versionMinor;
GLint _versionRevision;
char _rendererString[256];
ShaderSupportTier _shaderSupport;
bool _useShader150;
@ -76,6 +77,11 @@ protected:
public:
OGLContextInfo();
virtual ~OGLContextInfo() {};
int GetVersionMajor() const;
int GetVersionMinor() const;
int GetVersionRevision() const;
const char* GetRendererString() const;
bool IsUsingShader150();
bool IsVBOSupported();

View File

@ -86,6 +86,9 @@ typedef DisplayViewShaderProperties DisplayViewShaderProperties;
@interface MetalDisplayViewSharedData : MacClientSharedObject
{
id<MTLDevice> device;
NSString *name;
NSString *description;
id<MTLCommandQueue> _fetchCommandQueue;
id<MTLCommandQueue> commandQueue;
id<MTLLibrary> defaultLibrary;
@ -139,6 +142,9 @@ typedef DisplayViewShaderProperties DisplayViewShaderProperties;
}
@property (readonly, nonatomic) id<MTLDevice> device;
@property (readonly, nonatomic) NSString *name;
@property (readonly, nonatomic) NSString *description;
@property (readonly, nonatomic) id<MTLCommandQueue> commandQueue;
@property (readonly, nonatomic) id<MTLLibrary> defaultLibrary;

View File

@ -27,6 +27,8 @@
@implementation MetalDisplayViewSharedData
@synthesize device;
@synthesize name;
@synthesize description;
@synthesize commandQueue;
@synthesize defaultLibrary;
@ -68,6 +70,33 @@
[device retain];
NSString *tempVersionStr = @"Metal - Unknown GPU Family";
const BOOL isRWTexSupported = [device supportsFeatureSet:10002]; // MTLFeatureSet_macOS_ReadWriteTextureTier2
if ([device supportsFeatureSet:10005]) // MTLFeatureSet_macOS_GPUFamily2_v1
{
tempVersionStr = @"macOS Metal GPUFamily2_v1";
}
else if ([device supportsFeatureSet:10004]) // MTLFeatureSet_macOS_GPUFamily1_v4
{
tempVersionStr = (isRWTexSupported) ? @"macOS Metal GPUFamily1_v4 w/ Tier2 R/W Textures" : @"macOS Metal GPUFamily1_v4";
}
else if ([device supportsFeatureSet:10003]) // MTLFeatureSet_macOS_GPUFamily1_v3
{
tempVersionStr = (isRWTexSupported) ? @"macOS Metal GPUFamily1_v3 w/ Tier2 R/W Textures" : @"macOS Metal GPUFamily1_v3";
}
else if ([device supportsFeatureSet:10001]) // MTLFeatureSet_macOS_GPUFamily1_v2
{
tempVersionStr = (isRWTexSupported) ? @"macOS Metal GPUFamily1_v2 w/ Tier2 R/W Textures" : @"macOS Metal GPUFamily1_v2";
}
else if ([device supportsFeatureSet:MTLFeatureSet_macOS_GPUFamily1_v1])
{
tempVersionStr = (isRWTexSupported) ? @"macOS Metal GPUFamily1_v1 w/ Tier2 R/W Textures" : @"macOS Metal GPUFamily1_v1";
}
name = [[NSString alloc] initWithString:tempVersionStr];
description = [[NSString alloc] initWithString:[device name]];
commandQueue = [device newCommandQueue];
[commandQueue setLabel:@"CQ_DeSmuME_VideoBlitter"];
@ -325,6 +354,9 @@
[samplerHUDBox release];
[samplerHUDText release];
[name release];
[description release];
[super dealloc];
}
@ -2424,6 +2456,8 @@ MacMetalFetchObject::MacMetalFetchObject()
}
_clientData = [[MetalDisplayViewSharedData alloc] init];
strlcpy(_name, [[(MetalDisplayViewSharedData *)_clientData name] cStringUsingEncoding:NSUTF8StringEncoding], sizeof(_name) - 1);
strlcpy(_description, [[(MetalDisplayViewSharedData *)_clientData description] cStringUsingEncoding:NSUTF8StringEncoding], sizeof(_description) - 1);
}
MacMetalFetchObject::~MacMetalFetchObject()

View File

@ -156,6 +156,9 @@ MacOGLClientFetchObject::MacOGLClientFetchObject()
CGLSetCurrentContext(prevContext);
snprintf(_name, sizeof(_name) - 1, "macOS OpenGL v%i.%i.%i", _contextInfo->GetVersionMajor(), _contextInfo->GetVersionMinor(), _contextInfo->GetVersionRevision());
strlcpy(_description, _contextInfo->GetRendererString(), sizeof(_description) - 1);
_clientData = [[MacClientSharedObject alloc] init];
_unfairlockTexFetch[NDSDisplayID_Main] = apple_unfairlock_create();

View File

@ -95,13 +95,13 @@
romSerialStr = unspecifiedStr;
}
NSString *finalFormTextStr = @"App Version: ";
finalFormTextStr = [finalFormTextStr stringByAppendingString:appVersionStr];
NSString *finalFormTextStr = @"[ BEGIN DESMUME RUNTIME INFORMATION ]\n";
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nApp Version: "] stringByAppendingString:appVersionStr];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nOperating System: "] stringByAppendingString:[CocoaDSUtil operatingSystemString]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nModel Identifier: "] stringByAppendingString:[CocoaDSUtil modelIdentifierString]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nROM Name: "] stringByAppendingString:romNameStr];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nROM Serial: "] stringByAppendingString:romSerialStr];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n-----------------------------------"];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n"];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nEmulation Speed: "] stringByAppendingString:([cdsCore isSpeedLimitEnabled] ? [NSString stringWithFormat:@"%1.2fx", [emuControl lastSetSpeedScalar]] : @"Unlimited")];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nAuto Frame Skip: "] stringByAppendingString:([cdsCore isFrameSkipEnabled] ? @"YES" : @"NO")];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nSLOT-1 Device Type: "] stringByAppendingString:[cdsCore slot1DeviceTypeString]];
@ -147,13 +147,14 @@
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\n3D Renderer - Texture Scaling Factor: "] stringByAppendingString:[NSString stringWithFormat:@"%ldx", (unsigned long)[[cdsCore cdsGPU] render3DTextureScalingFactor]]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\n3D Renderer - Edge Marking: "] stringByAppendingString:([[cdsCore cdsGPU] render3DEdgeMarking] ? @"YES" : @"NO")];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\n3D Renderer - Fog: "] stringByAppendingString:([[cdsCore cdsGPU] render3DFog] ? @"YES" : @"NO")];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nVideo - Output Engine: "] stringByAppendingString:[NSString stringWithFormat:@"%s (%s)", [[cdsCore cdsGPU] fetchObject]->GetName(), [[cdsCore cdsGPU] fetchObject]->GetDescription()]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nAudio - Output Engine: "] stringByAppendingString:[[emuControl cdsSpeaker] audioOutputEngineString]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nAudio - Advanced SPU Logic: "] stringByAppendingString:([[emuControl cdsSpeaker] spuAdvancedLogic] ? @"YES" : @"NO")];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nAudio - Sound Interpolation Method: "] stringByAppendingString:[[emuControl cdsSpeaker] spuInterpolationModeString]];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nAudio - Sound Synchronization Method: "] stringByAppendingString:[[emuControl cdsSpeaker] spuSyncMethodString]];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n-----------------------------------"];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nCheats: "] stringByAppendingString:([cdsCore isCheatingEnabled] ? [NSString stringWithFormat:@"YES (ActiveCheatCount=%ld)", (unsigned long)[[emuControl cdsCheats] activeCount]] : @"NO")];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n-----------------------------------"];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n"];
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nCheats: "] stringByAppendingString:(([cdsCore isCheatingEnabled] && ([[emuControl cdsCheats] activeCount] > 0)) ? [NSString stringWithFormat:@"YES (ActiveCheatCount=%ld)", (unsigned long)[[emuControl cdsCheats] activeCount]] : @"NO")];
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n"];
if ([window contentView] == viewSupportRequest)
{
@ -187,6 +188,8 @@
[bindings setValue:NSSTRING_TITLE_GO_BUG_REPORT_WEBPAGE_TITLE forKey:@"goWebpageButtonTitle"];
}
finalFormTextStr = [finalFormTextStr stringByAppendingString:@"\n\n[ END DESMUME RUNTIME INFORMATION ]"];
[bindings setValue:finalFormTextStr forKey:@"finalFormText"];
// Remember the current form and switch the window view.