mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
61333ecb40
commit
677f890c5c
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "GSState.h"
|
||||||
#include "GSDeviceOGL.h"
|
#include "GSDeviceOGL.h"
|
||||||
#include "GLState.h"
|
#include "GLState.h"
|
||||||
#include "GSUtil.h"
|
#include "GSUtil.h"
|
||||||
|
@ -45,7 +46,6 @@ static const uint32 g_ps_cb_index = 21;
|
||||||
static const uint32 g_gs_cb_index = 22;
|
static const uint32 g_gs_cb_index = 22;
|
||||||
|
|
||||||
bool GSDeviceOGL::m_debug_gl_call = false;
|
bool GSDeviceOGL::m_debug_gl_call = false;
|
||||||
int GSDeviceOGL::s_n = 0;
|
|
||||||
int GSDeviceOGL::m_shader_inst = 0;
|
int GSDeviceOGL::m_shader_inst = 0;
|
||||||
int GSDeviceOGL::m_shader_reg = 0;
|
int GSDeviceOGL::m_shader_reg = 0;
|
||||||
FILE* GSDeviceOGL::m_debug_gl_file = NULL;
|
FILE* GSDeviceOGL::m_debug_gl_file = NULL;
|
||||||
|
@ -898,7 +898,7 @@ void GSDeviceOGL::InitPrimDateTexture(GSTexture* rt, const GSVector4i& area)
|
||||||
void GSDeviceOGL::RecycleDateTexture()
|
void GSDeviceOGL::RecycleDateTexture()
|
||||||
{
|
{
|
||||||
if (m_date.t) {
|
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);
|
Recycle(m_date.t);
|
||||||
m_date.t = NULL;
|
m_date.t = NULL;
|
||||||
|
@ -1890,11 +1890,11 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// Don't spam noisy information on the terminal
|
// Don't spam noisy information on the terminal
|
||||||
if (gl_severity != GL_DEBUG_SEVERITY_NOTIFICATION) {
|
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
|
#else
|
||||||
// Print nouveau shader compiler info
|
// Print nouveau shader compiler info
|
||||||
if (s_n == 0) {
|
if (GSState::s_n == 0) {
|
||||||
int t, local, gpr, inst, byte;
|
int t, local, gpr, inst, byte;
|
||||||
int status = sscanf(message.c_str(), "type: %d, local: %d, gpr: %d, inst: %d, bytes: %d",
|
int status = sscanf(message.c_str(), "type: %d, local: %d, gpr: %d, inst: %d, bytes: %d",
|
||||||
&t, &local, &gpr, &inst, &byte);
|
&t, &local, &gpr, &inst, &byte);
|
||||||
|
@ -1907,7 +1907,7 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_debug_gl_file)
|
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
|
#ifdef _DEBUG
|
||||||
if (sev_counter >= 5) {
|
if (sev_counter >= 5) {
|
||||||
|
|
|
@ -395,7 +395,6 @@ public:
|
||||||
static const int m_NO_BLEND;
|
static const int m_NO_BLEND;
|
||||||
static const int m_MERGE_BLEND;
|
static const int m_MERGE_BLEND;
|
||||||
|
|
||||||
static int s_n;
|
|
||||||
static int m_shader_inst;
|
static int m_shader_inst;
|
||||||
static int m_shader_reg;
|
static int m_shader_reg;
|
||||||
|
|
||||||
|
|
|
@ -1098,7 +1098,6 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
|
||||||
|
|
||||||
ASSERT(m_dev != NULL);
|
ASSERT(m_dev != NULL);
|
||||||
GSDeviceOGL* dev = (GSDeviceOGL*)m_dev;
|
GSDeviceOGL* dev = (GSDeviceOGL*)m_dev;
|
||||||
dev->s_n = s_n;
|
|
||||||
|
|
||||||
// HLE implementation of the channel selection effect
|
// HLE implementation of the channel selection effect
|
||||||
//
|
//
|
||||||
|
|
|
@ -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
|
//#define Offset_ST // Fixes Persona3 mini map alignment which is off even in software rendering
|
||||||
|
|
||||||
|
int GSState::s_n = 0;
|
||||||
|
|
||||||
GSState::GSState()
|
GSState::GSState()
|
||||||
: m_version(6)
|
: m_version(6)
|
||||||
, m_mt(false)
|
, m_mt(false)
|
||||||
|
@ -49,7 +51,7 @@ GSState::GSState()
|
||||||
m_userhacks_skipdraw = theApp.GetConfigB("UserHacks") ? theApp.GetConfigI("UserHacks_SkipDraw") : 0;
|
m_userhacks_skipdraw = theApp.GetConfigB("UserHacks") ? theApp.GetConfigI("UserHacks_SkipDraw") : 0;
|
||||||
m_userhacks_auto_flush = theApp.GetConfigB("UserHacks") ? theApp.GetConfigB("UserHacks_AutoFlush") : 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_dump = theApp.GetConfigB("dump");
|
||||||
s_save = theApp.GetConfigB("save");
|
s_save = theApp.GetConfigB("save");
|
||||||
s_savet = theApp.GetConfigB("savet");
|
s_savet = theApp.GetConfigB("savet");
|
||||||
|
|
|
@ -224,7 +224,7 @@ public:
|
||||||
bool m_nativeres;
|
bool m_nativeres;
|
||||||
bool m_mipmap;
|
bool m_mipmap;
|
||||||
|
|
||||||
int s_n;
|
static int s_n;
|
||||||
bool s_dump;
|
bool s_dump;
|
||||||
bool s_save;
|
bool s_save;
|
||||||
bool s_savet;
|
bool s_savet;
|
||||||
|
|
Loading…
Reference in New Issue