Skip to content

Commit 14d0412

Browse files
committed
glsl: fix stale edge shader still using instance id
1 parent 7ff6465 commit 14d0412

File tree

3 files changed

+84
-86
lines changed

3 files changed

+84
-86
lines changed

glsl/edgeidx.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ flat out uint idx;
1313

1414
void main(){
1515
gl_Position = mvp * vec4(pos, 1.0);
16-
idx = gl_InstanceIndex + 1 | 1<<31;
16+
idx = (gl_VertexIndex >> 1) + 1 | 1<<31;
1717
}
1818
@end
1919

glsl/edgeidx.h

+83-84
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ SOKOL_SHDC_ALIGN(16) typedef struct ei_Fparam_t {
5858
void main()
5959
{
6060
gl_Position = mat4(Vparam[0], Vparam[1], Vparam[2], Vparam[3]) * vec4(pos, 1.0);
61-
idx = uint((gl_InstanceID + 1) | int(0x80000000));
61+
idx = uint(((gl_VertexID >> 1) + 1) | int(0x80000000));
6262
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
6363
}
6464
6565
*/
66-
static const uint8_t ei_vs_source_glsl430[328] = {
66+
static const uint8_t ei_vs_source_glsl430[333] = {
6767
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x75,0x6e,
6868
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x56,0x70,0x61,0x72,0x61,
6969
0x6d,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
@@ -78,13 +78,13 @@ static const uint8_t ei_vs_source_glsl430[328] = {
7878
0x61,0x6d,0x5b,0x32,0x5d,0x2c,0x20,0x56,0x70,0x61,0x72,0x61,0x6d,0x5b,0x33,0x5d,
7979
0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,
8080
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x64,0x78,0x20,0x3d,0x20,0x75,0x69,
81-
0x6e,0x74,0x28,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
82-
0x44,0x20,0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,0x30,0x78,0x38,
83-
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,
84-
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x20,0x3d,0x20,0x32,
85-
0x2e,0x30,0x20,0x2a,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
86-
0x2e,0x7a,0x20,0x2d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
87-
0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
81+
0x6e,0x74,0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,
82+
0x20,0x3e,0x3e,0x20,0x31,0x29,0x20,0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,
83+
0x74,0x28,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,
84+
0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,
85+
0x7a,0x20,0x3d,0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
86+
0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x20,0x2d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
87+
0x69,0x74,0x69,0x6f,0x6e,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
8888
};
8989
/*
9090
#version 430
@@ -126,12 +126,12 @@ static const uint8_t ei_fs_source_glsl430[198] = {
126126
void main()
127127
{
128128
gl_Position = mat4(Vparam[0], Vparam[1], Vparam[2], Vparam[3]) * vec4(pos, 1.0);
129-
idx = uint((gl_InstanceID + 1) | int(0x80000000));
129+
idx = uint(((gl_VertexID >> 1) + 1) | int(0x80000000));
130130
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
131131
}
132132
133133
*/
134-
static const uint8_t ei_vs_source_glsl300es[326] = {
134+
static const uint8_t ei_vs_source_glsl300es[331] = {
135135
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
136136
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,0x70,
137137
0x20,0x76,0x65,0x63,0x34,0x20,0x56,0x70,0x61,0x72,0x61,0x6d,0x5b,0x34,0x5d,0x3b,
@@ -146,13 +146,13 @@ static const uint8_t ei_vs_source_glsl300es[326] = {
146146
0x5b,0x32,0x5d,0x2c,0x20,0x56,0x70,0x61,0x72,0x61,0x6d,0x5b,0x33,0x5d,0x29,0x20,
147147
0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,
148148
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x64,0x78,0x20,0x3d,0x20,0x75,0x69,0x6e,0x74,
149-
0x28,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x20,
150-
0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,0x30,0x78,0x38,0x30,0x30,
151-
0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,
152-
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x20,0x3d,0x20,0x32,0x2e,0x30,
153-
0x20,0x2a,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,
154-
0x20,0x2d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x77,
155-
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
149+
0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3e,
150+
0x3e,0x20,0x31,0x29,0x20,0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,
151+
0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,
152+
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x20,
153+
0x3d,0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
154+
0x69,0x6f,0x6e,0x2e,0x7a,0x20,0x2d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
155+
0x69,0x6f,0x6e,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
156156
};
157157
/*
158158
#version 300 es
@@ -196,14 +196,14 @@ static const uint8_t ei_fs_source_glsl300es[226] = {
196196
197197
198198
static float4 gl_Position;
199-
static int gl_InstanceIndex;
199+
static int gl_VertexIndex;
200200
static float3 pos;
201201
static uint idx;
202202
203203
struct SPIRV_Cross_Input
204204
{
205205
float3 pos : TEXCOORD0;
206-
uint gl_InstanceIndex : SV_InstanceID;
206+
uint gl_VertexIndex : SV_VertexID;
207207
};
208208
209209
struct SPIRV_Cross_Output
@@ -215,12 +215,12 @@ static const uint8_t ei_fs_source_glsl300es[226] = {
215215
void vert_main()
216216
{
217217
gl_Position = mul(float4(pos, 1.0f), _19_mvp);
218-
idx = uint((gl_InstanceIndex + 1) | int(0x80000000));
218+
idx = uint(((gl_VertexIndex >> 1) + 1) | int(0x80000000));
219219
}
220220
221221
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
222222
{
223-
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
223+
gl_VertexIndex = int(stage_input.gl_VertexIndex);
224224
pos = stage_input.pos;
225225
vert_main();
226226
SPIRV_Cross_Output stage_output;
@@ -229,59 +229,58 @@ static const uint8_t ei_fs_source_glsl300es[226] = {
229229
return stage_output;
230230
}
231231
*/
232-
static const uint8_t ei_vs_source_hlsl5[820] = {
232+
static const uint8_t ei_vs_source_hlsl5[815] = {
233233
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x56,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,
234234
0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,
235235
0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,
236236
0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x20,0x3a,
237237
0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,
238238
0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
239239
0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,
240-
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,
241-
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x73,0x74,
242-
0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x3b,
243-
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x69,0x64,0x78,
240+
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,
241+
0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,
242+
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x73,
243+
0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x69,0x64,0x78,0x3b,0x0a,
244+
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
245+
0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
246+
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,
247+
0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,
248+
0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,
249+
0x3a,0x20,0x53,0x56,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b,0x0a,0x7d,
244250
0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
245-
0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,
246-
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,
247-
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,
248-
0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,
249-
0x64,0x65,0x78,0x20,0x3a,0x20,0x53,0x56,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,
250-
0x65,0x49,0x44,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
251-
0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,
252-
0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,
253-
0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x75,0x69,0x6e,0x74,0x20,0x69,0x64,
254-
0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,
255-
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
256-
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,
257-
0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,
258-
0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
259-
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,
260-
0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,
261-
0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,
262-
0x20,0x20,0x20,0x69,0x64,0x78,0x20,0x3d,0x20,0x75,0x69,0x6e,0x74,0x28,0x28,0x67,
263-
0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,
264-
0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,0x30,0x78,0x38,0x30,0x30,
265-
0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,
266-
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,
267-
0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
268-
0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
269-
0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,
270-
0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,
271-
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x49,
272-
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a,0x20,
273-
0x20,0x20,0x20,0x70,0x6f,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,
274-
0x6e,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,
275-
0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,
276-
0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,
277-
0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,
278-
0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,
279-
0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,
280-
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
281-
0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x69,0x64,0x78,
282-
0x20,0x3d,0x20,0x69,0x64,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
283-
0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,
284-
0x0a,0x7d,0x0a,0x00,
251+
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,
252+
0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,0x61,0x74,0x69,
253+
0x6f,0x6e,0x20,0x75,0x69,0x6e,0x74,0x20,0x69,0x64,0x78,0x20,0x3a,0x20,0x54,0x45,
254+
0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
255+
0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
256+
0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,
257+
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,
258+
0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
259+
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,
260+
0x74,0x34,0x28,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,
261+
0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x64,0x78,
262+
0x20,0x3d,0x20,0x75,0x69,0x6e,0x74,0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,
263+
0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3e,0x3e,0x20,0x31,0x29,0x20,0x2b,
264+
0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,0x30,0x78,0x38,0x30,0x30,0x30,
265+
0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,
266+
0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,
267+
0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,
268+
0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,
269+
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,
270+
0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x73,0x74,0x61,
271+
0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,
272+
0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,
273+
0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,
274+
0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,
275+
0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
276+
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
277+
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
278+
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,
279+
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
280+
0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,
281+
0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x69,0x64,0x78,0x20,0x3d,0x20,0x69,0x64,
282+
0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,
283+
0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
285284
};
286285
/*
287286
cbuffer Fparam : register(b0)
@@ -381,16 +380,16 @@ static const uint8_t ei_fs_source_hlsl5[561] = {
381380
float3 pos [[attribute(0)]];
382381
};
383382
384-
vertex main0_out main0(main0_in in [[stage_in]], constant Vparam& _19 [[buffer(0)]], uint gl_InstanceIndex [[instance_id]])
383+
vertex main0_out main0(main0_in in [[stage_in]], constant Vparam& _19 [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
385384
{
386385
main0_out out = {};
387386
out.gl_Position = _19.mvp * float4(in.pos, 1.0);
388-
out.idx = uint((int(gl_InstanceIndex) + 1) | int(0x80000000));
387+
out.idx = uint(((int(gl_VertexIndex) >> 1) + 1) | int(0x80000000));
389388
return out;
390389
}
391390
392391
*/
393-
static const uint8_t ei_vs_source_metal_macos[545] = {
392+
static const uint8_t ei_vs_source_metal_macos[546] = {
394393
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
395394
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
396395
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
@@ -412,20 +411,20 @@ static const uint8_t ei_vs_source_metal_macos[545] = {
412411
0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
413412
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x56,0x70,0x61,0x72,0x61,0x6d,0x26,
414413
0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,
415-
0x5d,0x5d,0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,
416-
0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x69,0x6e,0x73,0x74,
417-
0x61,0x6e,0x63,0x65,0x5f,0x69,0x64,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
418-
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
419-
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,
420-
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,
421-
0x76,0x70,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x70,
422-
0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
423-
0x74,0x2e,0x69,0x64,0x78,0x20,0x3d,0x20,0x75,0x69,0x6e,0x74,0x28,0x28,0x69,0x6e,
424-
0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,
425-
0x65,0x78,0x29,0x20,0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,0x30,
426-
0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,
427-
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,
428-
0x00,
414+
0x5d,0x5d,0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,
415+
0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x76,0x65,0x72,0x74,0x65,0x78,
416+
0x5f,0x69,0x64,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,
417+
0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,
418+
0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
419+
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a,
420+
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x2c,0x20,
421+
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x69,0x64,
422+
0x78,0x20,0x3d,0x20,0x75,0x69,0x6e,0x74,0x28,0x28,0x28,0x69,0x6e,0x74,0x28,0x67,
423+
0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3e,
424+
0x3e,0x20,0x31,0x29,0x20,0x2b,0x20,0x31,0x29,0x20,0x7c,0x20,0x69,0x6e,0x74,0x28,
425+
0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,
426+
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
427+
0x0a,0x00,
429428
};
430429
/*
431430
#include <metal_stdlib>

ui/ui.c

-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ dragselect(int x, int y)
214214
int abs;
215215
ioff Δx, Δy, id, oid;
216216
Rekt rx, ry;
217-
khint_t k;
218217

219218
if(rsel.x1 < 0){
220219
rsel.x1 = rsel.x2 = x;

0 commit comments

Comments
 (0)