82 "invalid World3D color target format", {}});
88 "device exposes no supported World3D depth target", {}});
109 const std::array<SDL_GPUVertexAttribute, 4> attributes{{
123 colorTarget.blend_state.enable_color_write_mask =
false;
128 info.vertex_input_state.vertex_buffer_descriptions = &vertexBuffer;
129 info.vertex_input_state.num_vertex_buffers = 1U;
130 info.vertex_input_state.vertex_attributes = attributes.data();
131 info.vertex_input_state.num_vertex_attributes =
141 info.rasterizer_state.enable_depth_clip =
true;
142 info.multisample_state.sample_count =
samples;
145 info.depth_stencil_state.enable_depth_test =
true;
146 info.depth_stencil_state.enable_depth_write =
true;
147 info.depth_stencil_state.enable_stencil_test =
false;
149 info.target_info.color_target_descriptions = &
colorTarget;
150 info.target_info.num_color_targets = 1U;
151 info.target_info.depth_stencil_format = *
depthFormat;
152 info.target_info.has_depth_stencil_target =
true;
174 result.device_ = device;
175 result.pipeline_ = pipeline;
176 result.doubleSidedPipeline_ = doubleSided;
178 result.shaders_ = std::move(*
shaders);
205 result.device_ = device;
206 result.pipeline_ = pipeline;
209 result.shaders_ = std::move(*
shaders);
static std::expected< World3DPipeline, World3DPipelineError > load(SDL_GPUDevice *device, const std::filesystem::path &shaderDirectory, SDL_GPUTextureFormat colorFormat, bool modernPBR=false, SDL_GPUSampleCount samples=SDL_GPU_SAMPLECOUNT_1)