Skip to content

Commit

Permalink
Make Metal run the first sample
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 12, 2025
1 parent 6233ddf commit ce365bb
Show file tree
Hide file tree
Showing 7 changed files with 357 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Backends/Graphics5/Metal/Sources/kope/metal/device.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void kope_metal_device_create_texture(kope_g5_device *device, const kope_g5_text
}

kope_g5_texture_format kope_metal_device_framebuffer_format(kope_g5_device *device) {
return KOPE_G5_TEXTURE_FORMAT_RGBA8_UNORM;
return KOPE_G5_TEXTURE_FORMAT_BGRA8_UNORM;
}

void kope_metal_device_execute_command_list(kope_g5_device *device, kope_g5_command_list *list) {
Expand Down
8 changes: 8 additions & 0 deletions Backends/Graphics5/Metal/Sources/kope/metal/metalunit.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#ifndef KOPE_METAL_UNIT_HEADER
#define KOPE_METAL_UNIT_HEADER

#include <kope/graphics5/device.h>

#include <assert.h>

#import <MetalKit/MTKView.h>

CAMetalLayer *getMetalLayer(void);

#endif
9 changes: 0 additions & 9 deletions Backends/Graphics5/Metal/Sources/kope/metal/metalunit.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#include "metalunit.h"

#include <kope/graphics5/device.h>

#include <assert.h>

#import <MetalKit/MTKView.h>

CAMetalLayer *getMetalLayer(void);
id getMetalLibrary(void);

#include "buffer.m"
#include "commandlist.m"
#include "descriptorset.m"
Expand Down
Loading

0 comments on commit ce365bb

Please sign in to comment.