Skip to content

Commit

Permalink
Revert "Update readme.md (#5)"
Browse files Browse the repository at this point in the history
This reverts commit 5020159.
  • Loading branch information
Panderner authored Feb 16, 2021
1 parent 5020159 commit 2b6bf26
Show file tree
Hide file tree
Showing 143 changed files with 588 additions and 2,207 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- master
# For testing.
- actions
paths-ignore:
- '*.{txt,md}'
- 'Tools/**'
Expand Down Expand Up @@ -178,19 +176,9 @@ jobs:
with:
submodules: recursive

- name: Cache Qt
uses: actions/cache@v1
if: matrix.extra == 'qt'
id: cache-qt
with:
path: ${{ runner.workspace }}/Qt
key: ${{ runner.os }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v2
if: matrix.extra == 'qt'
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- uses: nttld/setup-ndk@v1
if: matrix.extra == 'android'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ debian/ppsspp/

# RenderDoc
*.rdc

# bad output from libretro. don't want to accidentally add it
nul
33 changes: 5 additions & 28 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,26 @@ variables:
variables:
EXTRA_PATH: lib

.windows-defs:
variables:
MAKEFILE_PATH: libretro

include:
- template: Jobs/Code-Quality.gitlab-ci.yml
- project: 'libretro-infrastructure/ci-templates'
file: '/android-cmake.yml'
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-cmake.yml'
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-x64-msvc19-msys2.yml'
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-msvc19-msys2.yml'

stages:
- build-prepare
- build-shared
- build-static
- test

# Desktop
libretro-build-linux-x64:
#Desktop
libretro-build-linux-x86_64:
extends:
- .libretro-linux-cmake-x86_64
- .core-defs
- .linux-defs

libretro-build-linux-i686:
extends:
- .libretro-linux-cmake-x86
- .core-defs
- .linux-defs

libretro-build-windows-x64:
extends:
- .libretro-windows-x64-msvc19-msys2-make-default
- .core-defs
- .windows-defs

libretro-build-windows-i686:
extends:
- .libretro-windows-i686-msvc19-msys2-make-default
- .core-defs
- .windows-defs

# Android
libretro-build-android-armeabi-v7a:
extends:
Expand Down
27 changes: 4 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ option(USE_MINIUPNPC "Build with miniUPnPc support" ON)
option(USE_SYSTEM_SNAPPY "Dynamically link against system snappy" ${USE_SYSTEM_SNAPPY})
option(USE_SYSTEM_FFMPEG "Dynamically link against system FFMPEG" ${USE_SYSTEM_FFMPEG})
option(USE_SYSTEM_LIBZIP "Dynamically link against system libzip" ${USE_SYSTEM_LIBZIP})
option(USE_ASAN "Use address sanitizer" OFF)
option(USE_UBSAN "Use undefined behaviour sanitizer" OFF)
option(USE_ADDRESS_SANITIZER "Use Clang memory sanitizer" ${USE_ADDRESS_SANITIZER})

if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN)
if(USING_X11_VULKAN)
Expand Down Expand Up @@ -273,24 +272,11 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-uninitialized")
endif()

if(USE_ASAN)
if(USE_ADDRESS_SANITIZER)
message("Address sanitizer enabled (DEBUG only)")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address")
add_definitions(-DUSE_ASAN)
endif()
if(USE_UBSAN)
message("Undefined behaviour sanitizer enabled (DEBUG only)")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=undefined")

