public static DebugResourceDeclarationToken Parse(DebugBytecodeReader reader, DebugShaderVersion version) { var token0 = reader.ReadUInt32("token0"); DebugOpcodeHeader.AddNotes(reader, token0); var resourceDimension = token0.DecodeValue <ResourceDimension>(11, 15); reader.AddNote("resourceDimension", resourceDimension); byte sampleCount; switch (resourceDimension) { case ResourceDimension.Texture2DMultiSampled: case ResourceDimension.Texture2DMultiSampledArray: sampleCount = token0.DecodeValue <byte>(16, 22); reader.AddNote("SampleCount", sampleCount); break; default: sampleCount = 0; break; } var operand = DebugOperand.Parse(reader, token0.DecodeValue <OpcodeType>(0, 10)); var returnType = DebugResourceReturnTypeToken.Parse(reader); var result = new DebugResourceDeclarationToken { ResourceDimension = resourceDimension, SampleCount = sampleCount, Operand = operand, ReturnType = returnType }; if (version.IsSM51) { result.SpaceIndex = reader.ReadUInt32("SpaceIndex"); } return(result); }
public static DebugTypedUnorderedAccessViewDeclarationToken Parse(DebugBytecodeReader reader, DebugShaderVersion version) { var token0 = reader.ReadUInt32("token0"); DebugOpcodeHeader.AddNotes(reader, token0); reader.AddNote("ResourceDimension", token0.DecodeValue <ResourceDimension>(11, 15)); reader.AddNote("Coherency", token0.DecodeValue <UnorderedAccessViewCoherency>(16, 16)); reader.AddNote("IsRasterOrderedAccess", token0.DecodeValue <bool>(17, 17)); var result = new DebugTypedUnorderedAccessViewDeclarationToken { ResourceDimension = token0.DecodeValue <ResourceDimension>(11, 15), Coherency = token0.DecodeValue <UnorderedAccessViewCoherency>(16, 16), IsRasterOrderedAccess = token0.DecodeValue <bool>(17, 17), Operand = DebugOperand.Parse(reader, token0.DecodeValue <OpcodeType>(0, 10)), ReturnType = DebugResourceReturnTypeToken.Parse(reader) }; if (version.IsSM51) { result.SpaceIndex = reader.ReadUInt32("SpaceIndex"); } return(result); }