float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #define GLFW_INCLUDE_VULKAN | |
| #define VK_USE_PLATFORM_WIN32_KHR | |
| #include <GLFW/glfw3.h> | |
| #define GLFW_EXPOSE_NATIVE_WIN32 | |
| #include <GLFW/glfw3native.h> |
My hopes for deployable artifacts:
- Packages would be able to just describe how the things they build should get laid out in a tarball.
- We would implement this as part of the build, it should be super fast (we might want to consider actually generating the tar directly for portability & control purposes).
- Packages could have control over the permissions inside the tar file (ideally without having to manipulate the permissions in the filesystem, problematic sometimes if root permission in the tar is desired).
- The mechanism would support knowing how to handle RPATH issues.
- The mechanism would know how to handle libswift* portability issues.
- The mechanism would know how to handle cross-Linux distro issues.
- Unlike below, I wouldn't expect the mechanism to handle the GIT REVISION stuff, that belongs in a separate proposal.
- The mechanism would support typical Unix-y things, like bin, lib, libexec, share.
- The mechanism could support vendored assets like other DSOs or frameworks that can't l
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // First, let's test out the basic design. This is basically just an | |
| // HList. | |
| // This recurses to the right because that makes subscripting simpler, | |
| // at the cost of making appending impossible to generalize. | |
| public protocol TupleProtocol: RandomAccessCollection | |
| where Index == Int, IndexDistance == Int, Element == Any | |
| { | |
| associatedtype First | |
| associatedtype Rest //: TupleProtocol |
swiftc main.swift -emit-module-path main.swiftmodule -emit-executable -enable-private-imports -Xfrontend -enable-implicit-dynamic./main-> printsFrom original bar()swiftc -emit-library inject.swift -o inject.dylib -I . -Xlinker -undefined -Xlinker suppress -Xlinker -flat_namespace -Xfrontend -disable-access-controlDYLD_INSERT_LIBRARIES=inject.dylib ./main-> printsFrom replacement bar()
- Passing
-Xfrontend -enable-implicit-dynamicremoves you from having to adddynamicto everything you want to be replacable
OlderNewer