-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/use panama #11
Open
ygdrasil-io
wants to merge
207
commits into
master
Choose a base branch
from
feature/use-panama
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Added classes related to the jextract tool that deals with the extraction of Java APIs from C headers. These include JextractTool.java and supporting classes, details about the position in source code (Position.java), and a pretty printer for declarations (PrettyPrinter.java). The settings.gradle.kts file was also updated to include jextract in the project configuration.
Added three main classes, JextractTool.java, Position.java, and PrettyPrinter.java, which are crucial for the functionality of jextract, a tool that helps extract Java APIs from C headers. These files are imperative for reading the C header files, keeping track of the source code's position, and displaying the declarations respectively. Also, gradle settings were updated to include jextract in the project files.
The commits include implementing Panama parsing to use jextract functionality, which aids in the processing of header files. More specifically, parseFile method now accepts parserTechnology parameter to choose between old JNA and the new Panama parsers. Aside from this, add preview options to java compile and test tasks.
The refactor extends the Scoped.toLocalDeclaration method to handle the native structure types. It also introduces new utilities in the panama package to convert these types. The changes enhance robustness and flexibility for different kind of data structures. Importantly, in this update all imports from klang.domain are now included for convenience.
The PanamaLibclangParser now supports parsing of functions and typedefs from C header files. The Scoped.toLocalDeclaration() method in PanamaLibclangParser.kt has been modified to handle these additional types. New test cases have been added to verify this functionality. Additionally, the code was refactored for better organization and readability.
LibClangParser has been enhanced to parse and test unions from C header files. Parsing of typedefs from C header files was improved for better structure and readability. Furthermore, redundant code and unused imports in PanamaLibclangParser were removed.
Modified the klang build file to determine the clang path dynamically based on the operating system, thus improving cross-platform compatibility. This is achieved using the inferPlatformClangPath function, which returns the appropriate directory after executing the command /usr/bin/xcode-select -p for Mac OS X. The function also handles IO errors and logs if the required libclang path is not found.
The identifiers in 'functions.h.ast.json' have been updated. Code has been added to define a new function 'function3' which returns a pointer to 'struct StructName', along with relevant changes to other functions and declarations. Structural changes for better code clarity and interoperability have also been made in the process.
The libclang path finder has been updated with a new Linux-specific clause. It now utilizes ProcessBuilder to locate the "libclang.so" file and return its directory. This adds support for Linux operating systems in the build script.
Changed the command in the Linux-specific block of the libclang path finding code. Replaced the "/usr/bin/locate" command with "/usr/bin/find" to ensure the Linux system effectively locates the "libclang.so" file, thus improving Linux support in the build script.
Refactored the `parseFile` function in `LibClangParser.kt` to improve file handling. The function now validates if the file exists before parsing and supports parsing with file object besides file name. The changes enhance error prevention and enable more flexible file handling options.
update jdk version
Enhanced inferPlatformClangPath function in `klang/build.gradle.kts` to log information about OS and clang paths for debugging. Also added a new task in `jextract/build.gradle.kts` to automatically download required `libclang` binaries during the build process.
…pport This update enhances the libclang loading process in 'RuntimeHelper.java' to ensure better cross-platform compatibility. It also modifies the 'klang/build.gradle.kts' file to extract and copy libclang binaries when required during the build phase. Lastly, it introduces a new method in 'TypeRef.kt' to accommodate 'TypeImpl.QualifiedImpl' instances.
The Type.toTypeRef() method in TypeRef.kt has been refactored to handle different kinds of `Delegated`. This modification maps several 'Delegated.Kind' instances like TYPEDEF, POINTER, etc. to their respective types, improving the method's overall flexibility and comprehensiveness.
The getTemporaryDirectory() method in RuntimeHelper.java has been updated to append a file separator to the end of the path, if one does not already exist. This ensures consistency and prevents potential issues with file path generation later on.
Renamed functions toNativeTypeAlias() in the native code and fixed a spelling mistake from inferEmbededLibraryFileName() to inferEmbeddedLibraryFileName() in RuntimeHelper.java. These names are now more accurate and consistent across different modules and the typo correction further enhances code readability.
Renamed and refactored several handling methods in PanamaLibclangParser.kt for handling specific declaration types. This includes 'Typedef' and 'Scoped'. Also these changes affect toNativeStructure and toNativeEnumeration in NativeStructure.kt and NativeEnumeration.kt respectively. The refactor enhances the readability and clarifies the specific functionalities of each method.
Refactored the Type handling in the TypeRef.kt file to clear up and simplify the handling of various Type cases. Added a new case for handling 'PrimitiveImpl' under the 'TypeImpl' case and improved the formatting for improved code readability. These changes help in more effective and clear type handling and representation.
Enhanced type handling in TypeRef.kt and refactored the conversion of structure fields in NativeStructure.kt. Specifically, modified 'DeclaredImpl' and 'QualifiedImpl' cases in Type, and restructured 'toStructureFields' function. This simplifies case handling and improves conversion consistency, aiding readability and maintainability.
This update introduces a parsing method option to the KlangPluginExtension class in KlangPlugin.kt, allowing the selection between Docker or Libclang. The method for generating Abstract Syntax Trees from Docker has been adapted to this change. Support for Libclang parsing has been acknowledged but remains to be fully implemented.
Libclang parsing method is now included in KlangPlugin, providing an additional option to Docker. The associated method for generating Abstract Syntax Trees (ASTs) has also been adapted. However, full feature set of Libclang parsing method still needs to be implemented.
Added a task 'unzipSDL2' to the build.gradle.kts file in the klang project that unzips SDL2 headers required for testing. Also updated the .gitignore to exclude these unzipped files from version control. This builds a foundation for more extensive integration testing in the future.
Extended the parseFile function in the klang project's LibClangParser to support filePath and headerPaths parameters. Also added a new unzipCHeaders task for unzipping C header files in build.gradle.kts. Additionally, created a new integration test to verify SDL2 parsing, and expanded the .gitignore to include these new directories.
Enhanced type parsing in the LibClang parser by updating handling for signed, unsigned, and array types. Also added exhaustive test cases for various C type definitions.
Added conditions to 'unzipSDL2' and 'unzipCHeaders' tasks in the build.gradle.kts to avoid unnecessary unzipping. Furthermore, the LibClang parser was improved to better handle Function type string conversions, including the modification of unsupported types handling.
This commit enhances the architecture recognition logic in the RuntimeHelper class. It now includes conditions to properly identify and return "arm64" for systems with an "aarch" architecture. This will ensure the correct delineation and handling of this architecture subtype.
Implemented the capability to create a Buffer in the Device and redefine how Buffer usages are defined. Created separate Buffer classes across different platforms for consistency and introduced BufferDescriptor for uniform Buffer properties specification. Minor updates to GPUBufferUsageFlags and 'mappedAtCreation' parameter were also made for better performance and flexibility.
Implemented a robust system to create and manage Buffers across platforms, ensuring easy usage and consistency. Introduced BufferDescriptor to standardize Buffer properties definition. Also optimized GPUBufferUsageFlags and adjusted 'mappedAtCreation' for improved performance and flexibility.
Updated the utility for buffers creation and management across different platforms. Introduced BufferDescriptor to standardize the definition of buffer properties. Also optimized GPUBufferUsageFlags and tweaked 'mappedAtCreation' to enhance performance and allocation flexibility.
Consolidated imports and enhanced the CommandEncoder in wgpu4k by adding depthStencilAttachment conversion. Also adjusted the scene setup code for the RotatingCube example in common. The refactor improves the overall readability and maintenance of the code.
Uncommented and implemented 'override var maxDrawCount' in CommandEncoder class within wgpu4k module. This allows setting of the maximum draw count, providing better control over rendering operations.
Added @JsExport annotation to classes in the wgpu bindings to expose them to JavaScript. Updated the 'getMappedRange' method in Buffer.jvm.kt to return a ByteArray. Added 'binaries.executable()' and 'generateTypeScriptDefinitions()' to the build.gradle.kts files inside wgpu4k and common modules.
This commit introduces main.ts as the central entry point for managing the samples of the WebGPU, including the creation of the code editor and table of contents. Necessary utility functions and repository infrastructures, such as tsconfig.json, have been added. The change also includes the creation of new event handlers for iframe resizing and sample selecting.
The web-js examples build file and main.ts have been refactored, removing unused configurations and improving the way the canvas is accessed. WebGPU samples have been updated to use the jsApplication function from the examples package to better manage the rendering context and device for the application running. To support these changes, supporting infrastructure such as the CanvasConfiguration class have been updated, and dependencies in the build file for WebGPU samples have been adjusted.
This update encompasses two significant changes. First, the Buffer's map function has been refactored to use Float32Array, which enables more efficient handling of buffer arrays. Second, the application setup and execution in RotatingCube example have been simplified by using jsApplication and adding run() function, eliminating the need for direct rendering context and device management in the example itself, resulting in a cleaner code structure.
The BindGroupEntry's resource descriptor has been refactored to support BindGroupDescriptor.BindGroupEntry.BufferBinding which now includes buffer, offset and size properties. This allows for more granular control over buffer properties within BindGroupEntries. Also, the TwoCubes example has been introduced showcasing the use of different uniformBindGroups for rendering of two separate cubes on the scene.
The TwoCubes example within the wgpu-webgpu-samples-ts project has been refactored to utilize a new kotlin library, resulting in much shorter and cleaner code. The main.ts file has been significantly simplified. The previously hard-coded configuration and rendering logic have now been incorporated into a new module within the kotlin library, thereby improving modularity and readability.
The `TwoCubes` and `RotatingCube` examples were revamped to utilize properties sourced from the newly created `Cube` object, dramatically enhancing code organization and readability. The changes entailed replacing inline cube data and attribute information with their counterparts from the new module, reducing complexity in each respective example scene.
…two shader files This commit includes updates in the `TwoCubes` and `RotatingCube` scenes where the proprietary vertex and fragment shaders were replaced with `basicVertexShader` and `fragmentVertexPositionColorShader` respectively. It also introduces the `TexturedCube` scene and adds two new shader files: `BasicVertexShader.kt` and `FragmentVertexPositionColorShader.kt`. Changes enhance modularity and allow more efficient usage of shaders across different scene examples.
Extended wgpu bindings with implementations for the createSampler function, GPUSamplerDescriptor object, and full support for Sampler and TextureView bindings in the BindGroup class. This addition enhances WebGPU capabilities in the Kotlin/JS environment by being able to correctly handle, initialize, and manage sampler resources from GPU devices.
Refactored asset handling code to transition from object-based to interface-based asset manager. This streamlined the retrieval of assets by introducing property-based asset retrieval. Furthermore, the update added an external image copying feature which allows for efficient copying of source images into GPU textures. These changes enhance asset and image management across JS and JVM contexts.
InstancedCubeScene is added to the available scenes, and a new file for it is created along with InstancedShader files. Existing scenes and shaders' files are updated to reflect the new file path following changes in the shaders' directory structure.
Modified the transformation matrix method in the InstancedCube.kt file to use an array of model matrices instead of a single projection matrix. This allows for individual transformations for each instance of a cube within the 3D space, providing greater flexibility in the creation of complex 3D scenes.
Implemented a FractalCubeScene in the example scenes. Updated the handling of textures in the Graphic Rendering pipeline by creating copyTextureToTexture function. Moved dummyTexture generation and CanvasConfiguration to the Application.kt.
Introduced a new `CubemapScene` in the example scenes with detailed buffer, pipeline, and principles. Additionally, a corresponding cube-map shader, `sampleCubemapShader`, has been created to facilitate rendering functionality.
A CubemapScene is added to the examples with detailed buffer and pipeline setup. Accompanying this development is the creation of `sampleCubemapShader`. This enhances the rendering functionality within the library. The new scene and shader help to display complex 3D graphics through cube mapping, demonstrating the enhanced capabilities of the library.
Implemented GLFW support and added new input handling classes to handle GLFW events, key mappings, and main application loop creation. Implemented a system detection feature to import correct OpenGL Windowing Framework (GLFW) dependencies, enhancing support for different operating systems. This upgrade allows GLFW utilization for a cross-platform window handling and input solution.
… GLFW platform support in the application. Changes include a defined key callback for changing scenes, a glfwDispatcher for handling windowing events, and adjustments to page keys for scene selection. Additionally, there were updates to the rendering context configuration for GLFW applications and the modification of methods in classes such as Device and Buffer. Changing the format parameter type in the CubeMap and FractalCube classes were also part of these changes. Lastly, several files have been deleted to further enhance the GLFW support.
Renamed the Device.kt file to Device.js.kt in the wgpu4k module. Additionally, an update was made to the convert function of the GPUVertexAttribute object within Device to use the name property when setting the format attribute. This change modifies how the format parameter is converted.
…Main.kt Methods were updated in `Buffer.jvm.kt` and `Device.jvm.kt` in the `wgpu4k` module, and a new import was added to `Buffer.jvm.kt`. `AssetManager` in `Main.kt` was also updated and a RotatingCubeScene was moved to the top of the `availableScenes` list. Other minor adjustments were made as well.
The update introduces a WGPULogCallback implementation in GlfwMain.kt which allows for logging to be customized and more informative. WGPU's setLogLevel function is invoked to set the log level. Changes have been made in the wgpu4k's TypeAlias.kt to revise the parameters of the function. Additional adjustments are made in RotatingCube.kt including buffer setup and multisample state.
…ture The code change enhances conversion of TextureDescriptor to WGPUTextureDescriptor in Device.jvm.kt and refines structure of WGPUTextureDescriptor in Structures.kt. Attributes in WGPUTextureDescriptor were updated to nullable integers catering for mipLevelCount, sampleCount, and dimension. The conversion function is modified to include more comprehensive properties.
Renamed 'BindGroupDescriptor.BindGroupEntry' in 'BindGroupDescriptor.BindGroupResource'. Created a new JVM test class 'DeviceDescriptoMapping' for testing the texture descriptor mapping. The enum 'TextureDimension' now includes a 'stringValue' property. Added several dependencies to support testing and better code structure.
Refactored the handling of BindGroupDescriptor for more accuracy. Extended 'TextureDimension' enum to include 'stringValue'. Introduced a test for texture descriptor mapping within the new 'DeviceDescriptoMapping' JVM class. Optimized code structure with several dependencies updates.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.