gsdx debug: static GSState::s_n

This way you can access the current draw call anywhere. Very useful for debug.
This commit is contained in:
Gregory Hainaut 2016-10-04 19:23:27 +02:00
parent 61333ecb40
commit 677f890c5c
5 changed files with 9 additions and 9 deletions

View File

@ -20,6 +20,7 @@
*/
#include "stdafx.h"
#include "GSState.h"
#include "GSDeviceOGL.h"
#include "GLState.h"
#include "GSUtil.h"
@ -45,7 +46,6 @@ static const uint32 g_ps_cb_index = 21;
static const uint32 g_gs_cb_index = 22;
bool GSDeviceOGL::m_debug_gl_call = false;
int GSDeviceOGL::s_n = 0;
int GSDeviceOGL::m_shader_inst = 0;
int GSDeviceOGL::m_shader_reg = 0;
FILE* GSDeviceOGL::m_debug_gl_file = NULL;
@ -898,7 +898,7 @@ void GSDeviceOGL::InitPrimDateTexture(GSTexture* rt, const GSVector4i& area)
void GSDeviceOGL::RecycleDateTexture()
{
if (m_date.t) {
//static_cast<GSTextureOGL*>(m_date.t)->Save(format("/tmp/date_adv_%04ld.csv", s_n));
//static_cast<GSTextureOGL*>(m_date.t)->Save(format("/tmp/date_adv_%04ld.csv", GSState::s_n));
Recycle(m_date.t);
m_date.t = NULL;
@ -1890,11 +1890,11 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
#ifdef _DEBUG
// Don't spam noisy information on the terminal
if (gl_severity != GL_DEBUG_SEVERITY_NOTIFICATION) {
fprintf(stderr,"T:%s\tID:%d\tS:%s\t=> %s\n", type.c_str(), s_n, severity.c_str(), message.c_str());
fprintf(stderr,"T:%s\tID:%d\tS:%s\t=> %s\n", type.c_str(), GSState::s_n, severity.c_str(), message.c_str());
}
#else
// Print nouveau shader compiler info
if (s_n == 0) {
if (GSState::s_n == 0) {
int t, local, gpr, inst, byte;
int status = sscanf(message.c_str(), "type: %d, local: %d, gpr: %d, inst: %d, bytes: %d",
&t, &local, &gpr, &inst, &byte);
@ -1907,7 +1907,7 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
#endif
if (m_debug_gl_file)
fprintf(m_debug_gl_file,"T:%s\tID:%d\tS:%s\t=> %s\n", type.c_str(), s_n, severity.c_str(), message.c_str());
fprintf(m_debug_gl_file,"T:%s\tID:%d\tS:%s\t=> %s\n", type.c_str(), GSState::s_n, severity.c_str(), message.c_str());
#ifdef _DEBUG
if (sev_counter >= 5) {

View File

@ -395,7 +395,6 @@ public:
static const int m_NO_BLEND;
static const int m_MERGE_BLEND;
static int s_n;
static int m_shader_inst;
static int m_shader_reg;

View File

@ -1098,7 +1098,6 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
ASSERT(m_dev != NULL);
GSDeviceOGL* dev = (GSDeviceOGL*)m_dev;
dev->s_n = s_n;
// HLE implementation of the channel selection effect
//

View File

@ -27,6 +27,8 @@ extern int g_crc_hack_level;
//#define Offset_ST // Fixes Persona3 mini map alignment which is off even in software rendering
int GSState::s_n = 0;
GSState::GSState()
: m_version(6)
, m_mt(false)
@ -49,7 +51,7 @@ GSState::GSState()
m_userhacks_skipdraw = theApp.GetConfigB("UserHacks") ? theApp.GetConfigI("UserHacks_SkipDraw") : 0;
m_userhacks_auto_flush = theApp.GetConfigB("UserHacks") ? theApp.GetConfigB("UserHacks_AutoFlush") : 0;
s_n = 0;
s_n = 0;
s_dump = theApp.GetConfigB("dump");
s_save = theApp.GetConfigB("save");
s_savet = theApp.GetConfigB("savet");

View File

@ -224,7 +224,7 @@ public:
bool m_nativeres;
bool m_mipmap;
int s_n;
static int s_n;
bool s_dump;
bool s_save;
bool s_savet;