Cleanup 2/2

This commit is contained in:
Isuru Samarathunga
2025-11-05 16:23:50 +05:30
parent 7d6e8ef695
commit 80dc50d279
14 changed files with 275 additions and 74 deletions

View File

@ -19,7 +19,7 @@
namespace ia::iae
{
RDC_Pipeline::RDC_Pipeline(IN SDL_GPUTextureFormat renderTargetFormat, IN CONST StageDesc &vertexStageDesc,
IN CONST StageDesc &pixelStageDesc, IN BOOL enableVertexBuffer)
IN CONST StageDesc &pixelStageDesc, IN SDL_GPUPrimitiveType primitiveType, IN BOOL enableVertexBuffer)
{
SDL_GPUShader *vertexShader{};
SDL_GPUShader *pixelShader{};
@ -69,7 +69,7 @@ namespace ia::iae
SDL_GPUVertexAttribute vertexAttributes[] = {
{.location = 0, .buffer_slot = 0, .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, .offset = 0},
{.location = 1, .buffer_slot = 0, .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, .offset = sizeof(Vec2)}};
{.location = 1, .buffer_slot = 0, .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, .offset = sizeof(Vec2)}};
SDL_GPUGraphicsPipelineCreateInfo createInfo = {
.vertex_shader = vertexShader,
@ -77,8 +77,8 @@ namespace ia::iae
.vertex_input_state = SDL_GPUVertexInputState{.vertex_buffer_descriptions = &vertexBufferDesc,
.num_vertex_buffers = enableVertexBuffer ? (UINT32) 1 : 0,
.vertex_attributes = vertexAttributes,
.num_vertex_attributes = enableVertexBuffer ? (UINT32) 2 : 0},
.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST,
.num_vertex_attributes = enableVertexBuffer ? (UINT32)2 : 0},
.primitive_type = primitiveType,
.rasterizer_state = SDL_GPURasterizerState{.fill_mode = SDL_GPU_FILLMODE_FILL,
.cull_mode = SDL_GPU_CULLMODE_NONE,
.front_face = SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE,