MCPcopy Create free account
hub / github.com/alecazam/kram / OutputDeclaration

Method OutputDeclaration

hlslparser/src/MSLGenerator.cpp:934–956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934void MSLGenerator::OutputDeclaration(HLSLDeclaration* declaration)
935{
936 if (IsSamplerType(declaration->type)) {
937 m_writer.Write("%s sampler& %s", GetAddressSpaceName(declaration->type.baseType, declaration->type.addressSpace), declaration->name);
938 }
939 else if (IsTextureType(declaration->type)) {
940 const char* textureName = GetTypeName(declaration->type, true);
941 if (textureName)
942 m_writer.Write("%s %s& %s", GetAddressSpaceName(declaration->type.baseType, declaration->type.addressSpace), textureName, declaration->name);
943 else
944 Error("Unknown texture");
945 }
946 else {
947 OutputDeclaration(declaration->type, declaration->name, declaration->assignment);
948
949 declaration = declaration->nextDeclaration;
950 while (declaration != NULL) {
951 m_writer.Write(",");
952 OutputDeclarationBody(declaration->type, declaration->name, declaration->assignment);
953 declaration = declaration->nextDeclaration;
954 }
955 }
956}
957
958void MSLGenerator::OutputStruct(int indent, HLSLStruct* structure)
959{

Callers

nothing calls this directly

Calls 3

IsSamplerTypeFunction · 0.85
IsTextureTypeFunction · 0.85
WriteMethod · 0.80

Tested by

no test coverage detected