Commit 39a10c31 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Backport TARGET_NO_OPENMP

parent 842c519d
......@@ -543,6 +543,9 @@ ifeq ($(HAVE_OPENMP), 1)
CFLAGS += -fopenmp
CXXFLAGS += -fopenmp
LDFLAGS += -fopenmp
else
CFLAGS += -DTARGET_NO_OPENMP
CXXFLAGS += -DTARGET_NO_OPENMP
endif
ifeq ($(platform), win)
LDFLAGS_END += -Wl,-Bstatic -lgmp -Wl,-Bstatic -lgomp
......
#ifdef HAVE_TEXUPSCALE
#include <list>
#include <functional>
#ifndef TARGET_NO_OPENMP
#include <omp.h>
#endif
#endif
#include "TexCache.h"
#include "hw/pvr/pvr_regs.h"
#include "hw/pvr/ta.h"
......@@ -347,6 +349,7 @@ static void deposterizeV(u32* data, u32* out, int w, int h, int l, int u) {
}
}
#ifndef TARGET_NO_OPENMP
void parallelize(const std::function<void(int,int)> &func, int start, int end, int width /* = 0 */)
{
int tcount = omp_get_num_procs() - 1;
......@@ -374,14 +377,19 @@ void DePosterize(u32* source, u32* dest, int width, int height) {
free(tmpbuf);
}
#endif
struct xbrz::ScalerCfg xbrz_cfg;
void UpscalexBRZ(int factor, u32* source, u32* dest, int width, int height, bool has_alpha) {
#ifndef TARGET_NO_OPENMP
parallelize(
std::bind(&xbrz::scale, factor, source, dest, width, height, has_alpha ? xbrz::ColorFormat::ARGB : xbrz::ColorFormat::RGB, xbrz_cfg,
std::placeholders::_1, std::placeholders::_2), 0, height, width);
// xbrz::scale(factor, source, dest, width, height, has_alpha ? xbrz::ColorFormat::ARGB : xbrz::ColorFormat::RGB, xbrz_cfg);
#else
xbrz::scale(factor, source, dest, width, height, has_alpha ? xbrz::ColorFormat::ARGB : xbrz::ColorFormat::RGB, xbrz_cfg);
#endif
}
void shutdown_thread_pool()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment