简体   繁体   English

GPU,着色器编译器和OpenGL应用程序

[英]GPU, Shader Compiler and OpenGL Application

I have an OpenGL application which is using shaders.On the desktop where I have a graphics card and the driver installed it works fine, but when the GPU is disabled my application does not run and crashes after window creation. 我有一个使用着色器的OpenGL应用程序,在装有显卡和驱动程序的桌面上可以正常工作,但是当GPU被禁用时,创建窗口后我的应用程序无法运行并崩溃。 I have the below understandings and doubts: 我有以下理解和疑问:

  • The GLSL compiler is provided by the GPU vendor, so the application crashes when there is no GPU driver found. GLSL编译器由GPU供应商提供,因此在找不到GPU驱动程序时应用程序将崩溃。

  • Does this mean that on system without GPU, OpenGL applications which uses shaders will not run ? 这是否意味着在没有GPU的系统上,使用着色器的OpenGL应用程序将无法运行? My understanding was that the GPU only enhances the fps and the app should run without GPU as well. 我的理解是,GPU仅增强了fps,并且该应用也应在没有GPU的情况下运行。

As previously stated someone needs to provide an OpenGL implementation on your target platform/system. 如前所述,有人需要在目标平台/系统上提供OpenGL实现。 Usually, this is done by the graphics driver but there are software implementation (like mesa) available too. 通常,这是由图形驱动程序完成的,但是也可以使用软件实现(例如台面)。

Additionally, in order for you application to run it needs to check the availability of certain OpenGL features as some things, like shaders, might no be available for every driver/implementation/hardware. 另外,为了使您的应用程序运行,它需要检查某些OpenGL功能的可用性,因为某些事物(例如着色器)可能并非对每个驱动程序/实现/硬件都可用。 To put it in different words: the availability of an OpenGL implementation (usually a shared library) does not indicate the availability of shaders. 换句话说:OpenGL实现(通常是共享库)的可用性并不表示着色器的可用性。

To my knowledge most implementations do not provide a "software fallback" if no GPU is available. 据我所知,如果没有可用的GPU,大多数实现都不会提供“软件后备”。 Mesa does but it "only" provides OpenGL 3.1 and I'm not sure how good shader support is for software rendering. Mesa可以,但它“仅”提供OpenGL 3.1,我不确定软件渲染对着色器的支持如何。 I think it's work in progress. 我认为它正在进行中。

In order to run OpenGL app you must have a driver that understands OpenGL calls, you can run your app without GPU though if you install software emulating driver. 为了运行OpenGL应用程序,您必须具有能够理解OpenGL调用的驱动程序,即使您安装了模拟驱动程序的软件,也可以在不使用GPU的情况下运行您的应用程序。 One is Mesa AFAIK there is a windows version of Mesa too, another is Swiftshader from transgaming, but latter is commercial software. 一个是Mesa AFAIK,也有Windows版本的Mesa,另一个是转配游戏的Swiftshader,而另一个是商业软件。

  • The GLSL compiler is provided by the GPU vendor, so the application crashes when there is no GPU driver found. GLSL编译器由GPU供应商提供,因此在找不到GPU驱动程序时应用程序将崩溃。

Well, technically the GLSL compiler is part of a conforming OpenGL implementation of high enough version. 好吧,从技术上讲,GLSL编译器是足够高版本的OpenGL实现的一部分。 But that's just big words for essentially, what you said. 但这基本上就是您所说的话。 So: Yes . 所以: 是的

  • Does this mean that on system without GPU, OpenGL applications which uses shaders will not run? 这是否意味着在没有GPU的系统上,使用着色器的OpenGL应用程序将无法运行?

You need a OpenGL implementation capable of the features your program needs. 您需要一个能够实现程序所需功能的OpenGL实现。 Most OpenGL implementations are done in form of a combination of GPU and a (thin) driver layer that makes it possible to talk to the GPU by OpenGL. 大多数OpenGL实现都是通过GPU和(薄)驱动程序层的组合来完成的,从而可以通过OpenGL与GPU进行通信。

  • My understanding was that the GPU only enhances the fps and the app should run without GPU as well. 我的理解是,GPU仅增强了fps,并且该应用也应在没有GPU的情况下运行。

Well, that notion is wrong. 好吧,这个想法是错误的。 A GPU is not a mere "performance enhancer". GPU不仅是“性能增强器”。 A GPU is a fully featured processing plattform and all OpenGL versions are designed to be implemented using this kind of processor, that GPUs are. GPU是功能齐全的处理平台,并且所有OpenGL版本都旨在使用GPU这类处理器来实现。 There are software emulations, but those are slow and often not feature complete. 有一些软件仿真,但是这些仿真很慢并且通常功能不完整。

In fact OpenGL always was supposed to be implemented using some kind of GPU. 实际上,总是应该使用某种GPU来实现OpenGL。 The very first version of OpenGL was actually quite a literal 1:1 user space API of the registers and commands of SGI hardware graphics rasterizers; OpenGL的第一个版本实际上是SGI硬件图形光栅化程序的寄存器和命令的真正的1:1用户空间API。 heck even some of the early OpenGL tokens have the numeric values put into SGI hardware's control registers. 甚至有些早期的OpenGL令牌都将数字值放入SGI硬件的控制寄存器中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenGL着色器编译器优化? - OpenGL shader compiler optimization? Shader在Opengl Shader Builder上工作,但不在我的OpenGL应用程序中 - Shader working on Opengl Shader Builder but not in my OpenGL application 从 OpenGL 中的 gpu 获取顶点着色器转换的几何图形 - Getting vertex-shader transformed geometry back from the gpu in OpenGL 非GLSL OpenGL应用程序中的GPU使用情况 - GPU Usage in a non-GLSL OpenGL Application 绑定CPU或GPU? 分析OpenGL应用程序 - CPU or GPU bound? profiling OpenGL application 为什么使用OpenGL编译顶点着色器时出现着色器编译器错误#143,#160和#216? - Why am I getting a Shader Compiler Error #143, #160 and #216 when comiling a vertex Shader using OpenGL? 很多 OpenGL glDebugOutput Shader Stats / Shader Compiler / Other / notification severity messages with mesa radeon - lots of OpenGL glDebugOutput Shader Stats / Shader Compiler / Other / notification severity messages with mesa radeon OpenGL - 在没有 NV_gpu_shader5 的情况下访问 glMultiDrawElementsIndirect 内的无绑定纹理 - OpenGL - Accessing bindless textures inside glMultiDrawElementsIndirect without NV_gpu_shader5 MacOS 10.6上的Qt / OpenGL / GPU应用程序的编译问题 - Compilation issues with Qt/OpenGL/GPU application on MacOS 10.6 无法在 C++ openGL 中获得简单的 2D 着色器来绘制红色三角形(无编译器错误) - Unable to get trivial 2D shader to draw red triangle in C++ openGL (No compiler errors)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM