Help with D3D12 GPU error.

I am currently working on some simple tilemap rendering (with instancing). And I thought about checking out some of the GPU features provided. Currently I don’t know why the following occurs, and hoped someone here might have a clue as to what is going and and what I need to change so this works.

First off:
The code works fine when I utilize Vulkan as the backend for rendering. Only when I force "direct3d12" a call to sdl.CreateGPUGraphicsPipeline (SDL_CreateGPUGraphicsPipeline) fails.

The error I get is the HRESULT code of ‘E_INVALIDARG’. Maybe I need to change some things or I am missing some parameters required for the internals - I would have expected a check for this from the side of SDL_gpu and am now on the hunt for a fix.

The code I use is the Odin vendor wrapper (just to make sure I’ve updated Odin and the SDL libraries used / shipped with it).

create_tilemap_pipeline :: proc(device: ^sdl.GPUDevice, window: ^sdl.Window) -> ^sdl.GPUGraphicsPipeline {

    vertex_shader := load_shader("TileMap.vert", device, uniform_buffer_count = 1, storage_buffer_count = 1)
    defer sdl.ReleaseGPUShader(device, vertex_shader)
    fragment_shader := load_shader("TileMap.frag", device, sampler_count = 1)
    defer sdl.ReleaseGPUShader(device, fragment_shader)

    color_target_description := [1]sdl.GPUColorTargetDescription { 
        {
            format = sdl.GetGPUSwapchainTextureFormat(device, window),
            blend_state = {
                src_color_blendfactor = .SRC_ALPHA,
                dst_color_blendfactor = .ONE_MINUS_SRC_ALPHA,
                color_blend_op = .ADD,
                src_alpha_blendfactor = .SRC_ALPHA,
                dst_alpha_blendfactor = .ONE_MINUS_SRC_ALPHA,
                alpha_blend_op = .ADD,
                enable_blend = true
            }
        }
    }

    pipeline_target_info := sdl.GPUGraphicsPipelineTargetInfo {
        	color_target_descriptions = raw_data(color_target_description[:]),
            num_color_targets = 1
    }

    pipeline_creation_info := sdl.GPUGraphicsPipelineCreateInfo {
        vertex_shader = vertex_shader,
        fragment_shader = fragment_shader,
        primitive_type = .TRIANGLELIST,
        target_info = pipeline_target_info
    }

    pipeline := sdl.CreateGPUGraphicsPipeline(device, pipeline_creation_info)
    return pipeline
}

Maybe someone can help me to identify what piece I am missing. Thank you for help in advance.

PS> Here is the proof it works with vulkan:

Image of the crash (due to pipeline issues):

What does it say when you call SDL_GetError()?

Exactly the same thing as is printed to the terminal.

I added the following code between sdl.CreateGPUGraphicsPipeline and the return-statement:

    when ODIN_DEBUG {
        error_string := sdl.GetError()
        log.errorf("Error Message: `%v`", error_string)
    }

Which in turn prints the same message to the terminal.

[ERROR] --- [2025-08-05 05:42:30] [tiles.odin:411:create_tilemap_pipeline()] Error Message: `Could not create graphics pipeline state! Error Code: Falscher Parameter. (0x80070057)`

Edit:
I believe the error is emitted at SDL_gpu_d3d12.c:3159 within D3D12_CreateGraphicsPipeline. The same-ish string is used in the context of D3D12_INTERNAL_SetError.