Major changes to loading

This commit is contained in:
maik klein 2016-11-27 19:32:34 +01:00
parent 498afbc3df
commit f7e53f97f5
35 changed files with 6916 additions and 180 deletions

9
.idea/ashlib.iml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

22
.idea/compiler.xml Normal file
View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

55
.idea/misc.xml Normal file
View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JComponent">
<property name="html.disable" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JEditorPane">
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
<property name="charset" class="java.lang.String" />
</properties>
<properties class="javax.swing.JList">
<property name="List.isFileList" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JPasswordField">
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JSlider">
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
<property name="JSlider.isFilled" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTable">
<property name="Table.isFileList" class="java.lang.Boolean" />
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JToolBar">
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTree">
<property name="JTree.lineStyle" class="java.lang.String" />
</properties>
<properties class="javax.swing.text.JTextComponent">
<property name="caretAspectRatio" class="java.lang.Double" />
<property name="caretWidth" class="java.lang.Integer" />
</properties>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="true" assert-keyword="false" jdk-15="false" />
<component name="RustProjectSettings">
<option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
</component>
</project>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ashlib.iml" filepath="$PROJECT_DIR$/.idea/ashlib.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

499
.idea/workspace.xml Normal file
View file

@ -0,0 +1,499 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3bfba5c3-3712-4c12-bd49-0c72a2c4b6a5" name="Default" comment="">
<change type="DELETED" beforePath="$PROJECT_DIR$/Cargo.lock" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Cargo.toml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ash/src/device.rs" afterPath="$PROJECT_DIR$/ash/src/device.rs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ash/src/feature.rs" afterPath="$PROJECT_DIR$/ash/src/feature.rs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ash/src/surface.rs" afterPath="$PROJECT_DIR$/ash/src/surface.rs" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/examples/src/main.rs" afterPath="$PROJECT_DIR$/examples/src/main.rs" />
</list>
<ignored path="ashlib.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="ashlib" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="main.rs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/examples/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="25" column="29" selection-start-line="25" selection-start-column="29" selection-end-line="25" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="surface.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ash/src/surface.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/ash/src/surface.rs" />
<option value="$PROJECT_DIR$/examples/src/main.rs" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="-16" />
<option name="width" value="1920" />
<option name="height" value="1096" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes />
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/examples" />
<property name="SearchEverywhereHistoryKey" value="surface.&#9;FILE&#9;file:///home/maik/projects/ashlib/ash/src/surface.rs&#10;main.&#9;FILE&#9;file:///home/maik/projects/ashlib/examples/src/main.rs" />
<property name="org.rust.alreadyTriedToolchainAutoDiscovery" value="true" />
<property name="settings.editor.selected.configurable" value="org.rust.cargo.project.configurable.RustProjectConfigurable" />
<property name="settings.editor.splitter.proportion" value="0.2" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="CargoCommandRunConfiguration" factoryName="Cargo Command" show_console_on_std_err="false" show_console_on_std_out="false">
<option name="additionalArguments" value="" />
<option name="command" value="run" />
<option name="environmentVariables">
<map />
</option>
<option name="printBacktrace" value="false" />
<module name="ashlib" />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JUnitTestDiscovery" factoryName="JUnit Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="SCRATCH_FILE_ID" value="0" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ashlib" />
<envs />
<method />
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="TestNGTestDiscovery" factoryName="TestNG Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="3bfba5c3-3712-4c12-bd49-0c72a2c4b6a5" name="Default" comment="" />
<created>1471359564698</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1471359564698</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="-16" width="1920" height="1096" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32935324" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/examples/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ash/src/surface.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ash/src/surface.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="45" column="0" selection-start-line="45" selection-start-column="0" selection-end-line="45" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="22" column="25" selection-start-line="22" selection-start-column="25" selection-end-line="22" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ash/src/surface.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ash/src/surface.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="25" column="29" selection-start-line="25" selection-start-column="29" selection-end-line="25" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

203
ash/Cargo.lock generated Normal file
View file

@ -0,0 +1,203 @@
[root]
name = "ash"
version = "0.1.0"
dependencies = [
"glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"vk_loader 0.1.0",
]
[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cmake"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "enum_primitive"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gcc"
version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "glfw"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glfw-sys 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glfw-sys"
version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "nom"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-bigint"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-complex"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-integer"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-iter"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-rational"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-serialize"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "shared_library"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vk_loader"
version = "0.1.0"
dependencies = [
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dfcf5bcece56ef953b8ea042509e9dcbdfe97820b7e20d86beb53df30ed94978"
"checksum enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f79eff5be92a4d7d5bddf7daa7d650717ea71628634efe6ca7bcda85b2183c23"
"checksum gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "41337e9dc80ebadf36b4f252bf7440f61bcf34f99caa170e50dcd0f9a0cdb5d8"
"checksum glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14e68c4ccefdf293ecb65390a5761971b83fcfc54d153a5b73d438327633965"
"checksum glfw-sys 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0031461ad52978b865d3e9bafa2be2825052ddec12c56bbf2da2cf1c0274d6ea"
"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f"
"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8"
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce"
"checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120"
"checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49"
"checksum num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c78e054dd19c3fd03419ade63fa661e9c49bb890ce3beb4eee5b7baf93f92f"
"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92"
"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c"
"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf"
"checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c"
"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5"
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
"checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a"

View file

@ -7,5 +7,6 @@ authors = ["maik klein <maikklein@googlemail.com>"]
lazy_static = "0.2.1"
shared_library = "0.1.5"
glfw = "0.9.1"
bitflags = "0.7.0"
vk_loader = { version = "0.1.0", path = "../vk_loader"}

24
ash/src/buffer.rs Normal file
View file

@ -0,0 +1,24 @@
use vk_loader as vk;
use glfw::*;
use std::mem;
use instance::Instance;
use std::ptr;
use std::os::raw::c_void;
pub fn find_memorytype_index(memory_req: &vk::MemoryRequirements,
memory_prop: &vk::PhysicalDeviceMemoryProperties,
flags: vk::MemoryPropertyFlags)
-> Option<u32> {
let mut memory_type_bits = memory_req.memoryTypeBits;
for (index, ref memory_type) in memory_prop.memoryTypes.iter().enumerate() {
if (memory_type.propertyFlags & flags) == flags {
return Some(index as u32);
}
memory_type_bits = memory_type_bits >> 1;
}
None
}
struct HostBuffer {
memory_type: vk::MemoryType,
}

89
ash/src/commandpool.rs Normal file
View file

@ -0,0 +1,89 @@
use device;
use vk_loader as vk;
use std::mem;
use std::ptr;
use std::convert::From;
pub enum CommandPoolFlags {
Transient,
Reset,
}
enum CommandBufferLevel {
Primary,
Secondary,
}
pub struct CommandPool {
pub device: device::Device,
pub pool: vk::CommandPool,
}
impl Drop for CommandPool {
fn drop(&mut self) {
unsafe {
self.device
.inner
.dp
.DestroyCommandPool(self.device.inner.device, self.pool, ptr::null());
}
}
}
pub struct CommandBuffer<'r> {
pub pool: &'r CommandPool,
pub buffer: vk::CommandBuffer,
}
impl<'r> CommandBuffer<'r> {
pub fn begin(&self, cu: CommandBufferUsage) {
let create_info = vk::CommandBufferBeginInfo {
sType: vk::STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
pNext: ptr::null(),
flags: cu.bits(),
pInheritanceInfo: ptr::null(),
};
unsafe {
self.pool.device.inner.dp.BeginCommandBuffer(self.buffer, &create_info);
}
}
pub fn end(&self){
unsafe{
self.pool.device.inner.dp.EndCommandBuffer(self.buffer);
}
}
}
impl CommandPool {
pub fn allocate_commandbuffer(&self) -> CommandBuffer {
let create_info = vk::CommandBufferAllocateInfo {
sType: vk::STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
commandPool: self.pool,
level: vk::COMMAND_BUFFER_LEVEL_PRIMARY,
commandBufferCount: 1,
pNext: ptr::null(),
};
unsafe {
let mut command_buffer = mem::uninitialized();
self.device.inner.dp.AllocateCommandBuffers(self.device.inner.device,
&create_info,
&mut command_buffer);
let cb = CommandBuffer {
pool: self,
buffer: command_buffer,
};
cb
}
}
}
bitflags! {
pub flags CommandBufferUsage: u32{
const ONE_TIME_SUBMIT = vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
const RENDER_PASS_CONTINUE = vk::COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT,
const SIMULTANEOUS_USE = vk::COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
}
}

View file

@ -1,35 +1,86 @@
use std::mem;
use fence;
use vk_loader as vk;
use std::ptr;
use feature;
use surface;
use extensions::*;
use commandpool;
use instance;
use std::sync::Arc;
use std::marker;
use std::ops::Drop;
#[derive(Clone)]
pub struct PhysicalDevice {
pub ip: vk::InstancePointers,
pub instance: instance::Instance,
pub handle: vk::PhysicalDevice,
}
impl PhysicalDevice {
pub fn get_surface_formats(&self, surface: surface::Surface) -> Vec<surface::SurfaceFormat> {
pub fn handle(&self) -> usize {
self.handle
}
pub fn get_device_memory_properties(&self) -> vk::PhysicalDeviceMemoryProperties {
unsafe {
let mut props = mem::uninitialized();
self.instance.ip().GetPhysicalDeviceMemoryProperties(self.handle(), &mut props);
props
}
}
pub fn get_surface_presentmodes(&self, surface: &surface::Surface) -> Vec<vk::PresentModeKHR> {
unsafe {
let mut surface_presentmode_count = 0;
self.instance
.inner
.ip
.GetPhysicalDeviceSurfacePresentModesKHR(self.handle,
surface.handle,
&mut surface_presentmode_count,
ptr::null_mut());
let mut present_modes = Vec::with_capacity(surface_presentmode_count as usize);
self.instance
.inner
.ip
.GetPhysicalDeviceSurfacePresentModesKHR(self.handle,
surface.handle,
&mut surface_presentmode_count,
present_modes.as_mut_ptr());
present_modes.set_len(surface_presentmode_count as usize);
present_modes
}
}
pub fn get_surface_capabilities(&self,
surface: &surface::Surface)
-> vk::SurfaceCapabilitiesKHR {
unsafe {
let mut capabilities = mem::uninitialized();
self.instance.inner.ip.GetPhysicalDeviceSurfaceCapabilitiesKHR(self.handle,
surface.handle,
&mut capabilities);
capabilities
}
}
pub fn get_surface_formats(&self, surface: &surface::Surface) -> Vec<surface::SurfaceFormat> {
unsafe {
let mut num = mem::uninitialized();
self.ip.GetPhysicalDeviceSurfaceFormatsKHR(self.handle,
surface.handle,
&mut num,
ptr::null_mut());
self.instance.inner.ip.GetPhysicalDeviceSurfaceFormatsKHR(self.handle,
surface.handle,
&mut num,
ptr::null_mut());
let mut formats = Vec::with_capacity(num as usize);
self.ip.GetPhysicalDeviceSurfaceFormatsKHR(self.handle,
surface.handle,
&mut num,
formats.as_mut_ptr());
self.instance.inner.ip.GetPhysicalDeviceSurfaceFormatsKHR(self.handle,
surface.handle,
&mut num,
formats.as_mut_ptr());
formats.set_len(num as usize);
formats.into_iter()
.map(|f| {
surface::SurfaceFormat {
format: surface::Format::from_number(f.format)
.expect("Unable to create a Format"),
color_space: surface::ColorSpace::from_number(f.colorSpace)
.expect("Unable to create a Format"),
}
})
.collect()
@ -39,10 +90,10 @@ impl PhysicalDevice {
pub fn has_surface_support(&self, index: u32, surface: &surface::Surface) -> bool {
unsafe {
let mut output: u32 = mem::uninitialized();
self.ip.GetPhysicalDeviceSurfaceSupportKHR(self.handle,
index,
surface.handle,
&mut output);
self.instance.inner.ip.GetPhysicalDeviceSurfaceSupportKHR(self.handle,
index,
surface.handle,
&mut output);
output != 0
}
}
@ -59,7 +110,7 @@ impl PhysicalDevice {
pub fn get_physical_device_properties(&self) -> vk::PhysicalDeviceProperties {
unsafe {
let mut device_prop: vk::PhysicalDeviceProperties = mem::uninitialized();
self.ip.GetPhysicalDeviceProperties(self.handle, &mut device_prop);
self.instance.inner.ip.GetPhysicalDeviceProperties(self.handle, &mut device_prop);
device_prop
}
}
@ -67,12 +118,16 @@ impl PhysicalDevice {
pub fn get_queue_families(&self) -> Vec<vk::QueueFamilyProperties> {
unsafe {
let mut queue_count = 0;
self.ip
self.instance
.inner
.ip
.GetPhysicalDeviceQueueFamilyProperties(self.handle,
&mut queue_count,
ptr::null_mut());
let mut queue_families_vec = Vec::with_capacity(queue_count as usize);
self.ip
self.instance
.inner
.ip
.GetPhysicalDeviceQueueFamilyProperties(self.handle,
&mut queue_count,
queue_families_vec.as_mut_ptr());
@ -84,7 +139,7 @@ impl PhysicalDevice {
pub fn get_memory_properties(&self) -> vk::PhysicalDeviceMemoryProperties {
unsafe {
let mut output = mem::uninitialized();
self.ip.GetPhysicalDeviceMemoryProperties(self.handle, &mut output);
self.instance.inner.ip.GetPhysicalDeviceMemoryProperties(self.handle, &mut output);
output
}
}
@ -92,7 +147,7 @@ impl PhysicalDevice {
pub fn get_device_features(&self) -> feature::Features {
let available_features: vk::PhysicalDeviceFeatures = unsafe {
let mut output = mem::uninitialized();
self.ip.GetPhysicalDeviceFeatures(self.handle, &mut output);
self.instance.inner.ip.GetPhysicalDeviceFeatures(self.handle, &mut output);
output
};
feature::Features::from(available_features)
@ -103,6 +158,10 @@ impl PhysicalDevice {
ext: &DeviceExtension,
features: &feature::Features)
-> Device {
let extension_list = ext.extension_list();
let extension_list_raw =
extension_list.iter().map(|extension| extension.as_ptr()).collect::<Vec<_>>();
let f = vk::PhysicalDeviceFeatures::from(*features);
let priorities = [1.0];
let queue_info = vk::DeviceQueueCreateInfo {
@ -122,23 +181,30 @@ impl PhysicalDevice {
pQueueCreateInfos: &queue_info,
enabledLayerCount: 0,
ppEnabledLayerNames: ptr::null(),
enabledExtensionCount: 0,
ppEnabledExtensionNames: ptr::null(),
enabledExtensionCount: extension_list_raw.len() as u32,
ppEnabledExtensionNames: extension_list_raw.as_ptr(),
pEnabledFeatures: ptr::null(),
};
let mut vk_device = unsafe { mem::uninitialized() };
unsafe {
assert!(self.ip.CreateDevice(self.handle, &create_info, ptr::null(), &mut vk_device) ==
assert!(self.instance
.inner
.ip
.CreateDevice(self.handle, &create_info, ptr::null(), &mut vk_device) ==
0,
"device");
}
let dp = vk::DevicePointers::load(|name| {
unsafe { self.ip.GetDeviceProcAddr(vk_device, name.as_ptr()) as *const _ }
unsafe {
self.instance.inner.ip.GetDeviceProcAddr(vk_device, name.as_ptr()) as *const _
}
});
Device {
dp: dp,
device: vk_device,
inner: Arc::new(DeviceInner {
dp: dp,
device: vk_device,
}),
}
}
}
@ -156,26 +222,378 @@ impl PhysicalDeviceInfos {
}
}
pub struct Queue {
handle: vk::Queue,
pub trait QueueFamily {
fn constrain(&self, queueFlags: u32) -> bool;
}
pub struct GraphicsQueueFamily;
impl QueueFamily for GraphicsQueueFamily {
fn constrain(&self, queueFlags: u32) -> bool {
queueFlags & vk::QUEUE_GRAPHICS_BIT != 0
}
}
pub struct Queue<T: QueueFamily> {
pub device: Device,
pub handle: vk::Queue,
pub family: u32,
pub index: u32,
pub _qf: marker::PhantomData<T>,
}
#[derive(Clone)]
pub struct Device {
dp: vk::DevicePointers,
device: vk::Device,
pub inner: Arc<DeviceInner>,
}
impl Device {
pub fn get_device_queue(&self, family: u32, index: u32) -> Queue {
#[derive(Clone)]
pub struct DeviceInner {
pub dp: vk::DevicePointers,
pub device: vk::Device,
}
pub struct Swapchain {
pub device: Device,
pub handle: vk::SwapchainKHR,
}
impl Drop for Swapchain {
fn drop(&mut self) {
unsafe {
let mut queue = mem::uninitialized();
self.dp.GetDeviceQueue(self.device, family, index, &mut queue);
Queue { handle: queue }
self.device
.inner
.dp
.DestroySwapchainKHR(self.device.handle(), self.handle, ptr::null());
}
}
}
impl Drop for Device {
impl Swapchain {
pub fn get_images(&self) -> Vec<vk::Image> {
unsafe {
let mut image_count = 0;
self.device.dp().GetSwapchainImagesKHR(self.device.handle(),
self.handle,
&mut image_count,
ptr::null_mut());
let mut images = Vec::with_capacity(image_count as usize);
self.device.dp().GetSwapchainImagesKHR(self.device.handle(),
self.handle,
&mut image_count,
images.as_mut_ptr());
images.set_len(image_count as usize);
images
}
}
}
pub struct Image {
pub device: Device,
pub handle: vk::Image,
}
impl Drop for Image {
fn drop(&mut self) {
unsafe {
self.device.dp().DestroyImage(self.device.handle(), self.handle, ptr::null());
}
}
}
pub struct ImageView {
pub device: Device,
pub handle: vk::ImageView,
}
impl Drop for ImageView {
fn drop(&mut self) {
unsafe {
self.device.dp().DestroyImageView(self.device.handle(), self.handle, ptr::null());
}
}
}
impl Device {
pub fn handle(&self) -> usize {
self.inner.device
}
pub fn dp(&self) -> &vk::DevicePointers {
&self.inner.dp
}
pub fn cmd_pipeline_barrier<I: Into<vk::ImageMemoryBarrier>>(&self,
command_buffer: vk::CommandBuffer,
src_stage_mask: vk::PipelineStageFlags,
dst_stage_mask: vk::PipelineStageFlags,
dependecy_flags: vk::DependencyFlags,
memory_barrier_count: u32,
p_memory_barriers: *const vk::MemoryBarrier,
buffer_memory_barrier_count: u32,
p_buffer_memory_barriers: *const vk::BufferMemoryBarrier,
image_memory_barrier_count: u32,
p_image_memory_barriers: I) {
let vk_p_image_memory_barriers = p_image_memory_barriers.into();
unsafe {
self.dp().CmdPipelineBarrier(command_buffer,
src_stage_mask,
dst_stage_mask,
dependecy_flags,
memory_barrier_count,
p_memory_barriers,
buffer_memory_barrier_count,
p_buffer_memory_barriers,
image_memory_barrier_count,
&vk_p_image_memory_barriers);
}
}
pub fn end_command_buffer(&self, command_buffer: vk::CommandBuffer) {
unsafe {
self.dp().EndCommandBuffer(command_buffer);
}
}
pub fn begin_command_buffer(&self,
command_buffer: vk::CommandBuffer,
begin_info: vk::CommandBufferBeginInfo) {
unsafe {
self.dp().BeginCommandBuffer(command_buffer, &begin_info);
}
}
pub fn bind_image_memory(&self,
image: vk::Image,
memory: vk::DeviceMemory,
offset: vk::DeviceSize) {
unsafe {
self.dp().BindImageMemory(self.handle(), image, memory, offset);
}
}
pub fn allocate_memory(&self,
mem_reqs: vk::MemoryRequirements,
mem_prop: vk::PhysicalDeviceMemoryProperties,
flags: vk::MemoryPropertyFlags)
-> Option<vk::DeviceMemory> {
use buffer::find_memorytype_index;
if let Some(index) = find_memorytype_index(&mem_reqs, &mem_prop, flags) {
let create_info = vk::MemoryAllocateInfo {
sType: vk::STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
pNext: ptr::null(),
allocationSize: mem_reqs.size,
memoryTypeIndex: index,
};
unsafe {
let mut device_memory = mem::uninitialized();
self.dp()
.AllocateMemory(self.handle(), &create_info, ptr::null(), &mut device_memory);
return Some(device_memory);
}
}
None
}
pub fn get_image_memory_requirements(&self, image: &Image) -> vk::MemoryRequirements {
unsafe {
let mut mem_req = mem::uninitialized();
self.dp().GetImageMemoryRequirements(self.handle(), image.handle, &mut mem_req);
mem_req
}
}
pub fn create_fence(&self) -> fence::Fence {
unsafe {
let create_info = vk::FenceCreateInfo {
sType: vk::STRUCTURE_TYPE_FENCE_CREATE_INFO,
flags: 0,
pNext: ptr::null(),
};
let mut fence = mem::uninitialized();
self.dp().CreateFence(self.handle(), &create_info, ptr::null(), &mut fence);
fence::Fence {
handle: fence,
device: self.clone(),
}
}
}
pub fn create_image(&self,
flags: vk::ImageCreateFlags,
image_type: vk::ImageType,
format: vk::Format,
extent: vk::Extent3D,
mip_levels: u32,
array_layers: u32,
samples: vk::SampleCountFlagBits,
tiling: vk::ImageTiling,
usage: vk::ImageUsageFlags,
sharing_mode: vk::SharingMode,
queue_family_index_count: u32,
p_queue_family_indices: *const u32,
initial_layout: vk::ImageLayout)
-> Image {
let create_info = vk::ImageCreateInfo {
sType: vk::STRUCTURE_TYPE_IMAGE_CREATE_INFO,
pNext: ptr::null(),
flags: flags,
imageType: image_type,
format: format,
extent: extent,
mipLevels: mip_levels,
arrayLayers: array_layers,
samples: samples,
tiling: tiling,
usage: usage,
sharingMode: sharing_mode,
queueFamilyIndexCount: queue_family_index_count,
pQueueFamilyIndices: p_queue_family_indices,
initialLayout: initial_layout,
};
unsafe {
let mut image = mem::uninitialized();
self.dp().CreateImage(self.handle(), &create_info, ptr::null(), &mut image);
Image {
device: self.clone(),
handle: image,
}
}
}
pub fn create_image_view(&self,
flags: vk::ImageViewCreateFlags,
image: vk::Image,
view_type: vk::ImageViewType,
format: vk::Format,
components: vk::ComponentMapping,
subresource_range: vk::ImageSubresourceRange)
-> ImageView {
let create_info = vk::ImageViewCreateInfo {
sType: vk::STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
pNext: ptr::null(),
flags: flags,
image: image,
viewType: view_type,
format: format,
components: components,
subresourceRange: subresource_range,
};
unsafe {
let mut image_view = mem::uninitialized();
self.dp().CreateImageView(self.handle(), &create_info, ptr::null(), &mut image_view);
ImageView {
device: self.clone(),
handle: image_view,
}
}
}
pub fn create_swapchain(&self,
surface: &surface::Surface,
image_format: surface::Format,
min_image_count: u32,
image_color_space: surface::ColorSpace,
image_extent: vk::Extent2D,
image_array_layers: u32,
image_usage: vk::ImageUsageFlags,
image_sharing_mode: vk::SharingMode,
queue_family_index_count: u32,
p_queue_family_indices: *const u32,
pre_transform: vk::SurfaceTransformFlagBitsKHR,
composite_alpha: vk::CompositeAlphaFlagBitsKHR,
present_mode: vk::PresentModeKHR,
clipped: bool,
old_swapchain: vk::SwapchainKHR)
-> Swapchain {
unsafe {
let mut swapchain = mem::uninitialized();
let create_info = vk::SwapchainCreateInfoKHR {
sType: vk::STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
pNext: ptr::null(),
flags: 0,
surface: surface.handle,
minImageCount: min_image_count,
imageFormat: image_format.to_number(),
imageColorSpace: image_color_space.to_number(),
imageExtent: image_extent,
imageArrayLayers: image_array_layers,
imageUsage: image_usage,
imageSharingMode: image_sharing_mode,
queueFamilyIndexCount: queue_family_index_count,
pQueueFamilyIndices: p_queue_family_indices,
preTransform: pre_transform,
compositeAlpha: composite_alpha,
presentMode: present_mode,
clipped: clipped as u32,
oldSwapchain: old_swapchain,
};
self.inner
.dp
.CreateSwapchainKHR(self.inner.device, &create_info, ptr::null(), &mut swapchain);
Swapchain {
device: self.clone(),
handle: swapchain,
}
}
}
pub fn get_device_queue<T: QueueFamily>(&self, family: u32, index: u32) -> Queue<T> {
unsafe {
let mut queue = mem::uninitialized();
self.inner.dp.GetDeviceQueue(self.inner.device, family, index, &mut queue);
Queue {
device: self.clone(),
handle: queue,
family: family,
index: index,
_qf: marker::PhantomData,
}
}
}
pub fn destroy_command_pool(&self, pool: vk::CommandPool) {
unsafe {
self.dp().DestroyCommandPool(self.handle(), pool, ptr::null());
}
}
pub fn allocate_command_buffers(&self,
allocate_info: vk::CommandBufferAllocateInfo)
-> Vec<vk::CommandBuffer> {
unsafe {
let mut command_buffers = Vec::with_capacity(allocate_info.commandBufferCount as usize);
self.dp().AllocateCommandBuffers(self.handle(),
&allocate_info,
command_buffers.as_mut_ptr());
command_buffers.set_len(allocate_info.commandBufferCount as usize);
command_buffers
}
}
pub fn create_commandpool(&self,
pool_info: vk::CommandPoolCreateInfo,
queue: vk::Queue)
-> vk::CommandPool {
unsafe {
let mut vk_cmd_pool = mem::uninitialized();
self.dp()
.CreateCommandPool(self.handle(), &pool_info, ptr::null(), &mut vk_cmd_pool);
vk_cmd_pool
}
}
// pub fn create_commandpool<T: QueueFamily>(&self, queue: &Queue<T>) -> commandpool::CommandPool {
// let create_info = vk::CommandPoolCreateInfo {
// pNext: ptr::null(),
// sType: vk::STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
// flags: vk::COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
// queueFamilyIndex: queue.index,
// };
// unsafe {
// let mut vk_cmd_pool = mem::uninitialized();
// self.inner.dp.CreateCommandPool(self.inner.device,
// &create_info,
// ptr::null(),
// &mut vk_cmd_pool);
// commandpool::CommandPool {
// device: self.clone(),
// pool: vk_cmd_pool,
// }
// }
// }
}
impl Drop for DeviceInner {
fn drop(&mut self) {
unsafe {
self.dp.DestroyDevice(self.device, ptr::null());

View file

@ -1,17 +1,17 @@
#![allow(dead_code)]
use vk_loader as vk;
use std::fmt;
macro_rules! features{
($($name: ident => $vk: ident,)+) => {
macro_rules! c_enum{
($struct_name: ident, ($($from_type: tt)*), $($name: ident => $vk: ident,)+) => {
#[derive(Debug, Copy, Clone)]
pub struct Features{
pub struct $struct_name{
$(
pub $name: bool,
)+
}
impl Features{
pub fn empty() -> Features{
Features{
impl $struct_name{
pub fn empty() -> $struct_name{
$struct_name{
$(
$name: false,
)+
@ -23,9 +23,9 @@ macro_rules! features{
}
//TODO: Probably just impl From with a cast?
impl From<vk::PhysicalDeviceFeatures> for Features{
fn from(features: vk::PhysicalDeviceFeatures) -> Features {
Features{
impl From<$($from_type)*> for $struct_name{
fn from(features: $($from_type)*) -> $struct_name {
$struct_name{
$(
$name: features.$vk != 0,
)+
@ -33,9 +33,9 @@ macro_rules! features{
}
}
impl From<Features> for vk::PhysicalDeviceFeatures {
fn from(features: Features) -> vk::PhysicalDeviceFeatures {
vk::PhysicalDeviceFeatures{
impl From<$struct_name> for $($from_type)* {
fn from(features: $struct_name) -> $($from_type)* {
$($from_type)*{
$(
$vk: features.$name as u32,
)+
@ -43,7 +43,61 @@ macro_rules! features{
}
}
impl fmt::Display for Features {
impl fmt::Display for $struct_name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result{
$(
if self.$name {
try!(writeln!(f, "{},", stringify!($name)));
}
)+
writeln!(f, "")
}
}
}
}
macro_rules! features{
($struct_name: ident, ($($from_type: tt)*), $($name: ident => $vk: ident,)+) => {
#[derive(Debug, Copy, Clone)]
pub struct $struct_name{
$(
pub $name: bool,
)+
}
impl $struct_name{
pub fn empty() -> $struct_name{
$struct_name{
$(
$name: false,
)+
}
}
pub fn subset(&self, other: &Self) -> bool{
$((!self.$name | other.$name))&&+
}
}
//TODO: Probably just impl From with a cast?
impl From<$($from_type)*> for $struct_name{
fn from(features: $($from_type)*) -> $struct_name {
$struct_name{
$(
$name: features.$vk != 0,
)+
}
}
}
impl From<$struct_name> for $($from_type)* {
fn from(features: $struct_name) -> $($from_type)* {
$($from_type)*{
$(
$vk: features.$name as u32,
)+
}
}
}
impl fmt::Display for $struct_name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result{
$(
if self.$name {
@ -57,6 +111,8 @@ macro_rules! features{
}
features!{
Features,
(vk::PhysicalDeviceFeatures),
robust_buffer_access => robustBufferAccess,
full_draw_index_uint32 => fullDrawIndexUint32,
image_cube_array => imageCubeArray,

20
ash/src/fence.rs Normal file
View file

@ -0,0 +1,20 @@
use vk_loader as vk;
use std::mem;
use device::Device;
use std::ops::Drop;
use std::ptr;
pub struct Fence {
pub device: Device,
pub handle: vk::Fence,
}
impl Drop for Fence {
fn drop(&mut self) {
unsafe {
self.device.dp().DestroyFence(self.device.handle(), self.handle, ptr::null());
}
}
}
impl Fence {}

View file

@ -10,28 +10,43 @@ use std::sync::Arc;
use vk_loader as vk;
use feature;
use load;
use fence;
use extensions::*;
use std::os::raw::*;
use std::cell::Cell;
use surface;
use device::*;
pub struct DebugCallback {
handle: vk::DebugReportCallbackEXT,
f: *mut Fn(String),
}
#[derive(Clone)]
pub struct Instance {
pub inner: Arc<InstanceImpl>,
}
pub struct InstanceImpl {
pub instance: vk::Instance,
pub ip: vk::InstancePointers,
callback: Option<DebugCallback>,
}
impl Instance{
pub fn handle(&self) -> usize{
self.inner.instance
}
pub fn ip(&self) -> &vk::InstancePointers {
&self.inner.ip
}
}
unsafe impl Send for Instance {}
unsafe impl Sync for Instance {}
impl Drop for Instance {
impl Drop for InstanceImpl {
fn drop(&mut self) {
unsafe {
if let Some(ref callback) = self.callback {
@ -50,7 +65,7 @@ pub struct ApplicationInfo {
impl Instance {
pub fn create_surface<S: surface::VulkanSurface>(&self, s: &S) -> surface::Surface {
surface::Surface {
instance: self,
instance: self.clone(),
handle: s.create_surface(self),
}
}
@ -70,10 +85,10 @@ impl Instance {
pub fn device_extension_properties(&self, device: vk::PhysicalDevice) -> DeviceExtension {
let extension_props = unsafe {
let mut num = 0;
self.ip
self.inner.ip
.EnumerateDeviceExtensionProperties(device, ptr::null(), &mut num, ptr::null_mut());
let mut data = Vec::with_capacity(num as usize);
self.ip.EnumerateDeviceExtensionProperties(device,
self.inner.ip.EnumerateDeviceExtensionProperties(device,
ptr::null(),
&mut num,
data.as_mut_ptr());
@ -179,25 +194,27 @@ impl Instance {
}
};
Instance {
ip: vk,
instance: instance,
callback: Some(callback),
inner: Arc::new(InstanceImpl {
ip: vk,
instance: instance,
callback: Some(callback),
}),
}
}
pub fn get_pysical_devices(&self) -> Vec<PhysicalDevice> {
unsafe {
let mut num = 0;
self.ip
.EnumeratePhysicalDevices(self.instance, &mut num, ptr::null_mut());
self.inner.ip
.EnumeratePhysicalDevices(self.inner.instance, &mut num, ptr::null_mut());
let mut physical_devices = Vec::<vk::PhysicalDevice>::with_capacity(num as usize);
self.ip
.EnumeratePhysicalDevices(self.instance, &mut num, physical_devices.as_mut_ptr());
self.inner.ip
.EnumeratePhysicalDevices(self.inner.instance, &mut num, physical_devices.as_mut_ptr());
physical_devices.set_len(num as usize);
physical_devices.into_iter()
.map(|handle| {
PhysicalDevice {
ip: self.ip.clone(),
instance: self.clone(),
handle: handle,
}
})

View file

@ -3,6 +3,8 @@ extern crate lazy_static;
extern crate shared_library;
extern crate vk_loader;
extern crate glfw;
#[macro_use]
extern crate bitflags;
pub mod load;
pub mod extensions;
@ -10,3 +12,6 @@ pub mod surface;
pub mod instance;
pub mod feature;
pub mod device;
pub mod commandpool;
pub mod fence;
pub mod buffer;

View file

@ -17,7 +17,7 @@ use shared_library;
use vk_loader as vk;
lazy_static! {
static ref VK_LIB: Result<shared_library::dynamic_library::DynamicLibrary, LoadingError> = {
pub static ref VK_LIB: Result<shared_library::dynamic_library::DynamicLibrary, LoadingError> = {
#[cfg(windows)] fn get_path() -> &'static Path { Path::new("vulkan-1.dll") }
#[cfg(all(unix, not(target_os = "android")))] fn get_path() -> &'static Path { Path::new("libvulkan.so.1") }
#[cfg(target_os = "android")] fn get_path() -> &'static Path { Path::new("libvulkan.so") }

View file

@ -21,40 +21,227 @@ impl VulkanSurface for Window {
window: x11_window as *mut c_void,
dpy: x11_display as *mut c_void,
};
inst.ip.CreateXlibSurfaceKHR(inst.instance, &create_info, ptr::null(), &mut surface);
inst.inner.ip.CreateXlibSurfaceKHR(inst.inner.instance, &create_info, ptr::null(), &mut surface);
surface
}
}
}
struct SurfaceCapabilities {
}
pub struct SurfaceFormat {
pub format: Format,
pub format: Format,
pub color_space: ColorSpace,
}
pub struct Surface<'r> {
pub instance: &'r Instance,
pub struct Surface {
pub instance: Instance,
pub handle: vk::SurfaceKHR,
}
impl<'r> Drop for Surface<'r> {
impl Drop for Surface {
fn drop(&mut self) {
unsafe {
self.instance.ip.DestroySurfaceKHR(self.instance.instance, self.handle, ptr::null());
self.instance.inner.ip.DestroySurfaceKHR(self.instance.inner.instance, self.handle, ptr::null());
}
}
}
#[derive(Copy, Clone)]
pub enum Format {
FormatUndefined,
FormatR4g4UnormPack8,
FormatR4g4b4a4UnormPack16,
FormatB4g4r4a4UnormPack16,
FormatR5g6b5UnormPack16,
FormatB5g6r5UnormPack16,
FormatR5g5b5a1UnormPack16,
FormatB5g5r5a1UnormPack16,
FormatA1r5g5b5UnormPack16,
FormatR8Unorm,
FormatR8Snorm,
FormatR8Uscaled,
FormatR8Sscaled,
FormatR8Uint,
FormatR8Sint,
FormatR8Srgb,
FormatR8G8Unorm,
FormatR8G8Snorm,
FormatR8G8Uscaled,
FormatR8G8Sscaled,
FormatR8G8Uint,
FormatR8G8Sint,
FormatR8G8Srgb,
FormatR8G8B8Unorm,
FormatR8G8B8Snorm,
FormatR8G8B8Uscaled,
FormatR8G8B8Sscaled,
FormatR8G8B8Uint,
FormatR8G8B8Sint,
FormatR8G8B8Srgb,
FormatB8G8r8Unorm,
FormatB8G8r8Snorm,
FormatB8G8r8Uscaled,
FormatB8G8r8Sscaled,
FormatB8G8r8Uint,
FormatB8G8r8Sint,
FormatB8G8r8Srgb,
FormatR8G8b8a8Unorm,
FormatR8G8b8a8Snorm,
FormatR8G8b8a8Uscaled,
FormatR8G8b8a8Sscaled,
FormatR8G8b8a8Uint,
FormatR8G8b8a8Sint,
FormatR8G8b8a8Srgb,
FormatB8G8r8a8Unorm,
FormatB8G8r8a8Snorm,
FormatB8G8r8a8Uscaled,
FormatB8G8r8a8Sscaled,
FormatB8G8r8a8Uint,
FormatB8G8r8a8Sint,
FormatB8G8r8a8Srgb,
FormatA8b8g8r8UnormPack32,
FormatA8b8g8r8SnormPack32,
FormatA8b8g8r8UscaledPack32,
FormatA8b8g8r8SscaledPack32,
FormatA8b8g8r8UintPack32,
FormatA8b8g8r8SintPack32,
FormatA8b8g8r8SrgbPack32,
FormatA2r10g10b10UnormPack32,
FormatA2r10g10b10SnormPack32,
FormatA2r10g10b10UscaledPack32,
FormatA2r10g10b10SscaledPack32,
FormatA2r10g10b10UintPack32,
FormatA2r10g10b10SintPack32,
FormatA2b10g10r10UnormPack32,
FormatA2b10g10r10SnormPack32,
FormatA2b10g10r10UscaledPack32,
FormatA2b10g10r10SscaledPack32,
FormatA2b10g10r10UintPack32,
FormatA2b10g10r10SintPack32,
FormatR16Unorm,
FormatR16Snorm,
FormatR16Uscaled,
FormatR16Sscaled,
FormatR16Uint,
FormatR16Sint,
FormatR16Sfloat,
FormatR16g16Unorm,
FormatR16g16Snorm,
FormatR16g16Uscaled,
FormatR16g16Sscaled,
FormatR16g16Uint,
FormatR16g16Sint,
FormatR16g16Sfloat,
FormatR16g16b16Unorm,
FormatR16g16b16Snorm,
FormatR16g16b16Uscaled,
FormatR16g16b16Sscaled,
FormatR16g16b16Uint,
FormatR16g16b16Sint,
FormatR16g16b16Sfloat,
FormatR16g16b16a16Unorm,
FormatR16g16b16a16Snorm,
FormatR16g16b16a16Uscaled,
FormatR16g16b16a16Sscaled,
FormatR16g16b16a16Uint,
FormatR16g16b16a16Sint,
FormatR16g16b16a16Sfloat,
FormatR32Uint,
FormatR32Sint,
FormatR32Sfloat,
FormatR32g32Uint,
FormatR32g32Sint,
FormatR32g32Sfloat,
FormatR32g32b32Uint,
FormatR32g32b32Sint,
FormatR32g32b32Sfloat,
FormatR32g32b32a32Uint,
FormatR32g32b32a32Sint,
FormatR32g32b32a32Sfloat,
FormatR64Uint,
FormatR64Sint,
FormatR64Sfloat,
FormatR64g64Uint,
FormatR64g64Sint,
FormatR64g64Sfloat,
FormatR64g64b64Uint,
FormatR64g64b64Sint,
FormatR64g64b64Sfloat,
FormatR64g64b64a64Uint,
FormatR64g64b64a64Sint,
FormatR64g64b64a64Sfloat,
FormatB10g11r11UfloatPack32,
FormatE5b9g9r9UfloatPack32,
FormatD16Unorm,
FormatX8D24UnormPack32,
FormatD32Sfloat,
FormatS8Uint,
FormatD16UnormS8Uint,
FormatD24UnormS8Uint,
FormatD32SfloatS8Uint,
FormatBc1RgbUnormBlock,
FormatBc1RgbSrgbBlock,
FormatBc1RgbaUnormBlock,
FormatBc1RgbaSrgbBlock,
FormatBc2UnormBlock,
FormatBc2SrgbBlock,
FormatBc3UnormBlock,
FormatBc3SrgbBlock,
FormatBc4UnormBlock,
FormatBc4SnormBlock,
FormatBc5UnormBlock,
FormatBc5SnormBlock,
FormatBc6hUfloatBlock,
FormatBc6hSfloatBlock,
FormatBc7UnormBlock,
FormatBc7SrgbBlock,
FormatEtc2R8G8B8UnormBlock,
FormatEtc2R8G8B8SrgbBlock,
FormatEtc2R8G8B8a1UnormBlock,
FormatEtc2R8G8B8a1SrgbBlock,
FormatEtc2R8G8B8a8UnormBlock,
FormatEtc2R8G8B8a8SrgbBlock,
FormatEacR11UnormBlock,
FormatEacR11SnormBlock,
FormatEacR11g11UnormBlock,
FormatEacR11g11SnormBlock,
FormatAstc4x4UnormBlock,
FormatAstc4x4SrgbBlock,
FormatAstc5x4UnormBlock,
FormatAstc5x4SrgbBlock,
FormatAstc5x5UnormBlock,
FormatAstc5x5SrgbBlock,
FormatAstc6x5UnormBlock,
FormatAstc6x5SrgbBlock,
FormatAstc6x6UnormBlock,
FormatAstc6x6SrgbBlock,
FormatAstc8x5UnormBlock,
FormatAstc8x5SrgbBlock,
FormatAstc8x6UnormBlock,
FormatAstc8x6SrgbBlock,
FormatAstc8x8UnormBlock,
FormatAstc8x8SrgbBlock,
FormatAstc10x5UnormBlock,
FormatAstc10x5SrgbBlock,
FormatAstc10x6UnormBlock,
FormatAstc10x6SrgbBlock,
FormatAstc10x8UnormBlock,
FormatAstc10x8SrgbBlock,
FormatAstc10x10UnormBlock,
FormatAstc10x10SrgbBlock,
FormatAstc12x10UnormBlock,
FormatAstc12x10SrgbBlock,
FormatAstc12x12UnormBlock,
FormatAstc12x12SrgbBlock,
}
pub enum SurfaceTransformFlags {
}
macro_rules! c_enum {
(
pub enum $name:ident: $base_ty:ty {
$($var_name:ident = $var_value: path),+
$(,)*
}
$name:ident, $base_ty:ty,
$($var_name:ident = $var_value: path),+
) => {
pub enum $name {
$(
$var_name = $var_value as isize,
)+
}
impl $name {
pub fn from_number(val: $base_ty) -> Option<$name>{
match val {
@ -64,11 +251,29 @@ macro_rules! c_enum {
_ => None
}
}
pub fn to_number(self) -> $base_ty{
match self {
$(
$name::$var_name => $var_value,
)+
}
}
}
}
}
#[derive(Copy, Clone)]
pub enum ColorSpace {
SrgbNonlinear,
}
c_enum!{
pub enum Format: u32 {
ColorSpace, u32,
SrgbNonlinear = vk::COLOR_SPACE_SRGB_NONLINEAR_KHR
}
c_enum!{
Format, u32,
FormatUndefined = vk::FORMAT_UNDEFINED,
FormatR4g4UnormPack8 = vk::FORMAT_R4G4_UNORM_PACK8,
FormatR4g4b4a4UnormPack16 = vk::FORMAT_R4G4B4A4_UNORM_PACK16,
@ -85,41 +290,41 @@ c_enum!{
FormatR8Uint = vk::FORMAT_R8_UINT,
FormatR8Sint = vk::FORMAT_R8_SINT,
FormatR8Srgb = vk::FORMAT_R8_SRGB,
FormatR8g8Unorm = vk::FORMAT_R8G8_UNORM,
FormatR8g8Snorm = vk::FORMAT_R8G8_SNORM,
FormatR8g8Uscaled = vk::FORMAT_R8G8_USCALED,
FormatR8g8Sscaled = vk::FORMAT_R8G8_SSCALED,
FormatR8g8Uint = vk::FORMAT_R8G8_UINT,
FormatR8g8Sint = vk::FORMAT_R8G8_SINT,
FormatR8g8Srgb = vk::FORMAT_R8G8_SRGB,
FormatR8g8b8Unorm = vk::FORMAT_R8G8B8_UNORM,
FormatR8g8b8Snorm = vk::FORMAT_R8G8B8_SNORM,
FormatR8g8b8Uscaled = vk::FORMAT_R8G8B8_USCALED,
FormatR8g8b8Sscaled = vk::FORMAT_R8G8B8_SSCALED,
FormatR8g8b8Uint = vk::FORMAT_R8G8B8_UINT,
FormatR8g8b8Sint = vk::FORMAT_R8G8B8_SINT,
FormatR8g8b8Srgb = vk::FORMAT_R8G8B8_SRGB,
FormatB8g8r8Unorm = vk::FORMAT_B8G8R8_UNORM,
FormatB8g8r8Snorm = vk::FORMAT_B8G8R8_SNORM,
FormatB8g8r8Uscaled = vk::FORMAT_B8G8R8_USCALED,
FormatB8g8r8Sscaled = vk::FORMAT_B8G8R8_SSCALED,
FormatB8g8r8Uint = vk::FORMAT_B8G8R8_UINT,
FormatB8g8r8Sint = vk::FORMAT_B8G8R8_SINT,
FormatB8g8r8Srgb = vk::FORMAT_B8G8R8_SRGB,
FormatR8g8b8a8Unorm = vk::FORMAT_R8G8B8A8_UNORM,
FormatR8g8b8a8Snorm = vk::FORMAT_R8G8B8A8_SNORM,
FormatR8g8b8a8Uscaled = vk::FORMAT_R8G8B8A8_USCALED,
FormatR8g8b8a8Sscaled = vk::FORMAT_R8G8B8A8_SSCALED,
FormatR8g8b8a8Uint = vk::FORMAT_R8G8B8A8_UINT,
FormatR8g8b8a8Sint = vk::FORMAT_R8G8B8A8_SINT,
FormatR8g8b8a8Srgb = vk::FORMAT_R8G8B8A8_SRGB,
FormatB8g8r8a8Unorm = vk::FORMAT_B8G8R8A8_UNORM,
FormatB8g8r8a8Snorm = vk::FORMAT_B8G8R8A8_SNORM,
FormatB8g8r8a8Uscaled = vk::FORMAT_B8G8R8A8_USCALED,
FormatB8g8r8a8Sscaled = vk::FORMAT_B8G8R8A8_SSCALED,
FormatB8g8r8a8Uint = vk::FORMAT_B8G8R8A8_UINT,
FormatB8g8r8a8Sint = vk::FORMAT_B8G8R8A8_SINT,
FormatB8g8r8a8Srgb = vk::FORMAT_B8G8R8A8_SRGB,
FormatR8G8Unorm = vk::FORMAT_R8G8_UNORM,
FormatR8G8Snorm = vk::FORMAT_R8G8_SNORM,
FormatR8G8Uscaled = vk::FORMAT_R8G8_USCALED,
FormatR8G8Sscaled = vk::FORMAT_R8G8_SSCALED,
FormatR8G8Uint = vk::FORMAT_R8G8_UINT,
FormatR8G8Sint = vk::FORMAT_R8G8_SINT,
FormatR8G8Srgb = vk::FORMAT_R8G8_SRGB,
FormatR8G8B8Unorm = vk::FORMAT_R8G8B8_UNORM,
FormatR8G8B8Snorm = vk::FORMAT_R8G8B8_SNORM,
FormatR8G8B8Uscaled = vk::FORMAT_R8G8B8_USCALED,
FormatR8G8B8Sscaled = vk::FORMAT_R8G8B8_SSCALED,
FormatR8G8B8Uint = vk::FORMAT_R8G8B8_UINT,
FormatR8G8B8Sint = vk::FORMAT_R8G8B8_SINT,
FormatR8G8B8Srgb = vk::FORMAT_R8G8B8_SRGB,
FormatB8G8r8Unorm = vk::FORMAT_B8G8R8_UNORM,
FormatB8G8r8Snorm = vk::FORMAT_B8G8R8_SNORM,
FormatB8G8r8Uscaled = vk::FORMAT_B8G8R8_USCALED,
FormatB8G8r8Sscaled = vk::FORMAT_B8G8R8_SSCALED,
FormatB8G8r8Uint = vk::FORMAT_B8G8R8_UINT,
FormatB8G8r8Sint = vk::FORMAT_B8G8R8_SINT,
FormatB8G8r8Srgb = vk::FORMAT_B8G8R8_SRGB,
FormatR8G8b8a8Unorm = vk::FORMAT_R8G8B8A8_UNORM,
FormatR8G8b8a8Snorm = vk::FORMAT_R8G8B8A8_SNORM,
FormatR8G8b8a8Uscaled = vk::FORMAT_R8G8B8A8_USCALED,
FormatR8G8b8a8Sscaled = vk::FORMAT_R8G8B8A8_SSCALED,
FormatR8G8b8a8Uint = vk::FORMAT_R8G8B8A8_UINT,
FormatR8G8b8a8Sint = vk::FORMAT_R8G8B8A8_SINT,
FormatR8G8b8a8Srgb = vk::FORMAT_R8G8B8A8_SRGB,
FormatB8G8r8a8Unorm = vk::FORMAT_B8G8R8A8_UNORM,
FormatB8G8r8a8Snorm = vk::FORMAT_B8G8R8A8_SNORM,
FormatB8G8r8a8Uscaled = vk::FORMAT_B8G8R8A8_USCALED,
FormatB8G8r8a8Sscaled = vk::FORMAT_B8G8R8A8_SSCALED,
FormatB8G8r8a8Uint = vk::FORMAT_B8G8R8A8_UINT,
FormatB8G8r8a8Sint = vk::FORMAT_B8G8R8A8_SINT,
FormatB8G8r8a8Srgb = vk::FORMAT_B8G8R8A8_SRGB,
FormatA8b8g8r8UnormPack32 = vk::FORMAT_A8B8G8R8_UNORM_PACK32,
FormatA8b8g8r8SnormPack32 = vk::FORMAT_A8B8G8R8_SNORM_PACK32,
FormatA8b8g8r8UscaledPack32 = vk::FORMAT_A8B8G8R8_USCALED_PACK32,
@ -216,12 +421,12 @@ c_enum!{
FormatBc6hSfloatBlock = vk::FORMAT_BC6H_SFLOAT_BLOCK,
FormatBc7UnormBlock = vk::FORMAT_BC7_UNORM_BLOCK,
FormatBc7SrgbBlock = vk::FORMAT_BC7_SRGB_BLOCK,
FormatEtc2R8g8b8UnormBlock = vk::FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
FormatEtc2R8g8b8SrgbBlock = vk::FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
FormatEtc2R8g8b8a1UnormBlock = vk::FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
FormatEtc2R8g8b8a1SrgbBlock = vk::FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
FormatEtc2R8g8b8a8UnormBlock = vk::FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
FormatEtc2R8g8b8a8SrgbBlock = vk::FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
FormatEtc2R8G8B8UnormBlock = vk::FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
FormatEtc2R8G8B8SrgbBlock = vk::FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
FormatEtc2R8G8B8a1UnormBlock = vk::FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
FormatEtc2R8G8B8a1SrgbBlock = vk::FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
FormatEtc2R8G8B8a8UnormBlock = vk::FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
FormatEtc2R8G8B8a8SrgbBlock = vk::FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
FormatEacR11UnormBlock = vk::FORMAT_EAC_R11_UNORM_BLOCK,
FormatEacR11SnormBlock = vk::FORMAT_EAC_R11_SNORM_BLOCK,
FormatEacR11g11UnormBlock = vk::FORMAT_EAC_R11G11_UNORM_BLOCK,
@ -253,6 +458,31 @@ c_enum!{
FormatAstc12x10UnormBlock = vk::FORMAT_ASTC_12x10_UNORM_BLOCK,
FormatAstc12x10SrgbBlock = vk::FORMAT_ASTC_12x10_SRGB_BLOCK,
FormatAstc12x12UnormBlock = vk::FORMAT_ASTC_12x12_UNORM_BLOCK,
FormatAstc12x12SrgbBlock = vk::FORMAT_ASTC_12x12_SRGB_BLOCK,
}
FormatAstc12x12SrgbBlock = vk::FORMAT_ASTC_12x12_SRGB_BLOCK
}
#[derive(Copy, Clone)]
pub enum SurfaceTransform {
IdentityBit,
Rotate90Bit,
Rotate180Bit,
Rotate270Bit,
HorizontalMirrorBit,
HorizontalMirrorRotate90Bit,
HorizontalMirrorRotate180Bit,
HorizontalMirrorRotate270Bit,
InheritBit,
}
c_enum!{
SurfaceTransform, u32,
IdentityBit = vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
Rotate90Bit = vk::SURFACE_TRANSFORM_ROTATE_90_BIT_KHR,
Rotate180Bit = vk::SURFACE_TRANSFORM_ROTATE_180_BIT_KHR,
Rotate270Bit = vk::SURFACE_TRANSFORM_ROTATE_270_BIT_KHR,
HorizontalMirrorBit = vk::SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR,
HorizontalMirrorRotate90Bit = vk::SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR,
HorizontalMirrorRotate180Bit = vk::SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR,
HorizontalMirrorRotate270Bit = vk::SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR,
InheritBit = vk::SURFACE_TRANSFORM_INHERIT_BIT_KHR
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Cargo &lt;examples&gt;" level="project" />
<orderEntry type="library" name="Rust &lt;examples&gt;" level="project" />
</component>
</module>

View file

@ -0,0 +1,29 @@
<component name="libraryTable">
<library name="Cargo &lt;examples&gt;">
<CLASSES>
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.7.0" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.3.6" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-iter-0.1.32" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.1.32" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.15" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_library-0.1.5" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/glfw-0.9.1" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-1.2.4" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/glfw-sys-3.2.0" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-complex-0.1.33" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.1.33" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/enum_primitive-0.1.0" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.32" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.2.3" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.32" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-0.2.1" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.19" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-0.1.34" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.1.34" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.17" />
<root url="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.14" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Rust &lt;examples&gt;">
<CLASSES>
<root url="file://$USER_HOME$/src/rust/src/libstd" />
<root url="file://$USER_HOME$/src/rust/src/libcore" />
<root url="file://$USER_HOME$/src/rust/src/libcollections" />
<root url="file://$USER_HOME$/src/rust/src/liballoc" />
<root url="file://$USER_HOME$/src/rust/src/librustc_unicode" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

17
examples/.idea/misc.xml Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="true" assert-keyword="false" jdk-15="false" />
<component name="RustProjectSettings">
<option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
</component>
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/examples.iml" filepath="$PROJECT_DIR$/.idea/examples.iml" />
</modules>
</component>
</project>

View file

@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3a672c76-e910-4d20-96de-22a0609c096d" name="Default" comment="" />
<ignored path="examples.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="examples" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="main.rs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="37">
<caret line="7" column="22" selection-start-line="7" selection-start-column="22" selection-end-line="7" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/main.rs" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="-16" />
<option name="width" value="1920" />
<option name="height" value="1096" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes />
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$USER_HOME$/src/rust/src" />
<property name="SearchEverywhereHistoryKey" value="mai&#9;FILE&#9;file:///home/maik/projects/ashlib/examples/src/main.rs&#10;ma&#9;FILE&#9;file:///home/maik/projects/ashlib/examples/src/main.rs" />
<property name="org.rust.alreadyTriedToolchainAutoDiscovery" value="true" />
<property name="org.rust.alreadyTriedLibraryAutoDiscovery" value="true" />
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors.Font" />
<property name="settings.editor.splitter.proportion" value="0.2" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="CargoCommandRunConfiguration" factoryName="Cargo Command" show_console_on_std_err="false" show_console_on_std_out="false">
<option name="additionalArguments" value="" />
<option name="command" value="run" />
<option name="environmentVariables">
<map />
</option>
<option name="printBacktrace" value="false" />
<module name="examples" />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JUnitTestDiscovery" factoryName="JUnit Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="SCRATCH_FILE_ID" value="0" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="examples" />
<envs />
<method />
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="TestNGTestDiscovery" factoryName="TestNG Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="3a672c76-e910-4d20-96de-22a0609c096d" name="Default" comment="" />
<created>1471360642395</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1471360642395</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="-16" width="1920" height="1096" extended-state="0" />
<editor active="false" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32969216" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/glfw-0.9.1/src/lib.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="325">
<caret line="423" column="7" selection-start-line="423" selection-start-column="7" selection-end-line="423" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="37">
<caret line="7" column="22" selection-start-line="7" selection-start-column="22" selection-end-line="7" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

View file

@ -1,14 +1,20 @@
[root]
name = "vk_loader"
name = "example"
version = "0.1.0"
dependencies = [
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"ash 0.1.0",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"vk_loader 0.1.0",
"vk_loader2 0.1.0",
]
[[package]]
name = "ash"
version = "0.1.0"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -36,15 +42,6 @@ dependencies = [
"num 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "example"
version = "0.1.0"
dependencies = [
"ash 0.1.0",
"glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vk_loader 0.1.0",
]
[[package]]
name = "gcc"
version = "0.3.32"
@ -158,6 +155,11 @@ name = "num-traits"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "owning_ref"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand"
version = "0.3.14"
@ -188,6 +190,20 @@ dependencies = [
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vk_loader"
version = "0.1.0"
dependencies = [
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vk_loader2"
version = "0.1.0"
dependencies = [
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dfcf5bcece56ef953b8ea042509e9dcbdfe97820b7e20d86beb53df30ed94978"
@ -206,6 +222,7 @@ dependencies = [
"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c"
"checksum num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "48cdcc9ff4ae2a8296805ac15af88b3d88ce62128ded0cb74ffb63a587502a84"
"checksum num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "95e58eac34596aac30ab134c8a8da9aa2dc99caa4b4b4838e6fc6e298016278f"
"checksum owning_ref 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ba6a14c7d6fb686c1c542663b2094934f1cbfbdb22b70305f09ed8eb2f2edf3"
"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5"
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"

View file

@ -6,4 +6,7 @@ authors = ["maik klein <maikklein@googlemail.com>"]
[dependencies]
glfw = "0.9.1"
vk_loader = { version = "0.1.0", path = "../vk_loader"}
vk_loader2 = { version = "0.1.0", path = "../vk_loader2"}
ash = { version = "0.1.0", path = "../ash"}
owning_ref = "0.2.0"
bitflags = "0.7.0"

View file

@ -1,46 +1,350 @@
#![feature(conservative_impl_trait)]
#![allow(dead_code)]
extern crate owning_ref;
extern crate ash;
extern crate vk_loader;
extern crate vk_loader2 as vk;
extern crate glfw;
use ash::instance::*;
use vk_loader as vk;
use ash::extensions::*;
use glfw::*;
use std::sync::Arc;
use std::thread;
use ash::device::*;
use std::ptr;
use std::ffi::{CStr, CString};
use std::mem;
fn main() {
let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
let (mut window, events) =
glfw.create_window(300, 300, "Hello this is window", glfw::WindowMode::Windowed)
.expect("Failed to create GLFW window.");
fn main(){
let ext = Instance::extenstion_properties();
let app_info = ApplicationInfo { name: "Test".to_owned() };
let instance = Arc::new(Instance::new(&app_info, &ext, |s| println!("{}", s)));
let surface = instance.create_surface(&window);
let pdevices = instance.get_pysical_devices();
let device_infos: Vec<PhysicalDeviceInfos> =
pdevices.iter().map(|pd| pd.get_physical_device_infos()).collect();
let suiteable_devices: Vec<_> = device_infos.iter().filter(|infos| true).collect();
assert!(suiteable_devices.len() > 0);
let pdevice = pdevices[0].clone();
let dext = DeviceExtension { khr_swapchain: true, ..DeviceExtension::empty() };
let features = device_infos[0].features;
let index = device_infos[0]
.queue_families
.iter()
.enumerate()
.filter(|&(index, q)| {
q.queueCount > 0 && (q.queueFlags & vk::QUEUE_GRAPHICS_BIT) != 0 &&
pdevice.has_surface_support(index as u32, &surface)
})
.map(|(index, q)| index)
.nth(0)
.expect("Unable to find suitable device") as u32;
let ldevice = pdevice.create_device(index, &dext, &features);
let queue = ldevice.get_device_queue(index, 0);
let vkstatic = match *ash::load::VK_LIB {
Ok(ref lib) => {
let mut err = None;
let result = vk::Static::load(|name| unsafe {
let name = name.to_str().unwrap();
match lib.symbol(name) {
Ok(s) => s,
Err(_) => { // TODO: return error?
err = Some(ash::load::LoadingError::MissingEntryPoint("".to_owned()));
ptr::null()
}
}
});
if let Some(err) = err {
Err(err)
} else {
Ok(result)
}
},
Err(ref err) => Err(err.clone()),
}.unwrap();
let entry = vk::EntryFn::load(|name| unsafe {
mem::transmute(vkstatic.get_instance_proc_addr(ptr::null_mut(), name.as_ptr()))
});
println!("{:?}", entry);
let app_name = CString::new("TEST").unwrap();
let raw_name = app_name.as_ptr();
let appinfo = vk::ApplicationInfo {
p_application_name: raw_name,
s_type: vk::StructureType::ApplicationInfo,
p_next: ptr::null(),
application_version: 0,
p_engine_name: raw_name,
engine_version: 0,
api_version: 0,
};
let create_info = vk::InstanceCreateInfo {
s_type: vk::StructureType::ApplicationInfo,
p_application_info: &appinfo,
p_next: ptr::null(),
pp_enabled_layer_names: ptr::null(),
enabled_layer_count: 0,
pp_enabled_extension_names: ptr::null(),
enabled_extension_count: 0,
flags: 0,
};
let mut instance: vk::Instance = unsafe { mem::uninitialized() };
println!("{:?}", instance);
unsafe {
let i = entry.create_instance(&create_info, ptr::null(), &mut instance);
println!("{:?}", i);
}
// let r1 = vk::load_with(|name| unsafe {
// let cs = CString::new(name).unwrap();
// mem::transmute(vk::get_instance_proc_addr(ptr::null_mut(), cs.as_ptr()))
// });
// let app_name = CString::new("TEST").unwrap();
// let raw_name = app_name.as_ptr();
// let appinfo = vk::ApplicationInfo {
// p_application_name: raw_name,
// s_type: vk::StructureType::ApplicationInfo,
// p_next: ptr::null(),
// application_version: 0,
// p_engine_name: raw_name,
// engine_version: 0,
// api_version: 0,
// };
// let create_info = vk::InstanceCreateInfo {
// s_type: vk::StructureType::ApplicationInfo,
// p_application_info: &appinfo,
// p_next: ptr::null(),
// pp_enabled_layer_names: ptr::null(),
// enabled_layer_count: 0,
// pp_enabled_extension_names: ptr::null(),
// enabled_extension_count: 0,
// flags: 0,
// };
// let mut instance: vk::Instance = unsafe { mem::uninitialized() };
// println!("{:?}", instance);
// unsafe {
// let i = vk::create_instance(&create_info, ptr::null(), &mut instance);
// println!("{:?}", i);
//
// }
// println!("{:?}", instance);
// let r2 = vk::load_with(|name| unsafe {
// let cs = CString::new(name).unwrap();
// mem::transmute(vk::get_instance_proc_addr(instance, cs.as_ptr()))
// });
// println!("{:?}", r2);
// let r3 = vk::load_with(|name| unsafe {
// let cs = CString::new(name).unwrap();
// mem::transmute(vk::get_instance_proc_addr(ptr::null_mut(), cs.as_ptr()))
// });
// println!("{:?}", r3);
}
//use ash::instance::*;
//use vk_loader as vk;
//use ash::extensions::*;
//use glfw::*;
//use std::sync::Arc;
//use std::thread;
//use ash::device::*;
//use ash::surface;
//use ash::commandpool;
//use std::cell::RefCell;
//use std::marker;
//use std::ptr;
//use ash::device;
//fn handle_window_event(window: &mut glfw::Window, event: glfw::WindowEvent) {
// match event {
// glfw::WindowEvent::Key(Key::Escape, _, Action::Press, _) => window.set_should_close(true),
// _ => {}
// }
//}
//
//fn main() {
// let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
//
// let (mut window, events) = glfw.create_window(1920,
// 1080,
// "Hello this is window",
// glfw::WindowMode::Windowed)
// .expect("Failed to create GLFW window.");
//
// window.set_key_polling(true);
// window.make_current();
// let ext = Instance::extenstion_properties();
// let app_info = ApplicationInfo { name: "Test".to_owned() };
// let instance = Arc::new(Instance::new(&app_info, &ext, |s| println!("{}", s)));
// let surface = instance.create_surface(&window);
// let pdevices = instance.get_pysical_devices();
// let device_infos: Vec<PhysicalDeviceInfos> =
// pdevices.iter().map(|pd| pd.get_physical_device_infos()).collect();
// let suiteable_devices: Vec<_> = device_infos.iter().filter(|infos| true).collect();
// assert!(suiteable_devices.len() > 0);
// let pdevice = pdevices[0].clone();
// let dext = DeviceExtension { khr_swapchain: true, ..DeviceExtension::empty() };
// let features = device_infos[0].features;
// println!("{:?}", device_infos[0].queue_families[1].queueCount);
// let index = device_infos[0]
// .queue_families
// .iter()
// .enumerate()
// .filter(|&(index, q)| {
// q.queueCount > 0 && (q.queueFlags & vk::QUEUE_GRAPHICS_BIT) != 0 &&
// pdevice.has_surface_support(index as u32, &surface)
// })
// .map(|(index, _)| index)
// .nth(0)
// .expect("Unable to find suitable device") as u32;
// let ldevice: device::Device = pdevice.create_device(index, &dext, &features);
//
// let queue = ldevice.get_device_queue::<GraphicsQueueFamily>(index, 0);
//
//
// let surface_formats = pdevice.get_surface_formats(&surface);
// assert!(surface_formats.len() > 0, "No format found");
//
// let surface_format = match surface_formats[0].format {
// ash::surface::Format::FormatUndefined => ash::surface::Format::FormatR8G8B8Unorm,
// format => format,
// };
//
// let surface_capabilities = pdevice.get_surface_capabilities(&surface);
//
// let mut image_count = 2;
// if image_count < surface_capabilities.minImageCount {
// image_count = surface_capabilities.minImageCount;
// } else if (surface_capabilities.maxImageCount != 0 &&
// image_count > surface_capabilities.maxImageCount) {
// image_count = surface_capabilities.maxImageCount;
// }
//
// println!("image count: {}", image_count);
//
// let mut surface_width = 1920;
// let mut surface_height = 1080;
//
// let surface_resolution = surface_capabilities.currentExtent;
// if surface_resolution.width != std::u32::MAX {
// surface_width = surface_resolution.width;
// surface_height = surface_resolution.height;
// }
//
// let mut pre_transform = surface_capabilities.currentTransform;
// if pre_transform & vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR > 0 {
// pre_transform = vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
// }
// println!("transform: {:b}", pre_transform);
//
// let present_modes = pdevice.get_surface_presentmodes(&surface);
// let present_mode = present_modes.iter()
// .cloned()
// .find(|&p| p == vk::PRESENT_MODE_MAILBOX_KHR)
// .unwrap_or(vk::PRESENT_MODE_FIFO_KHR);
// let swapchain = ldevice.create_swapchain(&surface,
// surface_format,
// image_count,
// surface_formats[0].color_space,
// surface_resolution,
// 1,
// vk::IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
// vk::SHARING_MODE_EXCLUSIVE,
// 0, // ?????,
// ptr::null(),
// pre_transform,
// vk::COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
// present_mode,
// true,
// 0);
// let swapchain_images = swapchain.get_images();
//
// let present_image_views = swapchain_images.into_iter()
// .map(|image| {
// let subresource_range = vk::ImageSubresourceRange {
// aspectMask: vk::IMAGE_ASPECT_COLOR_BIT,
// baseMipLevel: 0,
// levelCount: 1,
// baseArrayLayer: 0,
// layerCount: 1,
// };
//
// let components = vk::ComponentMapping {
// r: vk::COMPONENT_SWIZZLE_R,
// g: vk::COMPONENT_SWIZZLE_G,
// b: vk::COMPONENT_SWIZZLE_B,
// a: vk::COMPONENT_SWIZZLE_A,
// };
//
// ldevice.create_image_view(0,
// image,
// vk::IMAGE_VIEW_TYPE_2D,
// surface_format.to_number(),
// components,
// subresource_range)
// })
// .collect::<Vec<_>>();
//
//
// let command_pool = ldevice.create_commandpool(vk::CommandPoolCreateInfo {
// sType: vk::STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
// pNext: ptr::null(),
// flags: vk::COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
// queueFamilyIndex: queue.index,
// },
// queue.handle);
// let command_buffers = ldevice.allocate_command_buffers(vk::CommandBufferAllocateInfo {
// sType: vk::STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
// commandPool: command_pool,
// level: vk::COMMAND_BUFFER_LEVEL_PRIMARY,
// commandBufferCount: 2,
// pNext: ptr::null(),
// });
//
// let setup_cmd_buffer = command_buffers[0];
// let draw_cmd_buffer = command_buffers[1];
//
// let depth_image = ldevice.create_image(0,
// vk::IMAGE_TYPE_2D,
// vk::FORMAT_D16_UNORM,
// vk::Extent3D {
// width: surface_width,
// height: surface_height,
// depth: 1,
// },
// 1,
// 1,
// vk::SAMPLE_COUNT_1_BIT,
// vk::IMAGE_TILING_OPTIMAL,
// vk::IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
// vk::SHARING_MODE_EXCLUSIVE,
// 0,
// ptr::null(),
// vk::IMAGE_LAYOUT_UNDEFINED);
// let mem_prop = pdevice.get_device_memory_properties();
// let depth_image_mem_req = ldevice.get_image_memory_requirements(&depth_image);
// let image_memory = ldevice.allocate_memory(depth_image_mem_req,
// mem_prop,
// vk::MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
// .expect("Image device memory error");
// ldevice.bind_image_memory(depth_image.handle, image_memory, 0);
// let submit_fence = ldevice.create_fence();
// ldevice.begin_command_buffer(setup_cmd_buffer,
// vk::CommandBufferBeginInfo {
// sType: vk::STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
// pNext: ptr::null(),
// flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
// pInheritanceInfo: ptr::null(),
// });
//
// let layout_transition_barrier = vk::ImageMemoryBarrier {
// sType: vk::STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
// pNext: ptr::null(),
// srcAccessMask: 0,
// dstAccessMask: vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
// vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
// oldLayout: vk::IMAGE_LAYOUT_UNDEFINED,
// newLayout: vk::IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
// srcQueueFamilyIndex: vk::QUEUE_FAMILY_IGNORED,
// dstQueueFamilyIndex: vk::QUEUE_FAMILY_IGNORED,
// image: depth_image.handle,
// subresourceRange: vk::ImageSubresourceRange {
// aspectMask: vk::IMAGE_ASPECT_DEPTH_BIT,
// baseMipLevel: 0,
// levelCount: 1,
// baseArrayLayer: 0,
// layerCount: 1,
// },
// };
// ldevice.cmd_pipeline_barrier(setup_cmd_buffer,
// vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT,
// vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT,
// 0,
// 0,
// ptr::null(),
// 0,
// ptr::null(),
// 1,
// layout_transition_barrier);
// ldevice.end_command_buffer(setup_cmd_buffer);
//
// unsafe {
// ldevice.destroy_command_pool(command_pool);
// ldevice.dp().FreeMemory(ldevice.handle(), image_memory, ptr::null());
// }
// // while !window.should_close() {
// // glfw.poll_events();
// // for (_, event) in glfw::flush_messages(&events) {
// // handle_window_event(&mut window, event);
// // }
// // }
//}

10
vk_loader/Cargo.lock generated
View file

@ -1,10 +1,8 @@
[root]
name = "rvk"
name = "vk_loader"
version = "0.1.0"
dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"vk-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -26,13 +24,7 @@ dependencies = [
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vk-sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f"
"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2"
"checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a"
"checksum vk-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19fac1055c66087e0a0ccfae6aeed561ab8efb5f3759229615007c9b148108af"

1
vk_loader2/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
target

30
vk_loader2/Cargo.lock generated Normal file
View file

@ -0,0 +1,30 @@
[root]
name = "vk_loader"
version = "0.1.0"
dependencies = [
"shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "shared_library"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f"
"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2"
"checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a"

8
vk_loader2/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "vk_loader2"
version = "0.1.0"
authors = ["maik klein <maikklein@googlemail.com>"]
[dependencies]
shared_library = "0.1.5"

4186
vk_loader2/src/lib.rs Normal file

File diff suppressed because it is too large Load diff