Skip to content

Commit

Permalink
New properties for render invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
litherum authored and Litherum committed Aug 30, 2015
1 parent 4f6892c commit 060b8cd
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 2 deletions.
24 changes: 24 additions & 0 deletions MetalEditor.xcodeproj/project.pbxproj
Expand Up @@ -10,6 +10,14 @@
C204C9881B79C82C008057D3 /* RenderInvocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C204C9871B79C82C008057D3 /* RenderInvocationViewController.swift */; };
C204C98A1B79D042008057D3 /* BindingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C204C9891B79D042008057D3 /* BindingsViewController.swift */; };
C204C98C1B79D2AE008057D3 /* BindingsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C204C98B1B79D2AE008057D3 /* BindingsView.xib */; };
C227E94A1B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E9481B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift */; settings = {ASSET_TAGS = (); }; };
C227E94B1B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E9481B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift */; settings = {ASSET_TAGS = (); }; };
C227E94C1B92968B0012B8B8 /* ScissorRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E9491B92968B0012B8B8 /* ScissorRect.swift */; settings = {ASSET_TAGS = (); }; };
C227E94D1B92968B0012B8B8 /* ScissorRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E9491B92968B0012B8B8 /* ScissorRect.swift */; settings = {ASSET_TAGS = (); }; };
C227E9501B9299850012B8B8 /* Viewport+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E94E1B9299850012B8B8 /* Viewport+CoreDataProperties.swift */; settings = {ASSET_TAGS = (); }; };
C227E9511B9299850012B8B8 /* Viewport+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E94E1B9299850012B8B8 /* Viewport+CoreDataProperties.swift */; settings = {ASSET_TAGS = (); }; };
C227E9521B9299850012B8B8 /* Viewport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E94F1B9299850012B8B8 /* Viewport.swift */; settings = {ASSET_TAGS = (); }; };
C227E9531B9299850012B8B8 /* Viewport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227E94F1B9299850012B8B8 /* Viewport.swift */; settings = {ASSET_TAGS = (); }; };
C23492BB1B75E62B00712575 /* VertexAttributesTableDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23492BA1B75E62B00712575 /* VertexAttributesTableDelegate.swift */; };
C23492BD1B75E64B00712575 /* VertexBufferLayoutTableDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23492BC1B75E64B00712575 /* VertexBufferLayoutTableDelegate.swift */; };
C23492BF1B75E66800712575 /* ColorAttachmentsTableDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23492BE1B75E66800712575 /* ColorAttachmentsTableDelegate.swift */; };
Expand Down Expand Up @@ -151,6 +159,10 @@
C204C9871B79C82C008057D3 /* RenderInvocationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RenderInvocationViewController.swift; sourceTree = "<group>"; };
C204C9891B79D042008057D3 /* BindingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BindingsViewController.swift; sourceTree = "<group>"; };
C204C98B1B79D2AE008057D3 /* BindingsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BindingsView.xib; sourceTree = "<group>"; };
C227E9481B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ScissorRect+CoreDataProperties.swift"; sourceTree = "<group>"; };
C227E9491B92968B0012B8B8 /* ScissorRect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScissorRect.swift; sourceTree = "<group>"; };
C227E94E1B9299850012B8B8 /* Viewport+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Viewport+CoreDataProperties.swift"; sourceTree = "<group>"; };
C227E94F1B9299850012B8B8 /* Viewport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Viewport.swift; sourceTree = "<group>"; };
C23492BA1B75E62B00712575 /* VertexAttributesTableDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VertexAttributesTableDelegate.swift; sourceTree = "<group>"; };
C23492BC1B75E64B00712575 /* VertexBufferLayoutTableDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VertexBufferLayoutTableDelegate.swift; sourceTree = "<group>"; };
C23492BE1B75E66800712575 /* ColorAttachmentsTableDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorAttachmentsTableDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -264,6 +276,10 @@
C2205E1A1B5A15A70046F04D /* Managed Objects */ = {
isa = PBXGroup;
children = (
C227E94E1B9299850012B8B8 /* Viewport+CoreDataProperties.swift */,
C227E94F1B9299850012B8B8 /* Viewport.swift */,
C227E9481B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift */,
C227E9491B92968B0012B8B8 /* ScissorRect.swift */,
C24CDD4F1B5AFB3900348941 /* RenderInvocation+CoreDataProperties.swift */,
C24CDD501B5AFB3900348941 /* RenderInvocation.swift */,
C24CDCF81B5AC86D00348941 /* VertexAttribute+CoreDataProperties.swift */,
Expand Down Expand Up @@ -560,6 +576,7 @@
C26C8D9A1B8127320097180D /* Texture.swift in Sources */,
C24CDD351B5ADE0F00348941 /* RenderPipelineState+CoreDataProperties.swift in Sources */,
C24CDD461B5ADE0F00348941 /* ComputePipelineState.swift in Sources */,
C227E94D1B92968B0012B8B8 /* ScissorRect.swift in Sources */,
C24CDD2D1B5ADDFD00348941 /* VertexAttribute+CoreDataProperties.swift in Sources */,
C24CDD3B1B5ADE0F00348941 /* ComputeInvocation+CoreDataProperties.swift in Sources */,
C24CDD401B5ADE0F00348941 /* Pass.swift in Sources */,
Expand All @@ -576,7 +593,9 @@
C2EC39B81B78664300FFD859 /* Invocation+CoreDataProperties.swift in Sources */,
C2C1F3751B70AAAB0092726F /* ManagedObjectHelpers.swift in Sources */,
C26C8D9B1B8127350097180D /* Texture+CoreDataProperties.swift in Sources */,
C227E9511B9299850012B8B8 /* Viewport+CoreDataProperties.swift in Sources */,
C24CDD411B5ADE0F00348941 /* Frame+CoreDataProperties.swift in Sources */,
C227E94B1B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift in Sources */,
C26C8DA31B8145170097180D /* TextureBinding+CoreDataProperties.swift in Sources */,
C24CDD381B5ADE0F00348941 /* RenderPass.swift in Sources */,
C24CDD3F1B5ADE0F00348941 /* Pass+CoreDataProperties.swift in Sources */,
Expand All @@ -590,6 +609,7 @@
C24CDD3C1B5ADE0F00348941 /* ComputeInvocation.swift in Sources */,
C24CDD451B5ADE0F00348941 /* ComputePipelineState+CoreDataProperties.swift in Sources */,
C24CDD071B5AD8E600348941 /* main.swift in Sources */,
C227E9531B9299850012B8B8 /* Viewport.swift in Sources */,
C24CDD561B5B32BA00348941 /* Shaders.metal in Sources */,
C24CDD491B5ADE0F00348941 /* BufferBinding+CoreDataProperties.swift in Sources */,
);
Expand Down Expand Up @@ -631,6 +651,7 @@
C24CDCFF1B5AC86D00348941 /* VertexBufferLayout.swift in Sources */,
C24CDCF11B5AC44000348941 /* RenderPipelineColorAttachment.swift in Sources */,
C24CDCFE1B5AC86D00348941 /* VertexBufferLayout+CoreDataProperties.swift in Sources */,
C227E94C1B92968B0012B8B8 /* ScissorRect.swift in Sources */,
C24CDD511B5AFB3900348941 /* RenderInvocation+CoreDataProperties.swift in Sources */,
C2C1F3741B70A02E0092726F /* ManagedObjectHelpers.swift in Sources */,
C24CDCBF1B5A18D200348941 /* Library+CoreDataProperties.swift in Sources */,
Expand All @@ -644,9 +665,12 @@
C24CDCFD1B5AC86D00348941 /* VertexAttribute.swift in Sources */,
C24CDCF71B5AC44000348941 /* RenderPass.swift in Sources */,
C24CDCBB1B5A18D200348941 /* Buffer+CoreDataProperties.swift in Sources */,
C227E9501B9299850012B8B8 /* Viewport+CoreDataProperties.swift in Sources */,
C2EC39B41B78653B00FFD859 /* Invocation.swift in Sources */,
C26C8DA71B81542D0097180D /* TextureBindingsViewController.swift in Sources */,
C227E9521B9299850012B8B8 /* Viewport.swift in Sources */,
C24CDCF51B5AC44000348941 /* RenderPipelineState.swift in Sources */,
C227E94A1B92968B0012B8B8 /* ScissorRect+CoreDataProperties.swift in Sources */,
C24CDCB81B5A18D200348941 /* Pass.swift in Sources */,
C204C9881B79C82C008057D3 /* RenderInvocationViewController.swift in Sources */,
C2EC39BC1B7874AA00FFD859 /* ComputeInvocationViewController.swift in Sources */,
Expand Down
Binary file not shown.
37 changes: 36 additions & 1 deletion MetalEditor/Document.xcdatamodeld/Document.xcdatamodel/contents
Expand Up @@ -41,15 +41,32 @@
<relationship name="frame" maxCount="1" deletionRule="Nullify" destinationEntity="Frame" inverseName="passes" inverseEntity="Frame" syncable="YES"/>
</entity>
<entity name="RenderInvocation" representedClassName=".RenderInvocation" parentEntity="Invocation" syncable="YES">
<attribute name="blendColorAlpha" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="blendColorBlue" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="blendColorGreen" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="blendColorRed" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="cullMode" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
<attribute name="depthBias" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="depthClamp" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="depthClipMode" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
<attribute name="depthSlopeScale" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
<attribute name="frontFacingWinding" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
<attribute name="primitive" attributeType="Integer 16" syncable="YES"/>
<attribute name="stencilBackReferenceValue" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="stencilFrontReferenceValue" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="triangleFillMode" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
<attribute name="vertexCount" attributeType="Integer 32" syncable="YES"/>
<attribute name="vertexStart" attributeType="Integer 32" syncable="YES"/>
<attribute name="visibilityResultMode" attributeType="Integer 16" defaultValueString="0" syncable="YES"/>
<attribute name="visibilityResultOffset" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<relationship name="fragmentBufferBindings" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="BufferBinding" inverseName="renderInvocationFragment" inverseEntity="BufferBinding" syncable="YES"/>
<relationship name="fragmentTextureBindings" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="TextureBinding" inverseName="renderInvocationFragment" inverseEntity="TextureBinding" syncable="YES"/>
<relationship name="pass" maxCount="1" deletionRule="Nullify" destinationEntity="RenderPass" inverseName="invocations" inverseEntity="RenderPass" syncable="YES"/>
<relationship name="scissorRect" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="ScissorRect" inverseName="renderInvocation" inverseEntity="ScissorRect" syncable="YES"/>
<relationship name="state" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="RenderPipelineState" inverseName="invocations" inverseEntity="RenderPipelineState" syncable="YES"/>
<relationship name="vertexBufferBindings" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="BufferBinding" inverseName="renderInvocationVertex" inverseEntity="BufferBinding" syncable="YES"/>
<relationship name="vertexTextureBindings" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="TextureBinding" inverseName="renderInvocationVertex" inverseEntity="TextureBinding" syncable="YES"/>
<relationship name="viewport" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Viewport" inverseName="renderInvocation" inverseEntity="Viewport" syncable="YES"/>
</entity>
<entity name="RenderPass" representedClassName=".RenderPass" parentEntity="Pass" syncable="YES">
<relationship name="invocations" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="RenderInvocation" inverseName="pass" inverseEntity="RenderInvocation" syncable="YES"/>
Expand Down Expand Up @@ -87,6 +104,13 @@
<relationship name="vertexAttributes" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="VertexAttribute" inverseName="state" inverseEntity="VertexAttribute" syncable="YES"/>
<relationship name="vertexBufferLayouts" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="VertexBufferLayout" inverseName="state" inverseEntity="VertexBufferLayout" syncable="YES"/>
</entity>
<entity name="ScissorRect" representedClassName=".ScissorRect" syncable="YES">
<attribute name="height" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="width" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="x" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="y" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<relationship name="renderInvocation" maxCount="1" deletionRule="Nullify" destinationEntity="RenderInvocation" inverseName="scissorRect" inverseEntity="RenderInvocation" syncable="YES"/>
</entity>
<entity name="Size" representedClassName=".Size" syncable="YES">
<attribute name="depth" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="height" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
Expand Down Expand Up @@ -128,6 +152,15 @@
<attribute name="stride" attributeType="Integer 32" syncable="YES"/>
<relationship name="state" maxCount="1" deletionRule="Nullify" destinationEntity="RenderPipelineState" inverseName="vertexBufferLayouts" inverseEntity="RenderPipelineState" syncable="YES"/>
</entity>
<entity name="Viewport" representedClassName=".Viewport" syncable="YES">
<attribute name="height" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="originX" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="originY" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="width" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="zFar" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="zNear" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<relationship name="renderInvocation" maxCount="1" deletionRule="Nullify" destinationEntity="RenderInvocation" inverseName="viewport" inverseEntity="RenderInvocation" syncable="YES"/>
</entity>
<elements>
<element name="Buffer" positionX="-18" positionY="45" width="128" height="120"/>
<element name="BufferBinding" positionX="0" positionY="63" width="128" height="105"/>
Expand All @@ -138,7 +171,7 @@
<element name="Invocation" positionX="-9" positionY="135" width="128" height="60"/>
<element name="Library" positionX="-63" positionY="-18" width="128" height="60"/>
<element name="Pass" positionX="0" positionY="81" width="128" height="60"/>
<element name="RenderInvocation" positionX="27" positionY="108" width="128" height="180"/>
<element name="RenderInvocation" positionX="27" positionY="108" width="128" height="435"/>
<element name="RenderPass" positionX="18" positionY="99" width="128" height="60"/>
<element name="RenderPipelineColorAttachment" positionX="-9" positionY="63" width="128" height="30"/>
<element name="RenderPipelineState" positionX="45" positionY="117" width="128" height="270"/>
Expand All @@ -147,5 +180,7 @@
<element name="TextureBinding" positionX="-9" positionY="135" width="128" height="105"/>
<element name="VertexAttribute" positionX="0" positionY="108" width="128" height="120"/>
<element name="VertexBufferLayout" positionX="9" positionY="117" width="128" height="120"/>
<element name="ScissorRect" positionX="-9" positionY="135" width="128" height="120"/>
<element name="Viewport" positionX="0" positionY="144" width="128" height="150"/>
</elements>
</model>
17 changes: 17 additions & 0 deletions MetalEditor/InvocationsViewController.swift
Expand Up @@ -51,6 +51,23 @@ class InvocationsViewController: NSViewController, InvocationRemoveObserver {
renderInvocation.primitive = MTLPrimitiveType.Triangle.rawValue
renderInvocation.vertexStart = 0
renderInvocation.vertexCount = 0
renderInvocation.blendColorRed = 0
renderInvocation.blendColorGreen = 0
renderInvocation.blendColorBlue = 0
renderInvocation.blendColorAlpha = 0
renderInvocation.cullMode = MTLCullMode.None.rawValue
renderInvocation.depthBias = 0
renderInvocation.depthSlopeScale = 0
renderInvocation.depthClamp = 0
renderInvocation.depthClipMode = MTLDepthClipMode.Clip.rawValue
renderInvocation.frontFacingWinding = MTLWinding.Clockwise.rawValue
renderInvocation.scissorRect = nil
renderInvocation.stencilFrontReferenceValue = 0
renderInvocation.stencilBackReferenceValue = 0
renderInvocation.triangleFillMode = MTLTriangleFillMode.Fill.rawValue
renderInvocation.viewport = nil
renderInvocation.visibilityResultMode = MTLVisibilityResultMode.Disabled.rawValue
renderInvocation.visibilityResultOffset = 0

renderPass.mutableOrderedSetValueForKey("invocations").addObject(renderInvocation)
addRenderInvocationView(renderInvocation)
Expand Down

0 comments on commit 060b8cd

Please sign in to comment.