xb format --all (we are now format clean). Buildbot will yell at you.

This commit is contained in:
Ben Vanik
2015-06-22 22:26:51 -07:00
parent f902f8b78a
commit fb1f4906d9
87 changed files with 3542 additions and 2938 deletions

View File

@@ -92,9 +92,9 @@ bool CommandProcessor::Initialize(std::unique_ptr<GLContext> context) {
worker_thread_ = kernel::object_ref<kernel::XHostThread>(
new kernel::XHostThread(graphics_system_->emulator()->kernel_state(),
128 * 1024, 0, [this]() {
WorkerThreadMain();
return 0;
}));
WorkerThreadMain();
return 0;
}));
worker_thread_->set_name("GL4 Worker");
worker_thread_->Create();
@@ -2881,10 +2881,10 @@ bool CommandProcessor::IssueCopy() {
/* glClearNamedFramebufferfi(source_framebuffer->framebuffer,
GL_DEPTH_STENCIL,
depth, stencil);*/
glClearNamedFramebufferfv(source_framebuffer->framebuffer, GL_DEPTH,
0, &depth);
glClearNamedFramebufferiv(source_framebuffer->framebuffer, GL_STENCIL,
0, &stencil);
glClearNamedFramebufferfv(source_framebuffer->framebuffer, GL_DEPTH, 0,
&depth);
glClearNamedFramebufferiv(source_framebuffer->framebuffer, GL_STENCIL, 0,
&stencil);
glDepthMask(old_depth_mask);
glStencilMask(old_stencil_mask);
}

View File

@@ -209,7 +209,8 @@ void GL4ShaderTranslator::AppendSrcReg(const instr_alu_t& op, uint32_t num,
}
Append("state.float_consts[");
#if FLOW_CONTROL
// NOTE(dariosamo): Some games don't seem to take into account the relative a0
// NOTE(dariosamo): Some games don't seem to take into account the relative
// a0
// offset even when they should due to const_slot being a different value.
if (op.const_0_rel_abs || op.const_1_rel_abs) {
#else
@@ -1528,22 +1529,22 @@ static const struct {
} cf_instructions[] = {
#define INSTR(opc, fxn) \
{ #opc }
INSTR(NOP, print_cf_nop),
INSTR(EXEC, print_cf_exec),
INSTR(EXEC_END, print_cf_exec),
INSTR(COND_EXEC, print_cf_exec),
INSTR(COND_EXEC_END, print_cf_exec),
INSTR(COND_PRED_EXEC, print_cf_exec),
INSTR(COND_PRED_EXEC_END, print_cf_exec),
INSTR(LOOP_START, print_cf_loop),
INSTR(LOOP_END, print_cf_loop),
INSTR(COND_CALL, print_cf_jmp_call),
INSTR(RETURN, print_cf_jmp_call),
INSTR(COND_JMP, print_cf_jmp_call),
INSTR(ALLOC, print_cf_alloc),
INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec),
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec),
INSTR(MARK_VS_FETCH_DONE, print_cf_nop), // ??
INSTR(NOP, print_cf_nop), //
INSTR(EXEC, print_cf_exec), //
INSTR(EXEC_END, print_cf_exec), //
INSTR(COND_EXEC, print_cf_exec), //
INSTR(COND_EXEC_END, print_cf_exec), //
INSTR(COND_PRED_EXEC, print_cf_exec), //
INSTR(COND_PRED_EXEC_END, print_cf_exec), //
INSTR(LOOP_START, print_cf_loop), //
INSTR(LOOP_END, print_cf_loop), //
INSTR(COND_CALL, print_cf_jmp_call), //
INSTR(RETURN, print_cf_jmp_call), //
INSTR(COND_JMP, print_cf_jmp_call), //
INSTR(ALLOC, print_cf_alloc), //
INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec), //
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec), //
INSTR(MARK_VS_FETCH_DONE, print_cf_nop), // ??
#undef INSTR
};
@@ -1699,7 +1700,8 @@ bool GL4ShaderTranslator::TranslateLoopEnd(const ucode::instr_cf_loop_t& cf) {
Append(" // %s", cf_instructions[cf.opc].name);
Append(" ADDR(0x%x) LOOP ID(%d)\n", cf.address, cf.loop_id);
Append(" i%d_cnt = i%d_cnt + 1;\n", cf.loop_id, cf.loop_id);
Append(" pc = (i%d_cnt < state.loop_consts[%d]) ? i%d_addr : pc;\n", cf.loop_id, cf.loop_id, cf.loop_id);
Append(" pc = (i%d_cnt < state.loop_consts[%d]) ? i%d_addr : pc;\n",
cf.loop_id, cf.loop_id, cf.loop_id);
return true;
}
@@ -1710,66 +1712,66 @@ bool GL4ShaderTranslator::TranslateVertexFetch(const instr_fetch_vtx_t* vtx,
} fetch_types[0xff] = {
#define TYPE(id) \
{ #id }
TYPE(FMT_1_REVERSE), // 0
{0},
TYPE(FMT_8), // 2
{0},
{0},
{0},
TYPE(FMT_8_8_8_8), // 6
TYPE(FMT_2_10_10_10), // 7
{0},
{0},
TYPE(FMT_8_8), // 10
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_16), // 24
TYPE(FMT_16_16), // 25
TYPE(FMT_16_16_16_16), // 26
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_32), // 33
TYPE(FMT_32_32), // 34
TYPE(FMT_32_32_32_32), // 35
TYPE(FMT_32_FLOAT), // 36
TYPE(FMT_32_32_FLOAT), // 37
TYPE(FMT_32_32_32_32_FLOAT), // 38
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_32_32_32_FLOAT), // 57
TYPE(FMT_1_REVERSE), // 0
{0},
TYPE(FMT_8), // 2
{0},
{0},
{0},
TYPE(FMT_8_8_8_8), // 6
TYPE(FMT_2_10_10_10), // 7
{0},
{0},
TYPE(FMT_8_8), // 10
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_16), // 24
TYPE(FMT_16_16), // 25
TYPE(FMT_16_16_16_16), // 26
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_32), // 33
TYPE(FMT_32_32), // 34
TYPE(FMT_32_32_32_32), // 35
TYPE(FMT_32_FLOAT), // 36
TYPE(FMT_32_32_FLOAT), // 37
TYPE(FMT_32_32_32_32_FLOAT), // 38
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
{0},
TYPE(FMT_32_32_32_FLOAT), // 57
#undef TYPE
};
};
// Disassemble.
Append(" // %sFETCH:\t", sync ? "(S)" : " ");

