From 5942ff81d9a63ee1e37ba81172ea579646be774e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 30 Jan 2020 16:28:50 -0500 Subject: Support for 64 bit integer types (#1191) * * For integer literals add postfix, and use unsigned/signed output appropriately * Extend GLSL extension handling by type, and for adding 64 bit int extensions * Added tests for int/uint64 types * Add explicit Int/UInt64 emit functions to avoid ambiguity. --- source/slang/slang-emit-source-writer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/slang/slang-emit-source-writer.cpp') diff --git a/source/slang/slang-emit-source-writer.cpp b/source/slang/slang-emit-source-writer.cpp index 5661a48bb..8deecc846 100644 --- a/source/slang/slang-emit-source-writer.cpp +++ b/source/slang/slang-emit-source-writer.cpp @@ -197,6 +197,20 @@ void SourceWriter::emit(UInt value) emit(buffer); } +void SourceWriter::emitUInt64(uint64_t value) +{ + char buffer[32]; + sprintf(buffer, "%llu", (unsigned long long)(value)); + emit(buffer); +} + +void SourceWriter::emitInt64(int64_t value) +{ + char buffer[32]; + sprintf(buffer, "%lld", (long long int)value); + emit(buffer); +} + void SourceWriter::emit(int value) { char buffer[16]; -- cgit v1.2.3