ARTICLE AD BOX
If I add the unsigned char* comp file plus glsl plus the definitions to spriv, the program would work. It turns out that spriv files are processed and compressed.
I'm looking for a Vulkan converter for unsigned char* comp files to unsigned char* spriv files. I'm not interested in the following:
for %%i in (\*.vert \*.frag) do "glslangValidator.exe" -V "%%\~i" -o "%%\~i.spv"I found a program on GitHub called SpvShaderCompiler, but its output is std::vector<unsigned char*>. Has anyone seen anything else?
Example vulkan whisper function .comp? maybe .vert?:
const std::string abs_data2 = "\ " + generic_head_glsl + "\n\ " + types_glsl + "\n\ \n\ #extension GL_EXT_control_flow_attributes : enable\n\ \n\ layout(local_size_x = 512, local_size_y = 1, local_size_z = 1) in;\n\ \n\ layout (binding = 0) readonly buffer X {A_TYPE data_a[];};\n\ layout (binding = 1) writeonly buffer D {D_TYPE data_d[];};\n\ \n\ void main() {\n\ const uint i = gl_GlobalInvocationID.z * 262144 + gl_GlobalInvocationID.y * 512 + gl_GlobalInvocationID.x;\n\ \n\ if (i >= p.KX) {\n\ return;\n\ }\n\ \n\ data_d[i] = D_TYPE(abs(float(data_a[i])));\n\ }"; const std::string abs_f16_data1 = "\ #version 450\n\ #define A_TYPE float16_t\n\ #define D_TYPE float16_t\n\ \n\ " + abs_data2; const unsigned char* abs_f16_data = reinterpret_cast<const unsigned char*>(abs_f16_data1.data()); const uint64_t abs_f16_len = abs_f16_data1.size();I am interested in the const unsigned char * X_SPRIV function:
const unsigned char* abs_f16_data = X_SPRIV(reinterpret_cast<const unsigned char*>(abs_f16_data1.data()));
Edit: In older ffmpeg is function:
#define GLSLD(D) \ do { \ av_bprintf(&shd->src, "\n"); \ av_bprint_append_data(&shd->src, D, strlen(D)); \ av_bprintf(&shd->src, "\n"); \ } while (0)