Skip to content

Commit

Permalink
Update FullScreenQuad.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
gadirom committed Mar 12, 2023
1 parent aef5193 commit 64faf31
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/MetalBuilder/BuildingBlocks/FullScreenQuad.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ public struct FullScreenQuad: MetalBuildingBlock, Renderable {
}

//Renderable Protocol
internal var renderableData: RenderableData
public var renderableData: RenderableData
//

struct FullScreenQuadVertex: MetalStruct{
var coord: simd_float2 = [0, 0]
var uv: simd_float2 = [0, 0]
}

var context: MetalBuilderRenderingContext
var helpers = ""
var librarySource = ""
var compileOptions: MetalBuilderCompileOptions? = nil
public var context: MetalBuilderRenderingContext
public var helpers = ""
public var librarySource = ""
public var compileOptions: MetalBuilderCompileOptions? = nil

var sampleTexture: MTLTextureContainer! = nil

Expand All @@ -60,7 +60,7 @@ public struct FullScreenQuad: MetalBuildingBlock, Renderable {

@MetalBuffer<FullScreenQuadVertex>(count: 6, metalName: "quadBuffer") var quadBuffer

func startup(){
public func startup(){
//create quad
let p = quadBuffer.pointer!
p[0] = .init(coord: [-1, 1], uv: [0,0])
Expand All @@ -72,7 +72,7 @@ public struct FullScreenQuad: MetalBuildingBlock, Renderable {
p[5] = .init(coord: [1, -1], uv: [1,1])
}

var metalContent: MetalContent{
public var metalContent: MetalContent{
Render(type: .triangle, count: 6, renderableData: renderableData)
.vertexBuf(quadBuffer)
.vertexBytes(context.$viewportToDeviceTransform)
Expand Down

0 comments on commit 64faf31

Please sign in to comment.