Skip to content

Commit 8827dcc

Browse files
committed
* fixed ios compilation + compat (+actual ios support for warp, although not functional yet)
1 parent 666d2fc commit 8827dcc

File tree

10 files changed

+393
-27
lines changed

10 files changed

+393
-27
lines changed

img/img.xcodeproj/project.pbxproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
5C0071D61A91FFD600F4711D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C0071D51A91FFD600F4711D /* UIKit.framework */; };
2323
5C0071D81A91FFE600F4711D /* libxml2.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C0071D71A91FFE600F4711D /* libxml2.2.dylib */; };
2424
5C0071DA1A91FFF400F4711D /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C0071D91A91FFF400F4711D /* CoreMotion.framework */; };
25-
5C30CAA51AA625F5008986B1 /* img.metallib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C30CAA31AA625DC008986B1 /* img.metallib */; };
2625
5C54774D1AD645AF00F55003 /* img_kernels.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C54774B1AD645AF00F55003 /* img_kernels.cpp */; settings = {COMPILER_FLAGS = "-fslp-vectorize-aggressive -Rpass-analysis=loop-vectorize -Rpass=loop-vectorize"; }; };
2726
5C54774E1AD645AF00F55003 /* img_kernels.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C54774B1AD645AF00F55003 /* img_kernels.cpp */; };
2827
5C54878E1B608FB50088272A /* config.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C54878C1B608FA70088272A /* config.json */; };
2928
5C54878F1B608FB50088272A /* config.json.local in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C54878D1B608FA70088272A /* config.json.local */; };
29+
5C56D4DA1BB2F11E0024467C /* img_kernels.metallib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5C56D4D91BB2F11E0024467C /* img_kernels.metallib */; };
3030
5C8FD0B61AD338A500215230 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CD2175119E924E80049D6AE /* main.cpp */; };
3131
5C8FD0BD1AD3393700215230 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C8FD0BA1AD3393700215230 /* Images.xcassets */; };
3232
5CD5AEB41AE1BD1600E1891C /* gl_blur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CD5AEB21AE1BD1600E1891C /* gl_blur.cpp */; };
@@ -41,7 +41,7 @@
4141
files = (
4242
5C54878E1B608FB50088272A /* config.json in CopyFiles */,
4343
5C54878F1B608FB50088272A /* config.json.local in CopyFiles */,
44-
5C30CAA51AA625F5008986B1 /* img.metallib in CopyFiles */,
44+
5C56D4DA1BB2F11E0024467C /* img_kernels.metallib in CopyFiles */,
4545
);
4646
runOnlyForDeploymentPostprocessing = 0;
4747
};
@@ -64,10 +64,10 @@
6464
5C0071D51A91FFD600F4711D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
6565
5C0071D71A91FFE600F4711D /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib/libxml2.2.dylib; sourceTree = DEVELOPER_DIR; };
6666
5C0071D91A91FFF400F4711D /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
67-
5C30CAA31AA625DC008986B1 /* img.metallib */ = {isa = PBXFileReference; lastKnownFileType = "archive.metal-library"; name = img.metallib; path = ../data/img.metallib; sourceTree = "<group>"; };
6867
5C54774B1AD645AF00F55003 /* img_kernels.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = img_kernels.cpp; sourceTree = "<group>"; };
6968
5C54878C1B608FA70088272A /* config.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = config.json; path = ../data/config.json; sourceTree = "<group>"; };
7069
5C54878D1B608FA70088272A /* config.json.local */ = {isa = PBXFileReference; lastKnownFileType = text; name = config.json.local; path = ../data/config.json.local; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.javascript; };
70+
5C56D4D91BB2F11E0024467C /* img_kernels.metallib */ = {isa = PBXFileReference; lastKnownFileType = "archive.metal-library"; name = img_kernels.metallib; path = ../data/img_kernels.metallib; sourceTree = "<group>"; };
7171
5C8FD0941AD3366800215230 /* imgd.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = imgd.app; sourceTree = BUILT_PRODUCTS_DIR; };
7272
5C8FD0BA1AD3393700215230 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = src/osx/Images.xcassets; sourceTree = "<group>"; };
7373
5C8FD0BC1AD3393700215230 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = src/osx/Info.plist; sourceTree = "<group>"; };
@@ -133,7 +133,7 @@
133133
5C0071E01A9200D400F4711D /* data */ = {
134134
isa = PBXGroup;
135135
children = (
136-
5C30CAA31AA625DC008986B1 /* img.metallib */,
136+
5C56D4D91BB2F11E0024467C /* img_kernels.metallib */,
137137
5C54878C1B608FA70088272A /* config.json */,
138138
5C54878D1B608FA70088272A /* config.json.local */,
139139
);
@@ -295,7 +295,7 @@
295295
);
296296
runOnlyForDeploymentPostprocessing = 0;
297297
shellPath = /bin/sh;
298-
shellScript = "cd src\nocc --src img.cpp --target air --sub-target ios8 --no-double -vv --config ../../../data/\nmetal-as -o=img.air air_processed.ll\nmetal-ar r img.a img.air\nmetallib -o ../../data/img.metallib img.a\n";
298+
shellScript = "cd src\nocc --src img_kernels.cpp --target air --sub-target ios8 --no-double -vv --config ../../../data/\nmetal-as -o=img_kernels.air air_processed.ll\nmetal-ar r img_kernels.a img_kernels.air\nmetallib -o ../../data/img_kernels.metallib img_kernels.a\n";
299299
};
300300
/* End PBXShellScriptBuildPhase section */
301301

