Skip to content

Commit

Permalink
Scroll view 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 4138d19 commit eb9a181
Show file tree
Hide file tree
Showing 6 changed files with 1,047 additions and 1,005 deletions.
Binary file not shown.
Expand Up @@ -175,12 +175,12 @@
<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"/>
<element name="ScissorRect" positionX="-9" positionY="135" width="128" height="120"/>
<element name="Size" positionX="18" positionY="90" width="128" height="120"/>
<element name="Texture" positionX="-9" positionY="135" width="128" height="225"/>
<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>
2 changes: 1 addition & 1 deletion MetalEditor/InvocationSequence.xib
Expand Up @@ -58,7 +58,7 @@
<animations/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="cWx-mq-5o8">
<rect key="frame" x="419" y="1" width="15" height="270"/>
<rect key="frame" x="418" y="1" width="16" height="270"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
Expand Down
7 changes: 6 additions & 1 deletion MetalEditor/PreviewController.swift
Expand Up @@ -162,9 +162,14 @@ class PreviewController: NSViewController, MTKViewDelegate {
renderCommandEncoder.setCullMode(MTLCullMode(rawValue: invocation.cullMode.unsignedLongValue)!)
renderCommandEncoder.setDepthBias(invocation.depthBias.floatValue, slopeScale: invocation.depthSlopeScale.floatValue, clamp: invocation.depthClamp.floatValue)
renderCommandEncoder.setDepthClipMode(MTLDepthClipMode(rawValue: invocation.depthClipMode.unsignedLongValue)!)

let depthStencilDescriptor = MTLDepthStencilDescriptor()

renderCommandEncoder.setFrontFacingWinding(MTLWinding(rawValue: invocation.frontFacingWinding.unsignedLongValue)!)
if let scissorRect = invocation.scissorRect {
renderCommandEncoder.setScissorRect(MTLScissorRect(x: scissorRect.x.integerValue, y: scissorRect.y.integerValue, width: scissorRect.width.integerValue, height: scissorRect.height.integerValue))
if scissorRect.width.integerValue > 0 && scissorRect.height.integerValue > 0 {
renderCommandEncoder.setScissorRect(MTLScissorRect(x: scissorRect.x.integerValue, y: scissorRect.y.integerValue, width: scissorRect.width.integerValue, height: scissorRect.height.integerValue))
}
}
renderCommandEncoder.setStencilFrontReferenceValue(invocation.stencilFrontReferenceValue.unsignedIntValue, backReferenceValue: invocation.stencilBackReferenceValue.unsignedIntValue)
renderCommandEncoder.setTriangleFillMode(MTLTriangleFillMode(rawValue: invocation.triangleFillMode.unsignedLongValue)!)
Expand Down
1 change: 0 additions & 1 deletion MetalEditor/RenderInvocation+CoreDataProperties.swift
Expand Up @@ -31,7 +31,6 @@ extension RenderInvocation {
@NSManaged var depthSlopeScale: NSNumber
@NSManaged var depthClamp: NSNumber
@NSManaged var depthClipMode: NSNumber
// FIXME: Need depth / stencil state
@NSManaged var frontFacingWinding: NSNumber
@NSManaged var scissorRect: ScissorRect?
@NSManaged var stencilFrontReferenceValue: NSNumber
Expand Down

0 comments on commit eb9a181

Please sign in to comment.