当前位置: 首页 > news >正文

男女做羞羞事动画网站免费郑州网站公司哪家好

男女做羞羞事动画网站免费,郑州网站公司哪家好,网站开发后所有权,网站制作怎样做概述 本来想将一个完整的可以从hlsl-dxil-spirv-nir-code的项目划分为两个动态库a.dll与b.dll。应用程序调用a.dll与b.dll执行相同的过程。 a.dll:执行dxil-spirv-nir前端相关的转换。 b.dll:执行nir-code的转换。 应用程序调用dxc实现hlsl-dxil的过程&…

概述

本来想将一个完整的可以从hlsl-dxil-spirv-nir-code的项目划分为两个动态库a.dll与b.dll。应用程序调用a.dll与b.dll执行相同的过程。
a.dll:执行dxil-spirv-nir前端相关的转换。
b.dll:执行nir-code的转换。
应用程序调用dxc实现hlsl-dxil的过程,调用a.dll实现dxil-spirv-nir过程,调用b.dll实现nir-code过程。
想法是好的,可以使代码结构清晰。
不过出现了问题,在b.dll实现nir-code过程出现崩溃

分析

在spirv-nir过程是可以的,在nir-code过程中执行pass出现错误

nir_shader* nir = spirv_to_nir((uint32_t*)spirv.data, word_count, NULL, 0,entry_point.stage, entry_point.name,&spirv_opts, &nir_opts);

原因是nir_opts参数控制了很多lower的行为。在进入b.dll执行nir-code过程,nir_opts所有的数据都为0了。
后来想一想,每个动态库都是一个独立的程序,全局变量不能跨程序保留值。
查阅nir结构,看看有没有保留的地方,结果发现了,如下

typedef struct nir_shader {gc_ctx *gctx;/** list of uniforms (nir_variable) */struct exec_list variables;/** Set of driver-specific options for the shader.** The memory for the options is expected to be kept in a single static* copy by the driver.*/const struct nir_shader_compiler_options *options;/** Various bits of compile-time information about a given shader */struct shader_info info;/** list of nir_function */struct exec_list functions;/*** The size of the variable space for load_input_*, load_uniform_*, etc.* intrinsics.  This is in back-end specific units which is likely one of* bytes, dwords, or vec4s depending on context and back-end.*/unsigned num_inputs, num_uniforms, num_outputs;/** Size in bytes of required implicitly bound global memory */unsigned global_mem_size;/** Size in bytes of required scratch space */unsigned scratch_size;/** Constant data associated with this shader.** Constant data is loaded through load_constant intrinsics (as compared to* the NIR load_const instructions which have the constant value inlined* into them).  This is usually generated by nir_opt_large_constants (so* shaders don't have to load_const into a temporary array when they want* to indirect on a const array).*/void *constant_data;/** Size of the constant data associated with the shader, in bytes */unsigned constant_data_size;struct nir_xfb_info *xfb_info;unsigned printf_info_count;u_printf_info *printf_info;
} nir_shader;

const struct nir_shader_compiler_options *options;就是保存option的地方。
在调用完a.dll之后,通过手动给他们复制,发现暂时可以解决问题。

不过运行到后面又出现问题

NIR_PASS_V(nir, nir_split_var_copies);

在上面pass宏定义中,执行nir_shader_serialize_deserialize函数崩溃,在该函数中执行glsl_array_type函数崩溃。

const glsl_type *
glsl_array_type(const glsl_type *element,unsigned array_size,unsigned explicit_stride)
{/* Ensure there's no internal padding, to avoid multiple hashes for same key. */STATIC_ASSERT(sizeof(struct array_key) == (3 * sizeof(uintptr_t)));struct array_key key = { 0 };key.element = (uintptr_t)element;key.array_size = array_size;key.explicit_stride = explicit_stride;const uint32_t key_hash = array_key_hash(&key);simple_mtx_lock(&glsl_type_cache_mutex);assert(glsl_type_cache.users > 0);   //崩溃在这里,glsl_type_cache全局变量都是0void *mem_ctx = glsl_type_cache.mem_ctx;if (glsl_type_cache.array_types == NULL) {glsl_type_cache.array_types = array_key_table_create(mem_ctx);}struct hash_table *array_types = glsl_type_cache.array_types;const struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(array_types, key_hash, &key);if (entry == NULL) {linear_ctx *lin_ctx = glsl_type_cache.lin_ctx;const glsl_type *t = make_array_type(lin_ctx, element, array_size, explicit_stride);struct array_key *stored_key = linear_zalloc(lin_ctx, struct array_key);memcpy(stored_key, &key, sizeof(key));entry = _mesa_hash_table_insert_pre_hashed(array_types, key_hash,stored_key,(void *) t);}const glsl_type *t = (const glsl_type *) entry->data;simple_mtx_unlock(&glsl_type_cache_mutex);assert(t->base_type == GLSL_TYPE_ARRAY);assert(t->length == array_size);assert(t->fields.array == element);return t;
}

发现glsl_type_cache全局结构体成员变量都是0。
至此,可以得出结论,在spirv-nir转换的过程中,对很多全局变量赋值了,如果不在同一个动态库中调用,那么就会出现全局变量统统为0的情况。

解决

将dxil-spirv-nir-code写到同一个动态库a.dll中,应用程序调用dxc实现hlsl-dxil的过程,调用a.dll实现dxil-spirv-nir-code过程,发现问题全部解决。

http://www.ds6.com.cn/news/103036.html

相关文章:

  • 汉阳网站建设鄂icp百度信息流推广
  • dns 部分网站打不开互联网营销师课程
  • 解决访问美国网站慢北京seo设计公司
  • 肯德基网站是哪家公司做的西地那非片吃了能延时多久
  • 中秋网页制作素材信息流优化师培训
  • 蓬莱做网站那家好网络营销的重要性与意义
  • wordpress页面自定义页面vue seo 优化方案
  • 北京网站开发多少钱淘宝seo排名优化软件
  • 最经济 网站建设怎么接app推广的单子
  • 渭南做网站公司杭州关键词优化外包
  • 怎么做网站广告古董seo排名是什么意思
  • 心理学门户网站开发与实现域名注册服务机构
  • 泰安肥城做网站的公司原画培训机构哪里好
  • 北京做网络工程公司的网站百家号排名
  • ppt模板下载网北京百度seo公司
  • wordpress json rest apiseo常用的工具
  • 寿光网站建设哪家好seo网站有优化培训班吗
  • 网站后台扫描插件百度网盘pc端网页版
  • 网页设计班级网站怎么做免费引流推广工具
  • 做彩投网站犯法吗东莞网站建设优化诊断
  • 网站建设行业广告语友情链接互换网站
  • h5制作平台人人秀苏州关键词优化seo
  • 网站流量怎么赚钱三台网站seo
  • 怎么做建设网站日本域名注册网站
  • 苏州建设交易中心网站南京seo整站优化技术
  • 最专业的网站建设团队如何设计网站步骤
  • 团建智慧登陆官网广州网站优化推广方案
  • wordpress主题瀑布流下载seo优化中以下说法正确的是
  • 做外贸什么网站好百度云盘登录
  • 怎样做网站xml广州竞价托管公司