CSharpGL(56)[翻訳]バルカンエントリ(RPM)

CSharpGL(56)[翻訳]は、バルカンの取得します

この記事は(あるhttp://ogldev.atspace.co.uk/www/tutorial50/tutorial50.htmlバルカンを学ぶための試みとして翻訳)。

単語を翻訳しないで、最初の文を見て、それぞれの時間は、それが学校を終えていないでしょう。 

背景の背景

おそらく、今ではおよそかなり聞いた  バルカン、クロノス(のOpenGLの開発を担当して非営利団体)からの新しいグラフィックスAPIを。

あなたはバルカン、クロノスは、作成した新しいグラフィックスAPIを聞いたことがあります。クロノスOpenGLは、非営利団体の開発を担当しています。

バルカンは2月、2016年に発表され、OpenGLと24年後には完全に新しい標準と現在のモデルからの脱却です。

OpenGLは、24年後、バルカンは2016年2月にリリースされた登場しました。これは、新規格である現在のモデルを、放棄しました。

私は、OpenGLと比較して、それはレベルはるかに低く、開発者のための消費電力と性能の多くの機会を提供することを言うためにのみバルカンのさまざまな機能について多くの詳細には触れません。

私は、新機能の束の細部にまでスローされません。簡単に言えば、OpenGLのに比べ、バルカン基礎となる多くのエネルギーは、開発者のための素晴らしい機会を提供し、パフォーマンスを向上させます。

しかし、偉大な力で大きな責任が伴います。

しかし、偉大な力は大きな責任が来ます。

開発者は、以前にドライバーの責任だったように、コマンドバッファ、同期やメモリ管理などのさまざまな側面を担当しています。

開発者は、このような前に運転者の責任だった命令キャッシュ、同期、メモリ管理、などのさまざまな側面を担当しなければなりません。

開発者は、アプリケーションが構成されている方法についての持っているユニークな知識を通じ、バルカンAPIの使用方法は、システム全体のパフォーマンスを向上させる方法で調整することができます。

アプリケーション構造の知識ベースの開発、彼はバルカンのAPIを使用すると、より高いシステムパフォーマンスを調整することができます。

 

人々を驚か事がバルカンについての最も、私見では、唯一の画面上の最初の三角形を取得するために書かれなければならないコードの量です。

最も驚くべきことは、私見、画面上の最初の三角形のために必要なコードの膨大な量です。

私たちは、これは大きな変化であり、もう1つはそれについてのチュートリアルを書き込もうとすると挑戦となった最初のいくつかのチュートリアルでOpenGLで書かなければならなかったいくつかの行にこれを比較します。

最初のチュートリアルに比べると、私たちは大きな変化はなく、バルカンチュートリアルを書くことの難しさであるコードのOpenGLの数行を書きます。

そのため、いつものようにOGLDEVと、私は、ステップバイステップ材料を提示しようとするでしょう。

だから、OGLDEVいつものように、私はステップのチュートリアルでステップを展開します。

私たちは、それぞれに追加の進捗状況を作り、いくつかのチュートリアルで私たちの最初の三角形のデモを開発します。

我々は、複数のチュートリアルで、各チュートリアルの進歩の少し三角形の第一の例を完了します。

また、代わりにコードの一方の長枚でのAPIの数十をレイアウトの私は、私はあなたが理解するためにあなたの将来のアプリケーションにあまりにも多くの制約をかけることなく、それを簡単にすることを願っています簡単なソフトウェアの設計を提示します。

また、私はAPIの大部分は表示されませんが、ソフトウェアの設計のアイデアがある示すこと。私は、これは読者の理解を促進することを願っています。

この後で捨てることは自由です教育のデザインを検討してください。

教育の目的のために設計し、あなたが学ぶので、あなたは捨てることができます。

 

私たちは、コードを通じて進歩を遂げるように私はちょうど一般的な画像の図を提示したい。この時点でのように、我々は1でバルカン1のコアコンポーネントを検討します。

コードでは、一つ一つは、我々はバルカンコアコンポーネントを学びます。今、私たちは、概要を見て:

 

 

この図は、すべてのことである完全な表現をしませ意味します。

もちろん、この数字は、すべてのコンポーネントを示していません。

これはおそらく、ほとんどのアプリケーションに存在する唯一の主要なコンポーネントが含まれています。

それが唯一の主要なコンポーネントは、ほとんどのアプリケーションで使用されますが含まれています。

The connectors between the objects represent the dependencies between them at creation or enumeration time.

对象之间的连线表示在创建或枚举时的依赖关系。

For example, in order to create a surface you need an instance object and when you enumerate the physical devices on your system you also need an instance.

例如,为了创建一个surface,你需要一个instance对象;当你枚举你系统上的物理设备时,你也需要一个instance对象。

The two colors roughly describe the software design that we will use.

两种颜色粗略地描述了我们将使用的软件设计方案。

The dark red objects will go into something I call the "core" and the light green objects will go into the "app".

暗红色对象将属于“core”,浅绿色对象将属于“app”。

We will later see why this makes sense.

我们稍后再看为什么是这样。

The application code that you will write will actually inherit from "app" and all of its members will be available for you for further use.

应用程序代码将继承自app,app的所有成员以后都将可用。

I hope this design will provide a solid base to develop future Vulkan tutorials.

我希望这样的设计能提供一个坚实的基础,用于开发将来的Vulkan教程。

 

System Setup 系统安装

The first thing we need to do is to make sure your system supports Vulkan and get everything ready for development.

我们要做的第一件事,是确保你的系统支持Vulkan,准备好开发所需的一切。

You need to verify that your graphics card supports Vulkan and install the latest drivers for it.

你需要验证你的图形卡是否支持Vulkan,并安装最新的驱动程序。

Since Vulkan is still new it's best to check for drivers updates often because hardware vendors will probably fix a lot of bugs before everything stabilizes.

由于Vulkan还很新,最好经常检查驱动更新,因为硬件厂商可能会在驱动稳定前修复很多bug。

Since there are many GPUs available I can't provide much help here.

由于有太多种GPU,我这里爱莫能助。

Updating/installing the driver on Windows should be fairly simple.

在Windows上更新/安装驱动应该相当简单。

On Linux the process may be a bit more involved.

在Linux上,就有点难缠。

My main development system is Linux Fedora and I have a GT710 card by NVIDIA.

我的开发系统是Linux的Fedora版本,显卡是NVIDIA的GT710。

NVIDIA provide a binary run file which can only be installed from the command line.

NVIDIA提供一个二进制运行文件,只能从命令行安装。

Other vendors have their own processes.

其他厂商有各自的方式。

On Linux you can use the 'lspci' to scan your system for devices and see what GPU you have.

在Linux上你可以用'lspci'命令扫描你的系统,看看有哪些设备,用的什么GPU。

You can use the '-v', '-vv' and '-vvv' options to get increasingly more info on your devices.

你可以用'-v'、'-vv'、'-vvv'来得到你的设备的越来越详细的信息。

 

The second thing we need is the Vulkan SDK by Khronos, available here.

第二件事,我们需要Khronos的Vulkan SDK,可在此下载。

The SDK includes the headers and libraries we need as well as many samples that you can use to get more info beyond what this tutorial provides.

SDK包含头文件和库文件,很多示例,比本教程多得多的信息。

At the time of writing this the latest version is 1.0.30.0 and I urge you to update often because the SDK is in active development.

写作本文时最新版本是1.0.30.0,我推荐读者时常更新,因为SDK还处于活跃地开发中。

That version number will be used throughout the next few sections so make sure you change it according to the version you have.

接下来的章节都将使用这个版本号,所以,根据你的版本号,相应地替换之。

 

Linux

Khronos provides a package only for Ubuntu in the form of an executable run file.

Khronos只给Ubuntu提供了一个可执行文件。

Executing this file should install everything for you but on Fedora I encoutered some difficulties so I used the following procedure (which is also forward looking in terms of writing the code later):

执行这个文件就可以安装所需的一切。但是在Fedora上我遇到了一些困难,所以我用下述步骤(也是预览一下代码):

  • bash$ chmod +x vulkansdk-linux-x86_64-1.0.30.0.run
  • base$ ./vulkansdk-linux-x86_64-1.0.30.0.run --target VulkanSDK-1.0.30.0 --noexec
  • base$ ln -s ~/VulkanSDK-1.0.30/1.0.30.0 ~/VulkanSDK

The above commands extract the contents of the package without running its internal scripts.

上述命令提取出包的内容,并执行里面的脚本。

After extraction the directory VulkanSDK-1.0.30.0 will contain a directory called 1.0.30.0 where the actual content of the package will be located.

提取完成后,文件夹VulkanSDK-1.0.30.0会包含一个子文件夹1.0.30.0,里面是实际的内容。

Let's assume I ran the above commands in my home directory (a.k.a in bash as '~') so we should end up with a '~/VulkanSDK' symbolic link to the directory with the actual content (directories such as 'source', 'samples', etc).

假定我是在home文件夹下运行的上述命令(即'~'),那么会有一个'~/VulkanSDK'符号链接到实际内容(文件夹'source'、'samples'等)。

This link makes it easier to switch your development environment to newer versions of the SDK.

这个链接使得切换到SDK的新版本更容易。

It points to the location of the headers and libraries that we need.

它指向我们需要的头文件和库文件的位置。

We will see later how to connect them to the rest of the system. Now do the following:

稍后我们将看到如何将它们连接到系统的其他部分。现在执行下述命令:

  • bash$ cd VulkanSDK/1.0.30.0
  • bash$ ./build_examples.sh

If everything went well the examples were built into 'examples/build'.

如果一切顺利,示例会出现在文件夹'examples/build'

To run the examples you must first cd into that directory.

为运行示例,你首先要进入这个文件夹。

You can now run './cube' and './vulkaninfo' to make sure Vulkan runs on your system and get some useful information on the driver.

你现在可以运行'./cube'和'./vulkaninfo'命令来确认Vulkan跑在你的系统上了,还可以得到一些驱动的有用信息。

Hopefully everything is OK so far so we want to create some symbolic links that will make the files we need for development easily accessible from our working environment.

单元一切顺利,目前我们想创建一些符号链接,方便我们使用开发过程中会用到的文件。

Change to the root user (by executing 'su' and entering the root password) and execute the following:

跳到root用户(执行'su'命令,输入root密码),执行下述命令:

  • bash# ln -s /home/<your username>/VulkanSDK/x86_x64/include/vulkan /usr/include
  • base# ln -s /home/<your username>/VulkanSDK/x86_x64/lib/libvulkan.so.1 /usr/lib64
  • base# ln -s /usr/lib64/libvulkan.so.1 /usr/lib64/libvulkan.so

What we did in the above three commands is to create a symbolic link from /usr/include to the vulkan header directory.

上述3个命令,创建了一个从/usr/include到Vulkan头文件夹的符号链接。

We also created a couple of symbolic links to the shared object files against which we are going to link our executables.

我们还创建了一些共享对象的符号链接,今后会将我们的程序链接到这些共享对象。

おすすめ

転載: www.cnblogs.com/strugglerisnd/p/10992498.html