# UBSAN is a collection of sanitizers, including vtpr, which reqiuires RTTI.
# ext/glslang disables RTTI by default using the `ENABLE_RTTI` option.
# If RTTI is disabled, we must also disable the vtpr sanitizer.
if(NOT ENABLE_RTTI)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-sanitize=vptr")
endif()
add_definitions(-DUSE_ADDRESS_SANITIZER)
endif()

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_DEBUG")
Expand Down Expand Up @@ -1506,10 +1492,6 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/Debugger/WebSocket/GPURecordSubscriber.h
Core/Debugger/WebSocket/HLESubscriber.cpp
Core/Debugger/WebSocket/HLESubscriber.h
Core/Debugger/WebSocket/InputBroadcaster.cpp
Core/Debugger/WebSocket/InputBroadcaster.h
Core/Debugger/WebSocket/InputSubscriber.cpp
Core/Debugger/WebSocket/InputSubscriber.h
Core/Debugger/WebSocket/LogBroadcaster.cpp
Core/Debugger/WebSocket/LogBroadcaster.h
Core/Debugger/WebSocket/MemorySubscriber.cpp
Expand Down Expand Up @@ -2204,7 +2186,6 @@ if(IOS)
RESOURCE "ios/Settings.bundle"
RESOURCE "MoltenVK/iOS/Frameworks"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "iPhone/iPad"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_ENABLE_BITCODE NO
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
Expand Down
3 changes: 3 additions & 0 deletions Common/GPU/OpenGL/GLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#elif defined(USING_GLES2)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
// At least Nokia platforms need the three below
#include <KHR/khrplatform.h>
typedef char GLchar;
#define GL_BGRA_EXT 0x80E1
#else // OpenGL
#include "GL/glew.h"
Expand Down
4 changes: 1 addition & 3 deletions Common/GPU/OpenGL/GLFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void CheckGLExtensions() {
// Just for reference: Galaxy Y has renderer == "VideoCore IV HW"
} else if (vendor == "Vivante Corporation") {
gl_extensions.gpuVendor = GPU_VENDOR_VIVANTE;
} else if (vendor == "Apple Inc." || vendor == "Apple") {
} else if (vendor == "Apple Inc.") {
gl_extensions.gpuVendor = GPU_VENDOR_APPLE;
} else {
WARN_LOG(G3D, "Unknown GL vendor: '%s'", vendor.c_str());
Expand Down Expand Up @@ -594,8 +594,6 @@ std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage) {
if (!gl_extensions.IsGLES && gl_extensions.IsCoreContext) {
// We need to add a corresponding #version. Apple drivers fail without an exact match.
version = StringFromFormat("#version %d\n", gl_extensions.GLSLVersion());
} else if (gl_extensions.IsGLES && gl_extensions.GLES3) {
version = StringFromFormat("#version %d es\n", gl_extensions.GLSLVersion());
}
if (stage == GL_FRAGMENT_SHADER) {
temp = version + glsl_fragment_prelude + source;
Expand Down
2 changes: 0 additions & 2 deletions Common/GPU/OpenGL/GLQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,14 +1369,12 @@ void GLQueueRunner::PerformCopy(const GLRStep &step) {

#if defined(USING_GLES2)
#ifndef IOS
_assert_msg_(gl_extensions.OES_copy_image || gl_extensions.NV_copy_image || gl_extensions.EXT_copy_image, "Image copy extension expected");
glCopyImageSubDataOES(
srcTex, target, srcLevel, srcRect.x, srcRect.y, srcZ,
dstTex, target, dstLevel, dstPos.x, dstPos.y, dstZ,
srcRect.w, srcRect.h, depth);
#endif
#else
_assert_msg_(gl_extensions.ARB_copy_image || gl_extensions.NV_copy_image, "Image copy extension expected");
if (gl_extensions.ARB_copy_image) {
glCopyImageSubData(
srcTex, target, srcLevel, srcRect.x, srcRect.y, srcZ,
Expand Down
6 changes: 3 additions & 3 deletions Common/GPU/OpenGL/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class OpenGLPipeline : public Pipeline {

// TODO: Optimize by getting the locations first and putting in a custom struct
UniformBufferDesc dynamicUniforms;
GLint samplerLocs_[8]{};
GLint samplerLocs_[8];
std::vector<GLint> dynamicUniformLocs_;
GLRProgram *program_ = nullptr;

Expand Down Expand Up @@ -1038,8 +1038,8 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
ERROR_LOG(G3D, "Pipeline requires at least one shader");
return nullptr;
}
if ((uint32_t)desc.prim >= (uint32_t)Primitive::PRIMITIVE_TYPE_COUNT) {
ERROR_LOG(G3D, "Invalid primitive type");
if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) {
ERROR_LOG(G3D, "Invalid primitive type");
return nullptr;
}
if (!desc.depthStencil || !desc.blend || !desc.raster) {
Expand Down
5 changes: 0 additions & 5 deletions Common/GPU/Vulkan/VulkanDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback(
// UNASSIGNED-CoreValidation-Shader-OutputNotConsumed - benign perf warning
return false;
}
if (messageCode == 1303270965) {
// Benign perf warning, image blit using GENERAL layout.
// UNASSIGNED
return false;
}

const char *pLayerPrefix = "";
if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {
Expand Down
20 changes: 5 additions & 15 deletions Common/GPU/Vulkan/VulkanImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ static bool IsDepthStencilFormat(VkFormat format) {
}

bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *allocator, int w, int h, int numMips, VkFormat format, VkImageLayout initialLayout, VkImageUsageFlags usage, const VkComponentMapping *mapping) {
if (w == 0 || h == 0 || numMips == 0) {
ERROR_LOG(G3D, "Can't create a zero-size VulkanTexture");
return false;
}

Wipe();

width_ = w;
Expand Down Expand Up @@ -201,8 +196,7 @@ void VulkanTexture::ClearMip(VkCommandBuffer cmd, int mip, uint32_t value) {
vkCmdClearColorImage(cmd, image_, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clearVal, 1, &range);
}

// Low-quality mipmap generation by bilinear blit, but works okay.
void VulkanTexture::GenerateMip(VkCommandBuffer cmd, int mip, VkImageLayout imageLayout) {
void VulkanTexture::GenerateMip(VkCommandBuffer cmd, int mip) {
_assert_msg_(mip != 0, "Cannot generate the first level");
_assert_msg_(mip < numMips_, "Cannot generate mipmaps past the maximum created (%d vs %d)", mip, numMips_);
VkImageBlit blit{};
Expand All @@ -220,20 +214,16 @@ void VulkanTexture::GenerateMip(VkCommandBuffer cmd, int mip, VkImageLayout imag
blit.dstOffsets[1].y = height_ >> mip;
blit.dstOffsets[1].z = 1;

// TODO: We could do better with the image transitions - would be enough with one per level
// for the memory barrier, then one final one for the whole stack when done. This function
// currently doesn't have a global enough view, though.
// We should also coalesce barriers across multiple texture uploads in a frame and all kinds of other stuff, but...

TransitionImageLayout2(cmd, image_, mip - 1, 1, VK_IMAGE_ASPECT_COLOR_BIT,
imageLayout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT);

vkCmdBlitImage(cmd, image_, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, image_, imageLayout, 1, &blit, VK_FILTER_LINEAR);
// Low-quality mipmap generation, but works okay.
vkCmdBlitImage(cmd, image_, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, image_, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &blit, VK_FILTER_LINEAR);

TransitionImageLayout2(cmd, image_, mip - 1, 1, VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, imageLayout,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_TRANSFER_WRITE_BIT);
}
Expand Down
2 changes: 1 addition & 1 deletion Common/GPU/Vulkan/VulkanImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class VulkanTexture {
bool CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *allocator, int w, int h, int numMips, VkFormat format, VkImageLayout initialLayout, VkImageUsageFlags usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, const VkComponentMapping *mapping = nullptr);
void ClearMip(VkCommandBuffer cmd, int mip, uint32_t value);
void UploadMip(VkCommandBuffer cmd, int mip, int mipWidth, int mipHeight, VkBuffer buffer, uint32_t offset, size_t rowLength); // rowLength is in pixels
void GenerateMip(VkCommandBuffer cmd, int mip, VkImageLayout imageLayout);
void GenerateMip(VkCommandBuffer cmd, int mip);
void EndCreate(VkCommandBuffer cmd, bool vertexTexture = false, VkImageLayout layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);

// When loading mips from compute shaders, you need to pass VK_IMAGE_LAYOUT_GENERAL to the above function.
Expand Down
7 changes: 3 additions & 4 deletions Common/GPU/Vulkan/thin3d_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool VKShaderModule::Compile(VulkanContext *vulkan, ShaderLanguage language, con
std::vector<uint32_t> spirv;
std::string errorMessage;
if (!GLSLtoSPV(vkstage_, source_.c_str(), GLSLVariant::VULKAN, spirv, &errorMessage)) {
WARN_LOG(G3D, "Shader compile to module failed: %s", errorMessage.c_str());
INFO_LOG(G3D, "Shader compile to module failed: %s", errorMessage.c_str());
return false;
}

Expand All @@ -231,7 +231,6 @@ bool VKShaderModule::Compile(VulkanContext *vulkan, ShaderLanguage language, con
if (vulkan->CreateShaderModule(spirv, &module_)) {
ok_ = true;
} else {
WARN_LOG(G3D, "vkCreateShaderModule failed");
ok_ = false;
}
return ok_;
Expand Down Expand Up @@ -755,7 +754,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur
}
// Generate the rest of the mips automatically.
for (; i < mipLevels_; i++) {
vkTex_->GenerateMip(cmd, i, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
vkTex_->GenerateMip(cmd, i);
}
}
vkTex_->EndCreate(cmd, false);
Expand Down Expand Up @@ -1282,7 +1281,7 @@ ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage la
if (shader->Compile(vulkan_, language, data, size)) {
return shader;
} else {
ERROR_LOG(G3D, "Failed to compile shader:\n%s", (const char *)data);
ERROR_LOG(G3D, "Failed to compile shader: %s", (const char *)data);
shader->Release();
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion Common/MemArenaPosix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void MemArena::ReleaseView(void* view, size_t size) {

u8* MemArena::Find4GBBase() {
// Now, create views in high memory where there's plenty of space.
#if PPSSPP_ARCH(64BIT) && !defined(USE_ASAN)
#if PPSSPP_ARCH(64BIT) && !defined(USE_ADDRESS_SANITIZER)
// We should probably just go look in /proc/self/maps for some free space.
// But let's try the anonymous mmap trick, just like on 32-bit, but bigger and
// aligned to 4GB for the movk trick. We can ensure that we get an aligned 4GB
Expand Down
26 changes: 0 additions & 26 deletions Common/Render/DrawBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,6 @@ void DrawBuffer::DrawImage(ImageID atlas_image, float x, float y, float scale, C
DrawImageStretch(atlas_image, x, y, x + w, y + h, color);
}

void DrawBuffer::DrawImageCenterTexel(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color) {
const AtlasImage *image = atlas->getImage(atlas_image);
if (!image)
return;
float centerU = (image->u1 + image->u2) * 0.5f;
float centerV = (image->v1 + image->v2) * 0.5f;
V(x1, y1, color, centerU, centerV);
V(x2, y1, color, centerU, centerV);
V(x2, y2, color, centerU, centerV);
V(x1, y1, color, centerU, centerV);
V(x2, y2, color, centerU, centerV);
V(x1, y2, color, centerU, centerV);
}

void DrawBuffer::DrawImageStretch(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color) {
const AtlasImage *image = atlas->getImage(atlas_image);
if (!image)
Expand All @@ -250,18 +236,6 @@ void DrawBuffer::DrawImageStretch(ImageID atlas_image, float x1, float y1, float
V(x1, y2, color, image->u1, image->v2);
}

void DrawBuffer::DrawImageStretchVGradient(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color1, Color color2) {
const AtlasImage *image = atlas->getImage(atlas_image);
if (!image)
return;
V(x1, y1, color1, image->u1, image->v1);
V(x2, y1, color1, image->u2, image->v1);
V(x2, y2, color2, image->u2, image->v2);
V(x1, y1, color1, image->u1, image->v1);
V(x2, y2, color2, image->u2, image->v2);
V(x1, y2, color2, image->u1, image->v2);
}

inline void rot(float *v, float angle, float xc, float yc) {
const float x = v[0] - xc;
const float y = v[1] - yc;
Expand Down
4 changes: 0 additions & 4 deletions Common/Render/DrawBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ class DrawBuffer {
const Atlas *GetAtlas() const { return atlas; }
bool MeasureImage(ImageID atlas_image, float *w, float *h);
void DrawImage(ImageID atlas_image, float x, float y, float scale, Color color = COLOR(0xFFFFFF), int align = ALIGN_TOPLEFT);

// Good for stretching out a white image without edge artifacts that I'm getting on iOS.
void DrawImageCenterTexel(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color = COLOR(0xFFFFFF));
void DrawImageStretch(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color = COLOR(0xFFFFFF));
void DrawImageStretchVGradient(ImageID atlas_image, float x1, float y1, float x2, float y2, Color color1, Color color2);
void DrawImageStretch(ImageID atlas_image, const Bounds &bounds, Color color = COLOR(0xFFFFFF)) {
DrawImageStretch(atlas_image, bounds.x, bounds.y, bounds.x2(), bounds.y2(), color);
}
Expand Down
2 changes: 1 addition & 1 deletion Common/Serialize/Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void PointerWrap::DoMarker(const char *prevName, u32 arbitraryNumber) {
u32 cookie = arbitraryNumber;
Do(*this, cookie);
if (mode == PointerWrap::MODE_READ && cookie != arbitraryNumber) {
ERROR_LOG(SAVESTATE, "Error: After \"%s\", found %d (0x%X) instead of save marker %d (0x%X). Aborting savestate load...", prevName, cookie, cookie, arbitraryNumber, arbitraryNumber);
_assert_msg_(false, "Error: After \"%s\", found %d (0x%X) instead of save marker %d (0x%X). Aborting savestate load...", prevName, cookie, cookie, arbitraryNumber, arbitraryNumber);
SetError(ERROR_FAILURE);
}
}
Expand Down
Loading

0 comments on commit 2b6bf26

Please sign in to comment.