mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Rename setBlendColor->setBlendConstant
Matches most recent spec changes. setBlendColor has been marked as deprecated. Bug: chromium:1199057 Change-Id: I4584ce789bd7d14401244509d5ada62a46236a5d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47901 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
22b923cc91
commit
413dcf8a40
@@ -168,9 +168,9 @@ namespace dawn_native {
|
||||
cmd->~SetScissorRectCmd();
|
||||
break;
|
||||
}
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = commands->NextCommand<SetBlendColorCmd>();
|
||||
cmd->~SetBlendColorCmd();
|
||||
case Command::SetBlendConstant: {
|
||||
SetBlendConstantCmd* cmd = commands->NextCommand<SetBlendConstantCmd>();
|
||||
cmd->~SetBlendConstantCmd();
|
||||
break;
|
||||
}
|
||||
case Command::SetBindGroup: {
|
||||
@@ -315,8 +315,8 @@ namespace dawn_native {
|
||||
commands->NextCommand<SetScissorRectCmd>();
|
||||
break;
|
||||
|
||||
case Command::SetBlendColor:
|
||||
commands->NextCommand<SetBlendColorCmd>();
|
||||
case Command::SetBlendConstant:
|
||||
commands->NextCommand<SetBlendConstantCmd>();
|
||||
break;
|
||||
|
||||
case Command::SetBindGroup: {
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace dawn_native {
|
||||
SetStencilReference,
|
||||
SetViewport,
|
||||
SetScissorRect,
|
||||
SetBlendColor,
|
||||
SetBlendConstant,
|
||||
SetBindGroup,
|
||||
SetIndexBuffer,
|
||||
SetVertexBuffer,
|
||||
@@ -231,7 +231,7 @@ namespace dawn_native {
|
||||
uint32_t x, y, width, height;
|
||||
};
|
||||
|
||||
struct SetBlendColorCmd {
|
||||
struct SetBlendConstantCmd {
|
||||
Color color;
|
||||
};
|
||||
|
||||
|
||||
@@ -115,15 +115,22 @@ namespace dawn_native {
|
||||
});
|
||||
}
|
||||
|
||||
void RenderPassEncoder::APISetBlendColor(const Color* color) {
|
||||
void RenderPassEncoder::APISetBlendConstant(const Color* color) {
|
||||
mEncodingContext->TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
|
||||
SetBlendColorCmd* cmd = allocator->Allocate<SetBlendColorCmd>(Command::SetBlendColor);
|
||||
SetBlendConstantCmd* cmd =
|
||||
allocator->Allocate<SetBlendConstantCmd>(Command::SetBlendConstant);
|
||||
cmd->color = *color;
|
||||
|
||||
return {};
|
||||
});
|
||||
}
|
||||
|
||||
void RenderPassEncoder::APISetBlendColor(const Color* color) {
|
||||
GetDevice()->EmitDeprecationWarning(
|
||||
"SetBlendColor has been deprecated in favor of SetBlendConstant.");
|
||||
APISetBlendConstant(color);
|
||||
}
|
||||
|
||||
void RenderPassEncoder::APISetViewport(float x,
|
||||
float y,
|
||||
float width,
|
||||
|
||||
@@ -40,7 +40,8 @@ namespace dawn_native {
|
||||
void APIEndPass();
|
||||
|
||||
void APISetStencilReference(uint32_t reference);
|
||||
void APISetBlendColor(const Color* color);
|
||||
void APISetBlendConstant(const Color* color);
|
||||
void APISetBlendColor(const Color* color); // Deprecated
|
||||
void APISetViewport(float x,
|
||||
float y,
|
||||
float width,
|
||||
|
||||
@@ -1450,8 +1450,8 @@ namespace dawn_native { namespace d3d12 {
|
||||
break;
|
||||
}
|
||||
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = mCommands.NextCommand<SetBlendColorCmd>();
|
||||
case Command::SetBlendConstant: {
|
||||
SetBlendConstantCmd* cmd = mCommands.NextCommand<SetBlendConstantCmd>();
|
||||
const std::array<float, 4> color = ConvertToFloatColor(cmd->color);
|
||||
commandList->OMSetBlendFactor(color.data());
|
||||
break;
|
||||
|
||||
@@ -1281,8 +1281,8 @@ namespace dawn_native { namespace metal {
|
||||
break;
|
||||
}
|
||||
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = mCommands.NextCommand<SetBlendColorCmd>();
|
||||
case Command::SetBlendConstant: {
|
||||
SetBlendConstantCmd* cmd = mCommands.NextCommand<SetBlendConstantCmd>();
|
||||
[encoder setBlendColorRed:cmd->color.r
|
||||
green:cmd->color.g
|
||||
blue:cmd->color.b
|
||||
|
||||
@@ -1218,8 +1218,8 @@ namespace dawn_native { namespace opengl {
|
||||
break;
|
||||
}
|
||||
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = mCommands.NextCommand<SetBlendColorCmd>();
|
||||
case Command::SetBlendConstant: {
|
||||
SetBlendConstantCmd* cmd = mCommands.NextCommand<SetBlendConstantCmd>();
|
||||
const std::array<float, 4> blendColor = ConvertToFloatColor(cmd->color);
|
||||
gl.BlendColor(blendColor[0], blendColor[1], blendColor[2], blendColor[3]);
|
||||
break;
|
||||
|
||||
@@ -1209,8 +1209,8 @@ namespace dawn_native { namespace vulkan {
|
||||
return {};
|
||||
}
|
||||
|
||||
case Command::SetBlendColor: {
|
||||
SetBlendColorCmd* cmd = mCommands.NextCommand<SetBlendColorCmd>();
|
||||
case Command::SetBlendConstant: {
|
||||
SetBlendConstantCmd* cmd = mCommands.NextCommand<SetBlendConstantCmd>();
|
||||
const std::array<float, 4> blendConstants = ConvertToFloatColor(cmd->color);
|
||||
device->fn.CmdSetBlendConstants(commands, blendConstants.data());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user