mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 15:39:10 +00:00
GPU: Null check shader inputs in CreateGPUGraphicsPipeline
This commit is contained in:
parent
32cc92dceb
commit
5a74aadac9
1 changed files with 8 additions and 0 deletions
|
@ -783,6 +783,14 @@ SDL_GPUGraphicsPipeline *SDL_CreateGPUGraphicsPipeline(
|
|||
}
|
||||
|
||||
if (device->debug_mode) {
|
||||
if (graphicsPipelineCreateInfo->vertex_shader == NULL) {
|
||||
SDL_assert_release(!"Vertex shader cannot be NULL!");
|
||||
return NULL;
|
||||
}
|
||||
if (graphicsPipelineCreateInfo->fragment_shader == NULL) {
|
||||
SDL_assert_release(!"Fragment shader cannot be NULL!");
|
||||
return NULL;
|
||||
}
|
||||
if (graphicsPipelineCreateInfo->target_info.num_color_targets > 0 && graphicsPipelineCreateInfo->target_info.color_target_descriptions == NULL) {
|
||||
SDL_assert_release(!"Color target descriptions array pointer cannot be NULL if num_color_targets is greater than zero!");
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue