Zorro666 / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org/builds
MIT License
3 stars 1 forks source link

DRAFT: Replace ObjC helpers with Metal-CPP #83

Closed Zorro666 closed 2 years ago

Zorro666 commented 2 years ago

Description

Extend Metal-CPP support to replace the ObjC helper methods and then remove the ObjC helper methods.

Added to Metal-CPP:

void CA::MetalLayer::setDevice(const MTL::Device *pDevice);
void CA::MetalLayer::setPixelFormat(const MTL::PixelFormat format);
void CA::MetalLayer::setDrawableSize(const CGSize size);
CA::MetalDrawable* CA::MetalLayer::nextDrawable();
CGFloat CA::MetalLayer::contentsScale() const;
CGRect CA::MetalLayer::bounds() const;

NS::Data *NS::Data::dataWithContentsOfFile(const String* path);
const void* NS::Data::bytes() const;

NS::String* NS::Bundle::pathForResource(const class String* pName, const class String* pExt) const;

Deleted ObjC helpers:

void ObjC::Get_defaultLibraryData(bytebuf &buffer);
MTL::Texture *ObjC::Get_Texture(MTL::Drawable *drawable);
CA::MetalLayer *ObjC::Get_Layer(MTL::Drawable *drawable);
void ObjC::CAMetalLayer_Set_drawableSize(void *layerHandle, int w, int h);
void ObjC::CAMetalLayer_Set_device(void *layerHandle, MTL::Device *device);
void ObjC::CAMetalLayer_Set_pixelFormat(void *layerHandle, MTL::PixelFormat format);
CA::MetalDrawable *ObjC::CAMetalLayer_nextDrawable(void *layerHandle);
void CALayer_GetSize(void *layerHandle, int &width, int &height);
Zorro666 commented 2 years ago

https://github.com/baldurk/renderdoc/pull/2671