webgpu学习问题,遇到了create graphics pipeline state failed错误
在学习webgpu并渲染图像时发生create graphics pipeline state failed with E_INVALIDARG (0x80070057)错误,图像无法成功渲染。
html代码:
const pipeline = device.createRenderPipeline({
// 管线布局配置
layout: 'auto',
// 顶点着色器配置
vertex: {//顶点相关配置
module: device.createShaderModule({code: vertex}),
entryPoint: "main",
buffers: [// 顶点所有的缓冲区模块设置
{//其中一个顶点缓冲区设置
arrayStride: 3*4,//一个顶点数据占用的字节长度,该缓冲区一个顶点包含xyz三个分量,每个数字是4字节浮点数,3*4字节长度
attributes: [{// 顶点缓冲区属性
shaderLocation: 0,//GPU显存上顶点缓冲区标记存储位置
format: "float32x3",//格式:loat32x3表示一个顶点数据包含3个32位浮点数
offset: 0//arrayStride表示每组顶点数据间隔字节数,offset表示读取改组的偏差字节数,没特殊需要一般设置0
}]
}
]
},
// 片元着色器配置
fragment: {
module: device.createShaderModule({code: fragment}),
entryPoint: "main",
targets: [{
format: format
}],
},
// 绘制图元配置
primitive: {
topology: "triangle-list",//三角形绘制顶点数据
}
});
wgsl代码:
//顶点着色器代码
const vertex = /*wgsl*/`
@vertex
fn main(@location(0) pos: vec3<f32>) -> @builtin(position) vec4<f32>{
// var pos2 = vec4<f32>(pos,1.0);//pos转齐次坐标
// pos2.x -= 0.2;//所有的顶点x坐标偏移0.2
// return pos2;//返回顶点数据,渲染管线下个环节使用
return vec4<f32>(pos,1.0);
}
`;
问题:经过一系列测试发现一个不理解的错误。当管线shaderLocation: 0 ;顶点着色器@location(0)不能正常显示,会出现create graphics pipeline state failed with E_INVALIDARG (0x80070057)错误。但当我将这两个值修改为1,图像正常渲染。令人费解!有懂得大神指教一下
webgpu学习问题,遇到了create graphics pipeline state failed错误的更多相关文章
- Vulkan SDK 之 Graphics Pipeline
A graphics pipeline consists of shader stages, a pipeline layout, a render pass, and fixed-function ...
- WebGPU学习(五): 现代图形API技术要点和WebGPU支持情况调研
大家好,本文整理了现代图形API的技术要点,重点研究了并行和GPU Driven Render Pipeline相关的知识点,调查了WebGPU的相关支持情况. 另外,本文对实时光线追踪也进行了简要的 ...
- WebGPU学习(三):MSAA
大家好,本文学习MSAA以及在WebGPU中的实现. 上一篇博文 WebGPU学习(二): 学习"绘制一个三角形"示例 下一篇博文 WebGPU学习(四):Alpha To Cov ...
- WebGPU学习(六):学习“rotatingCube”示例
大家好,本文学习Chrome->webgpu-samplers->rotatingCube示例. 上一篇博文: WebGPU学习(五): 现代图形API技术要点和WebGPU支持情况调研 ...
- WebGPU学习(十一):学习两个优化:“reuse render command buffer”和“dynamic uniform buffer offset”
大家好,本文介绍了"reuse render command buffer"和"dynamic uniform buffer offset"这两个优化,以及Ch ...
- A trip through the Graphics Pipeline 2011_01
It’s been awhile since I posted something here, and I figured I might use this spot to explain some ...
- WebGPU学习(一): 开篇
介绍 大家好,本系列从0开始学习WebGPU API,并给出相关的demo. WebGPU介绍 WebGPU相当于DX12/Vulkan,能让程序员更灵活地操作GPU,从而大幅提升性能. 为什么要学习 ...
- WebGPU学习(二): 学习“绘制一个三角形”示例
大家好,本文学习Chrome->webgl-samplers->helloTriangle示例. 准备Sample代码 克隆webgl-samplers Github Repo到本地. ( ...
- WebGPU学习(四):Alpha To Coverage
大家好,本文学习与MSAA相关的Alpha To Coverage以及在WebGPU中的实现. 上一篇博文 WebGPU学习(三):MSAA 学习Alpha To Coverage 前置知识 WebG ...
- WebGPU学习(七):学习“twoCubes”和“instancedCube”示例
大家好,本文学习Chrome->webgpu-samplers->twoCubes和instancedCube示例. 这两个示例都与"rotatingCube"示例差不 ...
随机推荐
- uniapp多次触发跳转问题
问题描述:快速点击跳转页面后会闪退到登陆页面 解决方案:重新封装uniapp跳转api,加防抖锁,To.ts import { NavigateToOptions, RedirectToOptions ...
- 重磅宣布|强强联合,腾讯云携手Veeam提供云上数据存储服务
近日获悉,腾讯云对象存储COS正式通过Veeam备份软件标准化测试,携手为用户提供云上数据存储服务. Veeam对COS的支持是通过SOBR( Scale out backup repository) ...
- SpringSecurity认证流程分析
重要组件 SecurityContext 上下文对象,Authentication(认证)对象会放在里面 SecurityContextHolder 用于拿到上下文对象的静态工具类 Authentic ...
- Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800!
1.问题截图 cat /var/log/mysql/error.log 2019-01-28T09:49:57.076019Z 0 [ERROR] [FATAL] InnoDB: Table flag ...
- Nginx make报错处理
https://blog.csdn.net/zhengdong12345/article/details/130669711 make报错:fatal error:sys/sysctl.h:No su ...
- Windows10 Linux子系统安装图形化界面的两种方法及其对比
理论上讲,所有Win10的Linux子系统都可以通过Windows10本机远程桌面和Xming的方法来安装使用图形化界面,笔者目前只接触了Debian系的Linux系统,故以Debian GNU/Li ...
- IM通讯协议专题学习(九):手把手教你如何在iOS上从零使用Protobuf
本文作者:丁同舟,来自金蝶随手记技术团队. 1.引言 接上篇<金蝶随手记团队的Protobuf应用实践(原理篇)>,本文将以iOS端的Objective-C代码为例,图文并茂地向您菔救绾卧 ...
- Solution Set - “请背诵每条魔法的禁忌”
目录 0.「HAOI 2018」「洛谷 P4494」反色游戏 1.「JSOI 2010」「洛谷 P6029」旅行 2.「CTSC 2017」「洛谷 P3774」最长上升子序列 3.「CTSC 2018 ...
- Solution Set -「LOCAL」冲刺省选 Round XXXI
\(\mathscr{Summary}\) 前期节奏太懒散,后面发现 C 题是水题都没时间写,提起精神来啊! A 题卡得比较久,对线性基的理解不够深刻,思来想去半天才把转移系数调对.B 题也卡 ...
- 老奶奶看了都会的WSL2连接USB设备教程!
老奶奶看了都会的WSL2-Ubuntu连接USB设备教程! 作者:SkyXZ CSDN:SkyXZ--CSDN博客 博客园:SkyXZ - 博客园 参考资料:微软官方文档连接 USB 设备 | Mic ...