DirectX 10、11和12常量缓冲区对齐 [英] DirectX 10, 11, and 12 Constant Buffer Alignment

查看:165
本文介绍了DirectX 10、11和12常量缓冲区对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

The microsoft directx 12 samples say that constant buffer's need to be 256 byte aligned.

基本上我当时想知道的是,directx 10和11驱动程序是否自动将常量缓冲区填充为256字节对齐的?我想知道,因为我从未见过Directx以前版本中对常量缓冲区对齐的要求, 而且除了其中一个Microsoft示例之外,我没有遇到任何有关此的信息.我确实知道hlsl将常量缓冲区数据打包到16个字节的边界中,但是那不是一回事.这是所有CBV,UAV和SRV的256对准要求,但是 在无人机和SRV中自动完成?有人可以指出任何可能更详细地描述此要求的文档吗?

Basically what i'm wondering then, is did the directx 10 and 11 drivers automatically pad constant buffers to be 256 byte aligned? I'm wondering because i've never seen this constant buffer alignment requirement for previous version of directx, and I have not come across anything about this except in one of the microsoft samples. I do know hlsl packs constant buffer data into 16 byte boundaries, but thats not the same thing. Is this 256 alignment a requirement for all CBV's, UAV's and SRV's, but done automatically in UAV's and SRV's? Can anybody point me to any documentation that might describe this requirement in a little more detail?

我想知道的另一个原因是,在dx11中,具有单个浮点数的常量缓冲区和具有64个浮点数的常量缓冲区(浮点数为4字节)之间没有真正的区别.驱动程序不必填充缓冲区 在第二个示例中要对齐256字节,从而使第二个示例更快?

Another reason i'm wondering then, is that in dx11, there would be no real difference between a constant buffer with a single float and a constant buffer with 64 floats (a float being 4 bytes), except that the driver would not have to pad the buffer to be 256 byte aligned in the second example, making the second example faster?

推荐答案

Hello Braynzar Soft,

Hello Braynzar Soft,

此论坛是Windows Form论坛,您的主题与DirectX有关,我认为这不是解决您问题的合适论坛.我试图认为哪个论坛可能更适合您.请等待一段时间.

This forum is Windows Form forum and your topic is related to DirectX, which I think is not the right forum for your issue. I'm trying to think that which forum might be better for you. Please wait for some time.

最诚挚的问候,

巴里


这篇关于DirectX 10、11和12常量缓冲区对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