Skip to content
Permalink
Browse files

- fixed survey data retrieval for Vulkan.

  • Loading branch information...
coelckers committed Aug 11, 2019
1 parent 6cc9434 commit 5e4de10f9708d11265cdda8f7c6def3d392c5f14
@@ -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
@@ -237,6 +237,11 @@ uint32_t OpenGLFrameBuffer::GetCaps()
return (uint32_t)FlagSet;
}

const char* OpenGLFrameBuffer::DeviceName() const
{
return gl.modelstring;
}

//==========================================================================
//
// Swap the buffers
@@ -27,6 +27,7 @@ class OpenGLFrameBuffer : public SystemGLFrameBuffer
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;
@@ -475,6 +475,8 @@ class DFrameBuffer
// 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; }

@@ -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)
@@ -76,6 +76,8 @@ class VulkanFrameBuffer : public SystemBaseFrameBuffer
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;

0 comments on commit 5e4de10

Please sign in to comment.
You can’t perform that action at this time.