コード例 #1
0
        public new static RootDescriptorTable Parse(BytecodeReader reader, BytecodeReader tableReader, RootSignatureVersion version)
        {
            var result = new RootDescriptorTable();
            var numDescriptorRanges    = tableReader.ReadUInt32();
            var descriptorRangesOffset = tableReader.ReadUInt32();
            var rangeReader            = reader.CopyAtOffset((int)descriptorRangesOffset);

            for (int i = 0; i < numDescriptorRanges; i++)
            {
                result.DescriptorRanges.Add(DescriptorRange.Parse(rangeReader, version));
            }
            return(result);
        }
コード例 #2
0
        public static DescriptorRange Parse(BytecodeReader rangeReader, RootSignatureVersion version)
        {
            var result = new DescriptorRange()
            {
                RangeType          = (DescriptorRangeType)rangeReader.ReadUInt32(),
                NumDescriptors     = rangeReader.ReadUInt32(),
                BaseShaderRegister = rangeReader.ReadUInt32(),
                RegisterSpace      = rangeReader.ReadUInt32(),
            };

            if (version == RootSignatureVersion.Version1_1)
            {
                result.Flags = (DescriptorRangeFlags)rangeReader.ReadUInt32();
            }
            result.OffsetInDescriptorsFromTableStart = rangeReader.ReadUInt32();
            return(result);
        }