Each of my shaders are passed through a custom compiler, then through LunarGLASS, then finally through glslang, this being the complete output:
#version 450
// LunarGOO output
struct BrushData {
int member0;
vec3 member1;
vec4 member2;
vec4 member3;
vec4 member4;
vec2 member5;
vec2 member6;
};
struct PacketData {
mat4 member0;
BrushData member1;
};
layout(std140, set=0, binding=0) uniform SharedData {
mat4 member0;
} _uniformSharedData;
layout(std140, set=1, binding=0) uniform PacketBatch {
PacketData member0[455];
} _uniformPacketBatch;
layout(push_constant) uniform PushConstant {
int member0;
int member1;
int member2;
int member3;
} _uniformPushConstant;
layout(set=2, binding=0) uniform sampler2D BrushImage[56];
layout(location=0) in vec2 gIn_VSIn_In_Position_0;
layout(location=1) in vec2 gIn_VSIn_In_UV_1;
layout(location=1) out vec2 gOut_VSOut_R_UV_1;
const float C_10000d0 = 10000.0;
const float C_1d0 = 1.0;
void main()
{
float sitofp = float(_uniformPushConstant.member3);
float fdivtmp = sitofp / C_10000d0;
float fsubtmp = C_1d0 - fdivtmp;
vec4 H_z8w9nb = vec4(gIn_VSIn_In_Position_0.x, gIn_VSIn_In_Position_0.y, fsubtmp, C_1d0);
highp float dotres = dot(H_z8w9nb, _uniformPacketBatch.member0[_uniformPushConstant.member0].member0[0]);
highp float dotres1 = dot(H_z8w9nb, _uniformPacketBatch.member0[_uniformPushConstant.member0].member0[1]);
highp float dotres2 = dot(H_z8w9nb, _uniformPacketBatch.member0[_uniformPushConstant.member0].member0[2]);
highp float dotres3 = dot(H_z8w9nb, _uniformPacketBatch.member0[_uniformPushConstant.member0].member0[3]);
vec4 H_siz04c = vec4(dotres, dotres1, dotres2, dotres3);
highp float dotres4 = dot(H_siz04c, _uniformSharedData.member0[0]);
highp float dotres5 = dot(H_siz04c, _uniformSharedData.member0[1]);
highp float dotres6 = dot(H_siz04c, _uniformSharedData.member0[2]);
highp float dotres7 = dot(H_siz04c, _uniformSharedData.member0[3]);
vec4 H_gg6lc3 = vec4(dotres4, dotres5, dotres6, dotres7);
gl_Position = H_gg6lc3;
gOut_VSOut_R_UV_1 = gIn_VSIn_In_UV_1;
}
However (With validation) when attempting to create the pipeline, the following is spit out (A bit of custom logging, but the main message is still there):
ERROR: [Driver] Code 2 : Vertex info
-----------
Internal error: assembly compile error for vertex shader at offset 0:
-- error message --
line 1, column 1: error: invalid vertex program header
-- internal assembly text --
WARNING: [ParameterValidation] Code 9 : vkCreateGraphicsPipelines: returned VK_ERROR_INVALID_SHADER_NV, indicating that one or more shaders failed to compile or link
[-1000012000, ErrorInvalidShaderNV] - Failed to create graphics pipeline!
So for some reason the program header is invalid, looking at a past post his issue was that he was exceeding the common 64k buffer limit, however I do not find that to be the case here, since: (My array sizes are passed as preprocessors before shader compilation)
sizeof BrushData = 4 + 12 + 16 * 3 + 8 * 2 = 80
sizeof PacketData = 64 + sizeof BrushData = 144
sizeof PacketBatch = sizeof BrushData * 455 = 65520
And assuming the max limit is 65536, this should fit well within the limits, right? Unless the compiler is changing the memory layout I can’t think of what’s wrong…