S
Silk.NET•3y ago
Redhacker2

shaderc-moment

It's just useful to have, makes some error messages much more informative, and means you can kind of tell when someone is actively fucking up and scream at them for it.
18 Replies
TechPizza
TechPizza•3y ago
well, i can show you what shaderc generates;
static float4 gl_Position;
static float2 fsin_0;
static float2 TexCoords;
static float2 Position;

struct SPIRV_Cross_Input
{
float2 Position : TEXCOORD0;
float2 TexCoords : TEXCOORD1;
};

struct SPIRV_Cross_Output
{
float2 fsin_0 : TEXCOORD0;
float4 gl_Position : SV_Position;
};

void vert_main()
{
fsin_0 = TexCoords;
gl_Position = float4(Position.x, Position.y, 0.0f, 1.0f);
}

SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
TexCoords = stage_input.TexCoords;
Position = stage_input.Position;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.fsin_0 = fsin_0;
return stage_output;
}
static float4 gl_Position;
static float2 fsin_0;
static float2 TexCoords;
static float2 Position;

struct SPIRV_Cross_Input
{
float2 Position : TEXCOORD0;
float2 TexCoords : TEXCOORD1;
};

struct SPIRV_Cross_Output
{
float2 fsin_0 : TEXCOORD0;
float4 gl_Position : SV_Position;
};

void vert_main()
{
fsin_0 = TexCoords;
gl_Position = float4(Position.x, Position.y, 0.0f, 1.0f);
}

SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
TexCoords = stage_input.TexCoords;
Position = stage_input.Position;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.fsin_0 = fsin_0;
return stage_output;
}
looks like named variables to me
Redhacker2
Redhacker2OP•3y ago
For me it generated matrix_1, matrix_2 vec_1... or something like that, like it came out of spirv-cross with names
TechPizza
TechPizza•3y ago
well, did you tell it to preserve names? 🙃
Redhacker2
Redhacker2OP•3y ago
I mean, the documentation was not very good, mostly leaving it on the front page of their repo IIRC, Spirv-cross preserved names IIRC
TechPizza
TechPizza•3y ago
well duh, otherwise that posted code wouldn't look as pretty
Redhacker2
Redhacker2OP•3y ago
In any case, I removed it because I couldn't get it working regardless. Really? I just ended up with intermittent access violation exceptions, it sucked.
TechPizza
TechPizza•3y ago
you could very well be getting such exceptions when e.g. opengl tried to access a uniform that you named incorrectly
Redhacker2
Redhacker2OP•3y ago
Ehh no
TechPizza
TechPizza•3y ago
anyways, veldrid basically doesn't do any reflection checking to validate opengl names with a resource layout
Redhacker2
Redhacker2OP•3y ago
This was pretty clearly from that bit of code
TechPizza
TechPizza•3y ago
alrighty then
Redhacker2
Redhacker2OP•3y ago
I'm not great with pointers. One of the reasons I probably shouldn't go near silktouch Lol
TechPizza
TechPizza•3y ago
what pointers? 🙃
Redhacker2
Redhacker2OP•3y ago
The ones in the shaderc bindings I used
TechPizza
TechPizza•3y ago
bru
Redhacker2
Redhacker2OP•3y ago
Lol All I could find was this one library Pretty much the same for spirv-cross This was before you committed to your fork on veldrid And I think I talked to you about this before
TechPizza
TechPizza•3y ago
ya i'm still in the process of remaking veldrid.spirv though
Redhacker2
Redhacker2OP•3y ago
Ok
Want results from more Discord servers?
Add your server