mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 16:36:31 +00:00
MTLBufferLayoutDescriptor
This commit is contained in:
committed by
Jake Turner
parent
750983bd27
commit
70793c4f0a
@@ -234,6 +234,14 @@ void DoSerialise(SerialiserType &ser, RDMTL::AttributeDescriptor &el)
|
||||
SERIALISE_MEMBER(format);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, RDMTL::BufferLayoutDescriptor &el)
|
||||
{
|
||||
SERIALISE_MEMBER(stride);
|
||||
SERIALISE_MEMBER(stepFunction);
|
||||
SERIALISE_MEMBER(stepRate);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, RDMTL::FunctionGroup &el)
|
||||
{
|
||||
@@ -377,6 +385,7 @@ INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexAttributeDescriptor);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexBufferLayoutDescriptor);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexDescriptor);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::AttributeDescriptor);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::BufferLayoutDescriptor);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::FunctionGroup);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::LinkedFunctions);
|
||||
INSTANTIATE_SERIALISE_TYPE(RDMTL::RenderPipelineDescriptor);
|
||||
|
||||
@@ -1200,6 +1200,24 @@ rdcstr DoStringise(const MTL::AttributeFormat &el)
|
||||
END_ENUM_STRINGISE()
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const MTL::StepFunction &el)
|
||||
{
|
||||
BEGIN_ENUM_STRINGISE(MTL::StepFunction)
|
||||
{
|
||||
MTL_STRINGISE_ENUM(StepFunctionConstant);
|
||||
MTL_STRINGISE_ENUM(StepFunctionPerVertex);
|
||||
MTL_STRINGISE_ENUM(StepFunctionPerInstance);
|
||||
MTL_STRINGISE_ENUM(StepFunctionPerPatch);
|
||||
MTL_STRINGISE_ENUM(StepFunctionPerPatchControlPoint);
|
||||
MTL_STRINGISE_ENUM(StepFunctionThreadPositionInGridX);
|
||||
MTL_STRINGISE_ENUM(StepFunctionThreadPositionInGridY);
|
||||
MTL_STRINGISE_ENUM(StepFunctionThreadPositionInGridXIndexed);
|
||||
MTL_STRINGISE_ENUM(StepFunctionThreadPositionInGridYIndexed);
|
||||
}
|
||||
END_ENUM_STRINGISE()
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const MetalResourceType &el)
|
||||
{
|
||||
|
||||
@@ -334,6 +334,18 @@ void AttributeDescriptor::CopyTo(MTL::AttributeDescriptor *objc)
|
||||
objc->setFormat(format);
|
||||
}
|
||||
|
||||
BufferLayoutDescriptor::BufferLayoutDescriptor(MTL::BufferLayoutDescriptor *objc)
|
||||
: stride(objc->stride()), stepFunction(objc->stepFunction()), stepRate(objc->stepRate())
|
||||
{
|
||||
}
|
||||
|
||||
void BufferLayoutDescriptor::CopyTo(MTL::BufferLayoutDescriptor *objc)
|
||||
{
|
||||
objc->setStride(stride);
|
||||
objc->setStepFunction(stepFunction);
|
||||
objc->setStepRate(stepRate);
|
||||
}
|
||||
|
||||
LinkedFunctions::LinkedFunctions(MTL::LinkedFunctions *objc)
|
||||
{
|
||||
GETWRAPPEDNSARRAY(Function, functions);
|
||||
|
||||
@@ -163,6 +163,7 @@ MTL_DECLARE_REFLECTION_TYPE(DepthClipMode);
|
||||
MTL_DECLARE_REFLECTION_TYPE(TriangleFillMode);
|
||||
MTL_DECLARE_REFLECTION_TYPE(CullMode);
|
||||
MTL_DECLARE_REFLECTION_TYPE(IndexType);
|
||||
MTL_DECLARE_REFLECTION_TYPE(StepFunction);
|
||||
MTL_DECLARE_REFLECTION_TYPE(AttributeFormat);
|
||||
|
||||
template <>
|
||||
@@ -275,6 +276,18 @@ struct AttributeDescriptor
|
||||
MTL::AttributeFormat format = MTL::AttributeFormatInvalid;
|
||||
};
|
||||
|
||||
// MTLBufferLayoutDescriptor : based on the interface defined in
|
||||
// Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h
|
||||
struct BufferLayoutDescriptor
|
||||
{
|
||||
BufferLayoutDescriptor() = default;
|
||||
BufferLayoutDescriptor(MTL::BufferLayoutDescriptor *objc);
|
||||
void CopyTo(MTL::BufferLayoutDescriptor *objc);
|
||||
NS::UInteger stride = 0;
|
||||
MTL::StepFunction stepFunction = MTL::StepFunctionConstant;
|
||||
NS::UInteger stepRate = 0;
|
||||
};
|
||||
|
||||
// Helper struct for holding MTLLinkedFunctions::groups data
|
||||
// NSDictionary<NSString*, NSArray<id<MTLFunction>>*> *groups;
|
||||
struct FunctionGroup
|
||||
@@ -473,6 +486,7 @@ RDMTL_DECLARE_REFLECTION_STRUCT(VertexAttributeDescriptor);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(VertexBufferLayoutDescriptor);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(VertexDescriptor);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(AttributeDescriptor);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(BufferLayoutDescriptor);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(FunctionGroup);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(LinkedFunctions);
|
||||
RDMTL_DECLARE_REFLECTION_STRUCT(RenderPipelineDescriptor);
|
||||
|
||||
Reference in New Issue
Block a user