View File

@@ -96,10 +96,11 @@ bool GLContext::Initialize(HWND hwnd) {
int context_flags = 0;
#if DEBUG
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
#endif // DEBUG
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
WGL_CONTEXT_FLAGS_ARB, context_flags, //
#endif // DEBUG
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
WGL_CONTEXT_FLAGS_ARB, context_flags, //
0};
glrc_ = wglCreateContextAttribsARB(dc_, nullptr, attrib_list);
@@ -151,11 +152,12 @@ std::unique_ptr<GLContext> GLContext::CreateShared() {
int profile = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
#if DEBUG
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
#endif // DEBUG
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
WGL_CONTEXT_FLAGS_ARB, context_flags, //
WGL_CONTEXT_PROFILE_MASK_ARB, profile, //
#endif // DEBUG
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
WGL_CONTEXT_FLAGS_ARB, context_flags, //
WGL_CONTEXT_PROFILE_MASK_ARB, profile, //
0};
new_glrc = wglCreateContextAttribsARB(dc_, glrc_, attrib_list);
if (!new_glrc) {
@@ -280,9 +282,9 @@ void GLContext::DebugMessage(GLenum source, GLenum type, GLuint id,
}
void GLAPIENTRY
GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id,
GLenum severity, GLsizei length,
const GLchar* message, GLvoid* user_param) {
GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id,
GLenum severity, GLsizei length,
const GLchar* message, GLvoid* user_param) {
reinterpret_cast<GLContext*>(user_param)
->DebugMessage(source, type, id, severity, length, message);
}

View File

@@ -43,9 +43,8 @@ class GLContext {
void DebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar* message);
static void GLAPIENTRY
DebugMessageThunk(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar* message,
GLvoid* user_param);
DebugMessageThunk(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar* message, GLvoid* user_param);
HWND hwnd_;
HDC dc_;