GPU、旧硬件、3D 加速和库

发布于 2024-07-09 05:04:41 字数 682 浏览 7 评论 0原文

我正在编写一个 2d 库,它将具有 3d 加速,但我想以一种能够在旧硬件上有效运行的方式来实现。 可能使用 typedef 来隐藏您的目标模式不支持的选项/功能。 (也可能打开了仿真功能)

旧硬件做了哪些事情? 这是我所知道的问题和事情的清单。

  • 瓷砖,这将不受支持。 它很旧,我的库将支持像素访问
  • 带有滚动的单个像素缓冲区。 示例 GBA
  • 多个表面,具有表面到表面快速 blt(无拉伸)
  • 多个表面,具有表面到表面快速 blt,具有拉伸(也许这是模拟的?有任何 HW 拉伸图像适合您吗?)
  • HW 像素填充(我想我看到了该选项DX)
  • HW 透明色? (颜色是透明的,我想我在 DX 规格中看到过)
  • 纹理,旧时使用的是 2 的幂。宽度不必是与高度相同的 2 的幂? (例如 64x256),是否要求它们是相同的
  • 纹理,较新的硬件可以让它们具有任何宽度和高度(或者这是一个谎言?)
  • 纹理可以采用疯狂的格式(ARGB 8888、ABGR 8888、ABGR 2 10 10 10 )

另外,我不能做纹理到纹理块传输? 就像在 HW 中从纹理 A 到 B 的 60x40 副本一样? 纹理也可以在调色板中吗? (我不会支持这个) 最后我应该记住着色器 8)

我还缺少什么?

i am writing a 2d lib which will have 3d acceleration but i'd like to do it in a way that it will efficiently run on older HW. Possibly typedefs to hide options/functions that your targeted mode does not support. (also there may be emulation func turned on)

What are some of the things older HW do? here is a list of questions and things i know of.

  • Tiles, this will be unsupported. Its to old, my lib will support pixel access
  • Single pixel buffer with scrolling. Example GBA
  • multiple surface with surface to surface quick blt (no stretch)
  • multiple surface with surface to surface quick blt with stretch (maybe this was emulated? does any HW stretch images for you?)
  • HW pixel fill (i thought i saw the option in DX)
  • HW transparent colour? (colour which is transparent, thought i seen in DX specs)
  • Textures, older use to be a power of 2. The width does not have to be the same power of 2 as height? (example 64x256), does any require them to be the same
  • Textures, newer HW can have them any width and height (or is this a lie?)
  • Textures can be in crazy formats (ARGB 8888, ABGR 8888, ABGR 2 10 10 10)

Also, i cannot do a texture to texture blit? as in copy 60x40 from texture A to B in HW ?
Also can textures be in palette? (i wont support this)
and finally i should keep in mind about shaders 8)

What else am i missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

动次打次papapa 2024-07-16 05:04:41

你指的3D加速是什么? 如果是OpenGL兼容的硬件:

  • 纹理需要是2的幂,
    宽度和高度可以任意
    两个的幂。
  • 没有力量的纹理
    2 个约束启用
    您可以测试的 openGL 扩展
    对于(并且存在于几乎所有
    新硬件)。
  • 几种不同的
    纹理格式标准化为
    OpenGL,我不知道扩展
    具有任意纹理格式。

关于 2D:

  • 普通硬件 2D 加速支持位块传输,但不支持拉伸。 拉伸可用作“视频加速”。 例如,在 X11 中,您可以使用 xv 扩展来获得加速拉伸,但仅限于 YUV 颜色空间。
  • 对于真正快速的图像绘制操作,请查看 Imlib2。 它可以用软件完成所有的事情,而且速度非常快。 如果 3D 硬件加速不可用,也许这是正确的方法。 2D 硬件加速在性能上有所不同,例如 X11 RENDER 加速经常被 Imlib2 击败。 http://docs.enlightenment.org/api/imlib2/html/

DirectFB 是一个值得您关注的有趣项目,它尝试大量使用硬件 2D 加速:http://www.directfb.org/。 directfb.org/

What 3D accelleration are you referring to? If it is OpenGL compatible hardware:

  • Textures need to be power of 2,
    width and height can have arbitrary
    power of two.
  • Textures without power
    of 2 constraint are enabled with an
    openGL extension which you can test
    for (and is present on almost all
    new hardware).
  • Several different
    texture formats are standardized in
    OpenGL, I don't know extensions to
    have arbitrary texture formats.

About 2D:

  • Normal hardware 2D acceleration supports blitting, but not stretching. Stretching is available as "video acceleration". For example, in X11 you can use the xv extension to get accelerated stretching, but only in YUV color space.
  • For really fast image drawing operations, check out Imlib2. It does everything in software, but blazingly fast. Perhaps the right way to go if 3D hardware acceleration is not available. 2D hw acceleration differs in performance, and for example the X11 RENDER acceleration is often beaten by Imlib2. http://docs.enlightenment.org/api/imlib2/html/

An interesting project for you to look at could also be DirectFB, which tries to heavily use HW 2D acceleration: http://www.directfb.org/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文