Proof of concept for Algorithm objects

Next up compute kernel dispatch!
This commit is contained in:
Eryn Wells 2018-11-04 13:44:47 -05:00
parent 96730ecd41
commit 55a134882d
6 changed files with 160 additions and 34 deletions

View file

@ -0,0 +1,23 @@
//
// TerrainAlgorithms.metal
// Terrain2
//
// Created by Eryn Wells on 11/4/18.
// Copyright © 2018 Eryn Wells. All rights reserved.
//
#include <metal_stdlib>
#include "ShaderTypes.h"
using namespace metal;
kernel void zeroKernel(texture2d<float, access::write> outTexture [[texture(GeneratorTextureIndexOut)]],
uint2 tid [[thread_position_in_grid]])
{
outTexture.write(0, tid);
}
kernel void randomKernel(texture2d<float, access::write> outTexture [[texture(GeneratorTextureIndexOut)]],
uint2 tid [[thread_position_in_grid]])
{
}