Skip to content

Instantly share code, notes, and snippets.

@giraphics
giraphics / ExplicitDeallocateModel.cpp
Last active November 29, 2017 01:56
Explicit deallocation model
// This example shows a demo as per new deallocation model suggestion.
// Here, the derive class explicitly deallocates
// a. owned resources.
// b. based class resources
#include <iostream>
using namespace std;
class Position // GPU allocator/deallocator for position buffers
{
@giraphics
giraphics / ImplicitDeallocateModel.cpp
Last active November 20, 2017 12:41
Implicit deallocation model
// This example shows a demo as per existing Pan3D Model.
// Here, each class is responsible to release it own resources.
#include <iostream>
using namespace std;
class Position // GPU allocator/deallocator for position buffers
{
public:
Position() { cout << "Position Ctor" << endl; Allocate(); }
@giraphics
giraphics / run.sh
Last active September 16, 2022 18:06
Enabling Metal Validation Layer through command line application
# Enable Metal validation layer: 0FF-0, ON-1
export METAL_DEVICE_WRAPPER_TYPE=1
export METAL_ERROR_MODE=5
export METAL_DEBUG_ERROR_MODE=5
# Clean and make
make clean && make
# Execute
./YourExecutableName