- fixed survey data retrieval for Vulkan.

This commit is contained in:
Christoph Oelckers 2019-08-11 21:16:09 +02:00
parent 6cc9434788
commit 5e4de10f97
6 changed files with 24 additions and 6 deletions

View file

@ -257,11 +257,10 @@ static int GetCoreInfo()
}
#endif
EXTERN_CVAR(Int, vid_enablevulkan)
static int GetRenderInfo()
{
if (vid_enablevulkan == 1) return 4;
if (screen->Backend() == 1) return 4;
auto info = gl_getInfo();
if (!info.second)
{
@ -273,6 +272,7 @@ static int GetRenderInfo()
static int GetGLVersion()
{
if (screen->Backend() == 1) return 50;
auto info = gl_getInfo();
return int(info.first * 10);
}
@ -302,7 +302,7 @@ void D_DoAnonStats()
static char requeststring[1024];
mysnprintf(requeststring, sizeof requeststring, "GET /stats_201903.py?render=%i&cores=%i&os=%i&glversion=%i&vendor=%s&model=%s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\nUser-Agent: %s %s\r\n\r\n",
GetRenderInfo(), GetCoreInfo(), GetOSVersion(), GetGLVersion(), URLencode(gl.vendorstring).GetChars(), URLencode(gl.modelstring).GetChars(), sys_statshost.GetHumanString(), GAMENAME, VERSIONSTR);
GetRenderInfo(), GetCoreInfo(), GetOSVersion(), GetGLVersion(), URLencode(screen->vendorstring).GetChars(), URLencode(screen->DeviceName()).GetChars(), sys_statshost.GetHumanString(), GAMENAME, VERSIONSTR);
DPrintf(DMSG_NOTIFY, "Sending %s", requeststring);
#ifndef _DEBUG
// Don't send info in debug builds

View file

@ -237,6 +237,11 @@ uint32_t OpenGLFrameBuffer::GetCaps()
return (uint32_t)FlagSet;
}
const char* OpenGLFrameBuffer::DeviceName() const
{
return gl.modelstring;
}
//==========================================================================
//
// Swap the buffers

View file

@ -27,6 +27,7 @@ public:
void CleanForRestart() override;
void UpdatePalette() override;
uint32_t GetCaps() override;
const char* DeviceName() const override;
void WriteSavePic(player_t *player, FileWriter *file, int width, int height) override;
sector_t *RenderView(player_t *player) override;
void SetTextureFilterMode() override;

View file

@ -475,6 +475,8 @@ public:
// Report a game restart
void SetClearColor(int color);
virtual uint32_t GetCaps();
virtual int Backend() { return 0; }
virtual const char* DeviceName() const { return "Unknown"; }
virtual void WriteSavePic(player_t *player, FileWriter *file, int width, int height);
virtual sector_t *RenderView(player_t *player) { return nullptr; }

View file

@ -131,10 +131,11 @@ void VulkanFrameBuffer::InitializeState()
first = false;
}
// Use the same names here as OpenGL returns.
switch (device->PhysicalDevice.Properties.vendorID)
{
case 0x1002: vendorstring = "AMD"; break;
case 0x10DE: vendorstring = "NVIDIA"; break;
case 0x1002: vendorstring = "ATI Technologies Inc."; break;
case 0x10DE: vendorstring = "NVIDIA Corporation"; break;
case 0x8086: vendorstring = "Intel"; break;
default: vendorstring = "Unknown"; break;
}
@ -623,6 +624,13 @@ uint32_t VulkanFrameBuffer::GetCaps()
return (uint32_t)FlagSet;
}
const char* VulkanFrameBuffer::DeviceName() const
{
const auto &props = device->PhysicalDevice.Properties;
return props.deviceName;
}
void VulkanFrameBuffer::SetVSync(bool vsync)
{
// This is handled in VulkanSwapChain::AcquireImage.
@ -924,7 +932,7 @@ unsigned int VulkanFrameBuffer::GetLightBufferBlockSize() const
void VulkanFrameBuffer::PrintStartupLog()
{
const auto props = device->PhysicalDevice.Properties;
const auto &props = device->PhysicalDevice.Properties;
FString deviceType;
switch (props.deviceType)

View file

@ -76,6 +76,8 @@ public:
void PrecacheMaterial(FMaterial *mat, int translation) override;
void UpdatePalette() override;
uint32_t GetCaps() override;
const char* DeviceName() const override;
int Backend() override { return 1; }
void WriteSavePic(player_t *player, FileWriter *file, int width, int height) override;
sector_t *RenderView(player_t *player) override;
void SetTextureFilterMode() override;