@@ -359,7 +359,7 @@
359359
LIBRARY_SEARCH_PATHS = (
360360
"$(SDKROOT)/usr/lib",
361361
/opt/floor/lib,
362-
/opt/floor/include/ios/deps/lib,
362+
/opt/floor/include/floor/ios/deps/lib,
363363
);
364364
ONLY_ACTIVE_ARCH = YES;
365365
OTHER_CFLAGS = (
@@ -434,7 +434,7 @@
434434
LIBRARY_SEARCH_PATHS = (
435435
"$(SDKROOT)/usr/lib",
436436
/opt/floor/lib,
437-
/opt/floor/include/ios/deps/lib,
437+
/opt/floor/include/floor/ios/deps/lib,
438438
);
439439
ONLY_ACTIVE_ARCH = YES;
440440
OTHER_CFLAGS = (

img/src/gl_blur.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include "gl_blur.hpp"
2020

21+
#if !defined(FLOOR_IOS)
22+
2123
static shared_ptr<floor_shader_object> h_blur_shd, v_blur_shd;
2224
static GLuint rtt_fbo { 0u };
2325

@@ -154,3 +156,5 @@ void gl_blur::blur(const GLuint& tex_src, const GLuint& tex_dst, const GLuint& t
154156

155157
glBindFramebuffer(GL_FRAMEBUFFER, FLOOR_DEFAULT_FRAMEBUFFER);
156158
}
159+
160+
#endif

img/src/gl_blur.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef __FLOOR_IMG_GL_BLUR_HPP__
2020
#define __FLOOR_IMG_GL_BLUR_HPP__
2121

22+
#if !defined(FLOOR_IOS)
23+
2224
#include <floor/floor/floor.hpp>
2325
#include <floor/compute/compute_context.hpp>
2426
#include <floor/core/gl_shader.hpp>
@@ -32,3 +34,5 @@ struct gl_blur {
3234
};
3335

3436
#endif
37+
38+
#endif

img/src/main.cpp

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,22 @@ struct img_option_context {
3030
typedef option_handler<img_option_context> img_opt_handler;
3131

3232
static bool done { false };
33-
static bool no_opengl { false };
33+
static bool no_opengl {
34+
#if !defined(FLOOR_IOS)
35+
false
36+
#else
37+
true
38+
#endif
39+
};
3440
static bool run_gl_blur { false };
3541
static bool second_cache { true };
36-
static bool dumb { false };
42+
static bool dumb {
43+
#if !defined(FLOOR_IOS)
44+
false
45+
#else
46+
true
47+
#endif
48+
};
3749
static uint32_t cur_image { 0 };
3850
static uint2 image_size { 1024 };
3951
static constexpr const uint32_t tap_count { TAP_COUNT };
@@ -124,11 +136,14 @@ static bool evt_handler(EVENT_TYPE type, shared_ptr<event_object> obj) {
124136

125137
/////////////////
126138
// TODO: creata a common header/source file ...
127-
139+
140+
#if !defined(FLOOR_IOS)
128141
static GLuint vbo_fullscreen_triangle { 0 };
129142
static uint32_t global_vao { 0 };
143+
#endif
130144
static unordered_map<string, shared_ptr<floor_shader_object>> shader_objects;
131-
145+
146+
#if !defined(FLOOR_IOS)
132147
static void gl_render(shared_ptr<compute_queue> dev_queue floor_unused, shared_ptr<compute_image> img) {
133148
// draws ogl stuff
134149
// don't need to clear, drawing the complete screen
@@ -203,6 +218,7 @@ static bool gl_init() {
203218

204219
return compile_shaders();
205220
}
221+
#endif
206222

207223
/////////////////
208224
int main(int, char* argv[]) {
@@ -231,8 +247,10 @@ int main(int, char* argv[]) {
231247
floor::acquire_context();
232248

233249
if(!no_opengl) {
250+
#if !defined(FLOOR_IOS)
234251
if(!gl_init()) return -1;
235252
if(run_gl_blur && !gl_blur::init(image_size, tap_count)) return -1;
253+
#endif
236254
}
237255

238256
// add event handlers
@@ -268,16 +286,30 @@ int main(int, char* argv[]) {
268286
#else
269287
// for now: use a precompiled metal lib instead of compiling at runtime
270288
const vector<llvm_compute::kernel_info> kernel_infos {
289+
// non-functional right now
290+
/*{
291+
"image_blur_single_stage",
292+
{
293+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
294+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
295+
}
296+
},*/
271297
{
272-
"image_blur",
273-
{ 0, 0 },
298+
"image_blur_dumb_horizontal",
274299
{
275-
llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE,
276-
llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE,
300+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
301+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
302+
}
303+
},
304+
{
305+
"image_blur_dumb_vertical",
306+
{
307+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
308+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
277309
}
278310
},
279311
};
280-
auto img_prog = compute_ctx->add_precompiled_program_file(floor::data_path("img.metallib"), kernel_infos);
312+
auto img_prog = compute_ctx->add_precompiled_program_file(floor::data_path("img_kernels.metallib"), kernel_infos);
281313
#endif
282314
if(img_prog == nullptr) {
283315
log_error("program compilation failed");
@@ -286,7 +318,10 @@ int main(int, char* argv[]) {
286318
auto image_blur = img_prog->get_kernel("image_blur_single_stage");
287319
auto image_blur_dumb_v = img_prog->get_kernel("image_blur_dumb_vertical");
288320
auto image_blur_dumb_h = img_prog->get_kernel("image_blur_dumb_horizontal");
289-
if(image_blur == nullptr ||
321+
if(
322+
#if !defined(FLOOR_IOS)
323+
image_blur == nullptr ||
324+
#endif
290325
image_blur_dumb_v == nullptr ||
291326
image_blur_dumb_h == nullptr) {
292327
log_error("failed to retrieve kernel from program");
@@ -390,6 +425,7 @@ int main(int, char* argv[]) {
390425
}
391426
}
392427

428+
#if !defined(FLOOR_IOS)
393429
// -> opengl/glsl blur
394430
if(run_gl_blur) {
395431
// flush/finish again after acquire (just to be sure _everything_ has completed)
@@ -405,6 +441,7 @@ int main(int, char* argv[]) {
405441
log_debug("blur run in %fms", double(gl_blur_end) / 1000.0);
406442
}
407443
}
444+
#endif
408445

409446
// render output image by default
410447
cur_image = 1;
@@ -444,7 +481,9 @@ int main(int, char* argv[]) {
444481
// opengl rendering
445482
else if(!no_opengl) {
446483
floor::start_draw();
484+
#if !defined(FLOOR_IOS)
447485
gl_render(dev_queue, imgs[cur_image]);
486+
#endif
448487
floor::stop_draw();
449488
}
450489
}

nbody/nbody.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@
376376
LIBRARY_SEARCH_PATHS = (
377377
"$(SDKROOT)/usr/lib",
378378
/opt/floor/lib,
379-
/opt/floor/include/ios/deps/lib,
379+
/opt/floor/include/floor/ios/deps/lib,
380380
);
381381
ONLY_ACTIVE_ARCH = YES;
382382
OTHER_CFLAGS = (
@@ -453,7 +453,7 @@
453453
LIBRARY_SEARCH_PATHS = (
454454
"$(SDKROOT)/usr/lib",
455455
/opt/floor/lib,
456-
/opt/floor/include/ios/deps/lib,
456+
/opt/floor/include/floor/ios/deps/lib,
457457
);
458458
ONLY_ACTIVE_ARCH = YES;
459459
OTHER_CFLAGS = (

path_tracer/path_tracer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@
344344
LIBRARY_SEARCH_PATHS = (
345345
"$(SDKROOT)/usr/lib",
346346
/opt/floor/lib,
347-
/opt/floor/include/ios/deps/lib,
347+
/opt/floor/include/floor/ios/deps/lib,
348348
);
349349
ONLY_ACTIVE_ARCH = YES;
350350
OTHER_CFLAGS = (
@@ -420,7 +420,7 @@
420420
LIBRARY_SEARCH_PATHS = (
421421
"$(SDKROOT)/usr/lib",
422422
/opt/floor/lib,
423-
/opt/floor/include/ios/deps/lib,
423+
/opt/floor/include/floor/ios/deps/lib,
424424
);
425425
ONLY_ACTIVE_ARCH = YES;
426426
OTHER_CFLAGS = (

warp/src/gl_renderer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <floor/core/gl_shader.hpp>
2121
#include <floor/core/timer.hpp>
2222

23+
#if !defined(FLOOR_IOS)
24+
2325
static unordered_map<string, shared_ptr<floor_shader_object>> shader_objects;
2426
static GLuint vbo_fullscreen_triangle { 0 };
2527
static struct {
@@ -811,3 +813,9 @@ bool gl_renderer::compile_shaders() {
811813
}
812814
return true;
813815
}
816+
817+
#else
818+
bool gl_renderer::init() { return false; }
819+
void gl_renderer::destroy() {}
820+
bool gl_renderer::render(const gl_obj_model&, const camera&) { return false; }
821+
#endif

warp/src/main.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,34 @@ static bool compile_program() {
6262
" -DSCREEN_HEIGHT=" + to_string(floor::get_physical_height()) +
6363
" -DSCREEN_FOV=" + to_string(warp_state.fov));
6464
#else
65-
// TODO
65+
// for now: use a precompiled metal lib instead of compiling at runtime
66+
const vector<llvm_compute::kernel_info> kernel_infos {
67+
{
68+
"warp_scatter_simple",
69+
{
70+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
71+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
72+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
73+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
74+
llvm_compute::kernel_info::kernel_arg_info { .size = 4, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::CONSTANT },
75+
llvm_compute::kernel_info::kernel_arg_info { .size = 16, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::CONSTANT },
76+
}
77+
},
78+
{
79+
"single_px_fixup",
80+
{
81+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
82+
}
83+
},
84+
{
85+
"img_clear",
86+
{
87+
llvm_compute::kernel_info::kernel_arg_info { .size = 0, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::IMAGE },
88+
llvm_compute::kernel_info::kernel_arg_info { .size = 16, llvm_compute::kernel_info::ARG_ADDRESS_SPACE::CONSTANT },
89+
}
90+
},
91+
};
92+
auto new_warp_prog = warp_state.ctx->add_precompiled_program_file(floor::data_path("warp.metallib"), kernel_infos);
6693
#endif
6794
if(new_warp_prog == nullptr) {
6895
log_error("program compilation failed");

warp/src/obj_loader.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <floor/constexpr/const_string.hpp>
2828
#include <floor/core/core.hpp>
2929
#include <floor/threading/task.hpp>
30+
#include <floor/core/gl_support.hpp>
3031

3132
#if defined(__APPLE__)
3233
#include <SDL2_image/SDL_image.h>
@@ -36,14 +37,15 @@
3637
#include <SDL_image.h>
3738
#endif
3839

40+
// -> opengl
41+
#if !defined(FLOOR_IOS)
3942
#if !defined(GL_BGRA8)
4043
#define GL_BGRA8 GL_BGRA
4144
#endif
4245
#if !defined(GL_BGR8)
4346
#define GL_BGR8 GL_BGR
4447
#endif
4548

46-
// -> opengl
4749
#define __TEXTURE_FORMATS(F, src_surface, dst_internal_format, dst_format, dst_type) \
4850
F(src_surface, dst_internal_format, dst_format, dst_type, GL_R8, GL_RED, GL_UNSIGNED_BYTE, 8, 0, 0, 0, 0) \
4951
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, 16, 0, 8, 0, 0) \
@@ -57,6 +59,27 @@ F(src_surface, dst_internal_format, dst_format, dst_type, GL_R16, GL_RED, GL_UNS
5759
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RG16, GL_RG, GL_UNSIGNED_SHORT, 32, 0, 16, 0, 0) \
5860
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, 48, 0, 16, 32, 0) \
5961
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, 64, 0, 16, 32, 48)
62+
#else
63+
// these are necessary to correctly convert bgr textures to rgb
64+
#define FLOOR_IOS_GL_BGR 1
65+
#define FLOOR_IOS_GL_BGR8 2
66+
#if !defined(GL_BGRA8)
67+
#define GL_BGRA8 GL_BGRA
68+
#endif
69+
#if !defined(GL_BGR)
70+
#define GL_BGR FLOOR_IOS_GL_BGR
71+
#endif
72+
73+
#define __TEXTURE_FORMATS(F, src_surface, dst_internal_format, dst_format, dst_type) \
74+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_R8, GL_RED, GL_UNSIGNED_BYTE, 8, 0, 0, 0, 0) \
75+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RG8, GL_RG, GL_UNSIGNED_BYTE, 16, 0, 8, 0, 0) \
76+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, 24, 0, 8, 16, 0) \
77+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE, 32, 0, 8, 16, 0) \
78+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, 32, 0, 8, 16, 24) \
79+
F(src_surface, dst_internal_format, dst_format, dst_type, FLOOR_IOS_GL_BGR8, FLOOR_IOS_GL_BGR, GL_UNSIGNED_BYTE, 24, 16, 8, 0, 0) \
80+
F(src_surface, dst_internal_format, dst_format, dst_type, FLOOR_IOS_GL_BGR8, GL_BGRA, GL_UNSIGNED_BYTE, 32, 16, 8, 0, 0) \
81+
F(src_surface, dst_internal_format, dst_format, dst_type, GL_BGRA8, GL_BGRA, GL_UNSIGNED_BYTE, 32, 16, 8, 0, 24)
82+
#endif
6083

6184
#define __CHECK_FORMAT(src_surface, dst_internal_format, dst_format, dst_type, \
6285
gl_internal_format, gl_format, gl_type, bpp, rshift, gshift, bshift, ashift) \
@@ -535,6 +558,7 @@ static void load_textures(// file name -> <gl tex id, compute image ptr>
535558
}
536559
log_debug("%u textures loaded to mem", surfaces.size());
537560

561+
#if !defined(FLOOR_IOS)
538562
if(is_opengl) {
539563
// create gl textures
540564
model_gl_textures->resize(surfaces.size());
@@ -573,7 +597,9 @@ static void load_textures(// file name -> <gl tex id, compute image ptr>
573597
}
574598
log_debug("gl textures created");
575599
}
576-
else {
600+
else
601+
#endif
602+
{
577603
// create metal textures
578604
model_metal_textures->resize(surfaces.size());
579605
for(size_t i = 0, count = model_metal_textures->size(); i < count; ++i) {

0 commit comments

Comments
 (0)