change grid shader primitive to line from triangle

This commit is contained in:
Sven Balzer
2026-08-01 09:37:43 +02:00
parent 08b8b397e2
commit f564c14354
7 changed files with 69 additions and 146 deletions
+7 -16
View File
@@ -932,25 +932,12 @@ bool renderer_init(SDL_Window *window_) {
.entryPoint = { .data = "main_vertex", .length = WGPU_STRLEN },
.constantCount = 0,
.constants = NULL,
.bufferCount = 1,
.buffers = (WGPUVertexBufferLayout[]){
{
.stepMode = WGPUVertexStepMode_Vertex,
.arrayStride = 20,
.attributeCount = 1,
.attributes = (WGPUVertexAttribute[]){
{
.format = WGPUVertexFormat_Float32x3,
.offset = 0,
.shaderLocation = 0,
},
},
},
},
.bufferCount = 0,
.buffers = NULL,
},
.primitive = {
.topology = WGPUPrimitiveTopology_TriangleList,
.topology = WGPUPrimitiveTopology_LineList,
.stripIndexFormat = WGPUIndexFormat_Undefined,
.frontFace = WGPUFrontFace_CCW,
.cullMode = WGPUCullMode_Back,
@@ -978,6 +965,10 @@ bool renderer_init(SDL_Window *window_) {
wgpuShaderModuleRelease(shader);
}
for (int i = 0; i < R_SHADER_COUNT; i++) {
SDL_assert(shaders[i]);
}
return true;
}