Permalink
Browse files

Add: some helpers to compile on ODROID-XU4/XU3

  • Loading branch information...
AreaScout committed Sep 7, 2018
1 parent ad6938d commit 95556e8d0362640601ffcbf105294b981198b1e9
View
@@ -28,8 +28,17 @@ endif()
if(CMAKE_SYSTEM_PROCESSOR)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
set(ARM ON)
if(UNIX AND NOT APPLE)
execute_process(COMMAND cat /proc/cpuinfo OUTPUT_VARIABLE OUTSTR)
string(FIND "${OUTSTR}" "ODROID-XU" pos)
if(pos GREATER_EQUAL 0)
add_compile_options(-mfloat-abi=hard -marm -mtune=cortex-a15.cortex-a7 -mcpu=cortex-a15 -fomit-frame-pointer)
set(ARM_NO_VULKAN ON)
endif()
endif()
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
set(ARMV7 ON)
add_compile_options(-mfpu=neon-vfpv4)
# Horrifying workaround for bug in android cmake stuff for asm files
if (ANDROID)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -target armv7a-none-linux-android")
@@ -80,10 +89,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
endif()
# We only support Vulkan on Unix, Android and Windows.
if(ANDROID OR WIN32 OR (UNIX AND NOT APPLE))
set(VULKAN ON)
else()
add_definitions(-DNO_VULKAN)
if(ANDROID OR WIN32 OR (UNIX AND NOT APPLE AND NOT ARM_NO_VULKAN))
set(VULKAN ON)
endif()
if(NOT DEFINED HEADLESS)
View
@@ -28,9 +28,7 @@
#else
#include "GPU/GLES/GPU_GLES.h"
#ifndef NO_VULKAN
#include "GPU/Vulkan/GPU_Vulkan.h"
#endif
#include "GPU/Null/NullGpu.h"
#include "GPU/Software/SoftGpu.h"
@@ -91,13 +89,11 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) {
return false;
#endif
case GPUCORE_VULKAN:
#ifndef NO_VULKAN
if (!ctx) {
ERROR_LOG(G3D, "Unable to init Vulkan GPU backend, no context");
break;
}
SetGPU(new GPU_Vulkan(ctx, draw));
#endif
break;
}
@@ -135,8 +135,10 @@ GLboolean gl3stubInit() {
FIND_PROC(glGetProgramResourceLocationIndexEXT);
FIND_PROC(glGetFragDataIndexEXT);
#ifdef GL_EXT_buffer_storage
/* EXT_buffer_storage */
FIND_PROC(glBufferStorageEXT);
#endif
/* OES_copy_image, etc. */
FIND_PROC(glCopyImageSubDataOES);
@@ -369,8 +371,10 @@ GL_APICALL void (* GL_APIENTRY glBindFragDataLocationEXT) (GLuint prog
GL_APICALL GLint (* GL_APIENTRY glGetProgramResourceLocationIndexEXT) (GLuint program, GLenum programInterface, const GLchar *name);
GL_APICALL GLint (* GL_APIENTRY glGetFragDataIndexEXT) (GLuint program, const GLchar *name);
#ifdef GL_EXT_buffer_storage
/* EXT_buffer_storage */
GL_APICALL void (* GL_APIENTRY glBufferStorageEXT) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
#endif
/* OES_copy_image, etc. */
GL_APICALL void (* GL_APIENTRY glCopyImageSubDataOES) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
@@ -504,8 +504,10 @@ extern GL_APICALL void (* GL_APIENTRY glBindFragDataLocationEXT) (GLui
extern GL_APICALL GLint (* GL_APIENTRY glGetProgramResourceLocationIndexEXT) (GLuint program, GLenum programInterface, const GLchar *name);
extern GL_APICALL GLint (* GL_APIENTRY glGetFragDataIndexEXT) (GLuint program, const GLchar *name);
#ifdef GL_EXT_buffer_storage
/* EXT_buffer_storage */
extern GL_APICALL void (* GL_APIENTRY glBufferStorageEXT) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
#endif
/* OES_copy_image, etc. */
extern GL_APICALL void (* GL_APIENTRY glCopyImageSubDataOES) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
@@ -806,7 +806,9 @@ void *GLRBuffer::Map(GLBufferStrategy strategy) {
if (!hasStorage_) {
GLbitfield storageFlags = access & ~(GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_FLUSH_EXPLICIT_BIT);
#ifdef USING_GLES2
#ifdef GL_EXT_buffer_storage
glBufferStorageEXT(target_, size_, nullptr, storageFlags);
#endif
#else
glBufferStorage(target_, size_, nullptr, storageFlags);
#endif
@@ -2,9 +2,7 @@
#include "libretro/LibretroGraphicsContext.h"
#include "libretro/LibretroGLContext.h"
#include "libretro/libretro.h"
#ifndef NO_VULKAN
#include "libretro/LibretroVulkanContext.h"
#endif
#ifdef _WIN32
#include "libretro/LibretroD3D11Context.h"
#endif
@@ -91,14 +89,12 @@ LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() {
}
delete ctx;
#ifndef NO_VULKAN
ctx = new LibretroVulkanContext();
if (ctx->Init()) {
return ctx;
}
delete ctx;
#endif
#ifdef _WIN32
ctx = new LibretroD3D11Context();
View
@@ -579,35 +579,34 @@ SOURCES_C += $(EXTDIR)/udis86/decode.c \
$(EXTDIR)/udis86/syn.c \
$(EXTDIR)/udis86/udis86.c
ifeq ($(PLATFORM_EXT), darwin)
COREFLAGS += -DNO_VULKAN
else
SOURCES_CXX += \
$(COMMONDIR)/Vulkan/SPIRVDisasm.cpp \
$(COMMONDIR)/Vulkan/VulkanContext.cpp \
$(COMMONDIR)/Vulkan/VulkanDebug.cpp \
$(COMMONDIR)/Vulkan/VulkanImage.cpp \
$(COMMONDIR)/Vulkan/VulkanLoader.cpp \
$(COMMONDIR)/Vulkan/VulkanMemory.cpp \
$(NATIVEDIR)/thin3d/thin3d_vulkan.cpp \
$(NATIVEDIR)/thin3d/VulkanRenderManager.cpp \
$(NATIVEDIR)/thin3d/VulkanQueueRunner.cpp \
$(GPUDIR)/Vulkan/DepalettizeShaderVulkan.cpp \
$(GPUDIR)/Vulkan/DrawEngineVulkan.cpp \
$(GPUDIR)/Vulkan/FragmentShaderGeneratorVulkan.cpp \
$(GPUDIR)/Vulkan/FramebufferVulkan.cpp \
$(GPUDIR)/Vulkan/GPU_Vulkan.cpp \
$(GPUDIR)/Vulkan/PipelineManagerVulkan.cpp \
$(GPUDIR)/Vulkan/ShaderManagerVulkan.cpp \
$(GPUDIR)/Vulkan/StateMappingVulkan.cpp \
$(GPUDIR)/Vulkan/StencilBufferVulkan.cpp \
$(GPUDIR)/Vulkan/TextureCacheVulkan.cpp \
$(GPUDIR)/Vulkan/TextureScalerVulkan.cpp \
$(GPUDIR)/Vulkan/VertexShaderGeneratorVulkan.cpp \
$(GPUDIR)/Vulkan/VulkanUtil.cpp \
$(LIBRETRODIR)/LibretroVulkanContext.cpp \
$(LIBRETRODIR)/libretro_vulkan.cpp
SOURCES_CXX += \
$(COMMONDIR)/Vulkan/SPIRVDisasm.cpp \
$(COMMONDIR)/Vulkan/VulkanContext.cpp \
$(COMMONDIR)/Vulkan/VulkanDebug.cpp \
$(COMMONDIR)/Vulkan/VulkanImage.cpp \
$(COMMONDIR)/Vulkan/VulkanLoader.cpp \
$(COMMONDIR)/Vulkan/VulkanMemory.cpp \
$(NATIVEDIR)/thin3d/thin3d_vulkan.cpp \
$(NATIVEDIR)/thin3d/VulkanRenderManager.cpp \
$(NATIVEDIR)/thin3d/VulkanQueueRunner.cpp \
$(GPUDIR)/Vulkan/DepalettizeShaderVulkan.cpp \
$(GPUDIR)/Vulkan/DrawEngineVulkan.cpp \
$(GPUDIR)/Vulkan/FragmentShaderGeneratorVulkan.cpp \
$(GPUDIR)/Vulkan/FramebufferVulkan.cpp \
$(GPUDIR)/Vulkan/GPU_Vulkan.cpp \
$(GPUDIR)/Vulkan/PipelineManagerVulkan.cpp \
$(GPUDIR)/Vulkan/ShaderManagerVulkan.cpp \
$(GPUDIR)/Vulkan/StateMappingVulkan.cpp \
$(GPUDIR)/Vulkan/StencilBufferVulkan.cpp \
$(GPUDIR)/Vulkan/TextureCacheVulkan.cpp \
$(GPUDIR)/Vulkan/TextureScalerVulkan.cpp \
$(GPUDIR)/Vulkan/VertexShaderGeneratorVulkan.cpp \
$(GPUDIR)/Vulkan/VulkanUtil.cpp \
$(LIBRETRODIR)/LibretroVulkanContext.cpp \
$(LIBRETRODIR)/libretro_vulkan.cpp
ifneq ($(PLATFORM_EXT), darwin)
ifeq ($(PLATFORM_EXT), unix)
COREFLAGS += -DVK_USE_PLATFORM_XLIB_KHR
endif
View
@@ -71,7 +71,7 @@ LOCAL_MODULE := retro
include $(CORE_DIR)/libretro/Makefile.common
COREFLAGS += -DINLINE="inline" -DPPSSPP -DUSE_FFMPEG -DMOBILE_DEVICE -DBAKE_IN_GIT -DDYNAREC -D__LIBRETRO__ -DUSING_GLES2 -D__STDC_CONSTANT_MACROS -DGLEW_NO_GLU -DNO_VULKAN $(INCFLAGS)
COREFLAGS += -DINLINE="inline" -DPPSSPP -DUSE_FFMPEG -DMOBILE_DEVICE -DBAKE_IN_GIT -DDYNAREC -D__LIBRETRO__ -DUSING_GLES2 -D__STDC_CONSTANT_MACROS -DGLEW_NO_GLU $(INCFLAGS)
LOCAL_SRC_FILES = $(SOURCES_CXX) $(SOURCES_C) $(ASMFILES)
LOCAL_CPPFLAGS := -Wall -std=gnu++11 $(COREFLAGS) -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
LOCAL_CFLAGS := -O2 -ffast-math -DANDROID $(COREFLAGS)

0 comments on commit 95556e8

Please sign in to comment.