You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
Reproduction Steps
go to v/examples/sokol/07_simple_shader_glsl
open simple_shader.v and go to line 132
change one of these lines, renaming the C value.
// something like this
pipeline_desc.layout.attrs[C.ATTR_vs_position].format= .float3// to something like this
pipeline_desc.layout.attrs[C.ATTR_vs_aposition].format= .float3
compile the code. you should get the following error. (v run .)
Expected Behavior
compiled code
Current Behavior
==================
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_501/simple_shader.01HX381VZ0CFX7SD21X4M8RFT9.tmp.c:21250:43: error: use of undeclared identifier 'ATTR_vs_aposition'
pipeline_desc.layout.attrs[v_fixed_index(ATTR_vs_aposition, 16)].format = sokol__gfx__VertexFormat__float3;
^
/tmp/v_501/simple_shader.01HX381VZ0CFX7SD21X4M8RFT9.tmp.c:21251:73: warning: implicit conversion from enumeration type 'sokol__gfx__VertexFormat' to different enumeration type 'sg_vertex_format' (aka 'enum sg_vertex_format') [-Wenum-conversion]
pipeline_desc.layout.attrs[v_fixed_index(ATTR_vs_color0, 16)].format = sokol__gfx__VertexFormat__float4;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 warnings and 1 error generated.
...
==================
(Use `v -cg` to print the entire error message)
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
Possible Solution
it appears to be caused by the variable being misnamed.
yeah, its a pretty simple fix, and didn't take long to notice. but the compiler said I should report it as a bug. granted this isn't pure v code. I just thought I should report it.
We should think of a way to handle those better (since V can know about the shader variables from its v shader tool, it should be able to offer more useful errors for that specific situation).
Describe the bug
I was told to report this by the compiler:
Reproduction Steps
go to
v/examples/sokol/07_simple_shader_glsl
open
simple_shader.v
and go to line132
change one of these lines, renaming the C value.
compile the code. you should get the following error. (
v run .
)Expected Behavior
compiled code
Current Behavior
Possible Solution
it appears to be caused by the variable being misnamed.
Additional Information/Context
No response
V version
V 0.4.5 206c0e3
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: