Add SDL_SetGPUBlendConstants, SDL_SetGPUStencilReference (#10704)

This commit is contained in:
Caleb Cornett 2024-09-05 17:41:23 -05:00 committed by GitHub
parent 04a732881a
commit 2d4eb29c37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 383 additions and 189 deletions

View file

@ -194,11 +194,6 @@ SDL_GPUGraphicsPipeline *SDL_GPU_FetchBlitPipeline(
blitPipelineCreateInfo.primitiveType = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
blitPipelineCreateInfo.blendConstants[0] = 1.0f;
blitPipelineCreateInfo.blendConstants[1] = 1.0f;
blitPipelineCreateInfo.blendConstants[2] = 1.0f;
blitPipelineCreateInfo.blendConstants[3] = 1.0f;
pipeline = SDL_CreateGPUGraphicsPipeline(
device,
&blitPipelineCreateInfo);
@ -1281,6 +1276,42 @@ void SDL_SetGPUScissor(
scissor);
}
void SDL_SetGPUBlendConstants(
SDL_GPURenderPass *renderPass,
SDL_FColor blendConstants)
{
if (renderPass == NULL) {
SDL_InvalidParamError("renderPass");
return;
}
if (RENDERPASS_DEVICE->debugMode) {
CHECK_RENDERPASS
}
RENDERPASS_DEVICE->SetBlendConstants(
RENDERPASS_COMMAND_BUFFER,
blendConstants);
}
void SDL_SetGPUStencilReference(
SDL_GPURenderPass *renderPass,
Uint8 reference)
{
if (renderPass == NULL) {
SDL_InvalidParamError("renderPass");
return;
}
if (RENDERPASS_DEVICE->debugMode) {
CHECK_RENDERPASS
}
RENDERPASS_DEVICE->SetStencilReference(
RENDERPASS_COMMAND_BUFFER,
reference);
}
void SDL_BindGPUVertexBuffers(
SDL_GPURenderPass *renderPass,
Uint32 firstBinding,