Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Things
Browse files Browse the repository at this point in the history
  • Loading branch information
tambry committed Feb 20, 2015
2 parents 4b51627 + 67c0227 commit 948758f
Show file tree
Hide file tree
Showing 11 changed files with 525 additions and 460 deletions.
93 changes: 48 additions & 45 deletions GL/glext.h

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,18 @@ bool get_x64_reg_value(x64_context* context, x64_reg_t reg, size_t d_size, size_
case 8: out_value = (u64)imm_value; return true; // sign-extended
}
}
else if (reg == X64_IMM16)
{
// load the immediate value (assuming it's at the end of the instruction)
out_value = *(s16*)(RIP(context) + i_size - 2);
return true;
}
else if (reg == X64_IMM8)
{
// load the immediate value (assuming it's at the end of the instruction)
out_value = *(s8*)(RIP(context) + i_size - 1);
return true;
}
else if (reg == X64R_ECX)
{
out_value = (u32)RCX(context);
Expand Down
13 changes: 12 additions & 1 deletion rpcs3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ if (APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/X11/include")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
#on some Linux distros shm_unlink and similar functions are in librt only
set(ADDITIONAL_LIBS "rt")
elseif(UNIX)
#it seems like glibc includes the iconv functions we use but other libc
#implementations like the one on OSX don't seem implement them
set(ADDITIONAL_LIBS "iconv")
else()
set(ADDITIONAL_LIBS "")
endif()

If( NOT RPCS3_SRC_DIR)
SET(RPCS3_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
Message("-- Initializing RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
Expand Down Expand Up @@ -120,7 +131,7 @@ set_source_files_properties(${RPCS3_SRC_DIR}/Emu/Cell/PPULLVMRecompiler.cpp PROP
add_executable(rpcs3 ${RPCS3_SRC})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_CURRENT_BINARY_DIR}/../asmjit/") #hack because the asmjit cmake file force fno exceptions
target_link_libraries(rpcs3 asmjit.a ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES} ${LLVM_LIBS} rt)
target_link_libraries(rpcs3 asmjit.a ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES} ${LLVM_LIBS} ${ADDITIONAL_LIBS} )

set_target_properties(rpcs3 PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h")
cotire(rpcs3)
Expand Down
23 changes: 14 additions & 9 deletions rpcs3/Emu/RSX/GL/GLProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ GLProgram::GLProgram() : id(0)

int GLProgram::GetLocation(const std::string& name)
{
for(u32 i=0; i<m_locations.size(); ++i)
for (u32 i=0; i < m_locations.size(); ++i)
{
if(!m_locations[i].name.compare(name))
if (!m_locations[i].name.compare(name))
{
return m_locations[i].loc;
}
Expand All @@ -34,7 +34,9 @@ bool GLProgram::IsCreated() const

void GLProgram::Create(const u32 vp, const u32 fp)
{
if(IsCreated()) Delete();
if (IsCreated())
Delete();

id = glCreateProgram();

glAttachShader(id, vp);
Expand All @@ -44,25 +46,25 @@ void GLProgram::Create(const u32 vp, const u32 fp)

GLint linkStatus = GL_FALSE;
glGetProgramiv(id, GL_LINK_STATUS, &linkStatus);
if(linkStatus != GL_TRUE)
if (linkStatus != GL_TRUE)
{
GLint bufLength = 0;
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);

if (bufLength)
{
char* buf = new char[bufLength+1]();
char* buf = new char[bufLength + 1]();
glGetProgramInfoLog(id, bufLength, NULL, buf);
LOG_ERROR(RSX, "Could not link program: %s", buf);
delete[] buf;

return;
}
}
//else LOG_NOTICE(HLE, "program linked!");
//else LOG_NOTICE(HLE, "Program linked!");

glGetProgramiv(id, GL_VALIDATE_STATUS, &linkStatus);
if(linkStatus != GL_TRUE)
if (linkStatus != GL_TRUE)
{
GLint bufLength = 0;
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);
Expand All @@ -87,7 +89,8 @@ void GLProgram::UnUse()

void GLProgram::Use()
{
glUseProgram(id);
if (id != 0)
glUseProgram(id);
checkForGlError("glUseProgram");
}

Expand All @@ -107,7 +110,9 @@ void GLProgram::SetVTex(u32 index)

void GLProgram::Delete()
{
if(!IsCreated()) return;
if (!IsCreated())
return;

glDeleteProgram(id);
id = 0;
m_locations.clear();
Expand Down
Loading

0 comments on commit 948758f

Please sign in to comment.