Removes deprecation period code for renamed APIs (i.e. endPass/dispatch)
- Note that by default these are already errors, not warnings. Change-Id: If35284041963cd387839fe102efe4dca73e594dc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128064 Reviewed-by: Shrek Shao <shrekshao@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
parent
ca1b904456
commit
89c89b7640
25
dawn.json
25
dawn.json
|
@ -843,15 +843,6 @@
|
||||||
{"name": "query index", "type": "uint32_t"}
|
{"name": "query index", "type": "uint32_t"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "dispatch",
|
|
||||||
"tags": ["deprecated"],
|
|
||||||
"args": [
|
|
||||||
{"name": "workgroupCountX", "type": "uint32_t"},
|
|
||||||
{"name": "workgroupCountY", "type": "uint32_t", "default": "1"},
|
|
||||||
{"name": "workgroupCountZ", "type": "uint32_t", "default": "1"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "dispatch workgroups",
|
"name": "dispatch workgroups",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -860,14 +851,6 @@
|
||||||
{"name": "workgroupCountZ", "type": "uint32_t", "default": "1"}
|
{"name": "workgroupCountZ", "type": "uint32_t", "default": "1"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "dispatch indirect",
|
|
||||||
"tags": ["deprecated"],
|
|
||||||
"args": [
|
|
||||||
{"name": "indirect buffer", "type": "buffer"},
|
|
||||||
{"name": "indirect offset", "type": "uint64_t"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "dispatch workgroups indirect",
|
"name": "dispatch workgroups indirect",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -878,10 +861,6 @@
|
||||||
{
|
{
|
||||||
"name": "end"
|
"name": "end"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "end pass",
|
|
||||||
"tags": ["deprecated"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "end pipeline statistics query",
|
"name": "end pipeline statistics query",
|
||||||
"tags": ["upstream", "emscripten"]
|
"tags": ["upstream", "emscripten"]
|
||||||
|
@ -2186,10 +2165,6 @@
|
||||||
{
|
{
|
||||||
"name": "end"
|
"name": "end"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "end pass",
|
|
||||||
"tags": ["deprecated"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "end pipeline statistics query",
|
"name": "end pipeline statistics query",
|
||||||
"tags": ["upstream", "emscripten"]
|
"tags": ["upstream", "emscripten"]
|
||||||
|
|
|
@ -176,24 +176,6 @@ void ComputePassEncoder::APIEnd() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComputePassEncoder::APIEndPass() {
|
|
||||||
if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR(
|
|
||||||
GetDevice(), "endPass() has been deprecated. Use end() instead."))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
APIEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComputePassEncoder::APIDispatch(uint32_t workgroupCountX,
|
|
||||||
uint32_t workgroupCountY,
|
|
||||||
uint32_t workgroupCountZ) {
|
|
||||||
if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR(
|
|
||||||
GetDevice(), "dispatch() has been deprecated. Use dispatchWorkgroups() instead."))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
APIDispatchWorkgroups(workgroupCountX, workgroupCountY, workgroupCountZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComputePassEncoder::APIDispatchWorkgroups(uint32_t workgroupCountX,
|
void ComputePassEncoder::APIDispatchWorkgroups(uint32_t workgroupCountX,
|
||||||
uint32_t workgroupCountY,
|
uint32_t workgroupCountY,
|
||||||
uint32_t workgroupCountZ) {
|
uint32_t workgroupCountZ) {
|
||||||
|
@ -331,15 +313,6 @@ ComputePassEncoder::TransformIndirectDispatchBuffer(Ref<BufferBase> indirectBuff
|
||||||
return std::make_pair(std::move(validatedIndirectBuffer), uint64_t(0));
|
return std::make_pair(std::move(validatedIndirectBuffer), uint64_t(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComputePassEncoder::APIDispatchIndirect(BufferBase* indirectBuffer, uint64_t indirectOffset) {
|
|
||||||
if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR(
|
|
||||||
GetDevice(),
|
|
||||||
"dispatchIndirect() has been deprecated. Use dispatchWorkgroupsIndirect() instead."))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
APIDispatchWorkgroupsIndirect(indirectBuffer, indirectOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ComputePassEncoder::APIDispatchWorkgroupsIndirect(BufferBase* indirectBuffer,
|
void ComputePassEncoder::APIDispatchWorkgroupsIndirect(BufferBase* indirectBuffer,
|
||||||
uint64_t indirectOffset) {
|
uint64_t indirectOffset) {
|
||||||
mEncodingContext->TryEncode(
|
mEncodingContext->TryEncode(
|
||||||
|
|
|
@ -42,7 +42,6 @@ class ComputePassEncoder final : public ProgrammableEncoder {
|
||||||
ObjectType GetType() const override;
|
ObjectType GetType() const override;
|
||||||
|
|
||||||
void APIEnd();
|
void APIEnd();
|
||||||
void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period.
|
|
||||||
|
|
||||||
void APIDispatchWorkgroups(uint32_t workgroupCountX,
|
void APIDispatchWorkgroups(uint32_t workgroupCountX,
|
||||||
uint32_t workgroupCountY = 1,
|
uint32_t workgroupCountY = 1,
|
||||||
|
@ -62,12 +61,6 @@ class ComputePassEncoder final : public ProgrammableEncoder {
|
||||||
RestoreCommandBufferState(std::move(state));
|
RestoreCommandBufferState(std::move(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated
|
|
||||||
void APIDispatch(uint32_t workgroupCountX,
|
|
||||||
uint32_t workgroupCountY = 1,
|
|
||||||
uint32_t workgroupCountZ = 1);
|
|
||||||
void APIDispatchIndirect(BufferBase* indirectBuffer, uint64_t indirectOffset);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ComputePassEncoder(DeviceBase* device,
|
ComputePassEncoder(DeviceBase* device,
|
||||||
const ComputePassDescriptor* descriptor,
|
const ComputePassDescriptor* descriptor,
|
||||||
|
|
|
@ -184,14 +184,6 @@ void RenderPassEncoder::End() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassEncoder::APIEndPass() {
|
|
||||||
if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR(
|
|
||||||
GetDevice(), "endPass() has been deprecated. Use end() instead."))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
APIEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RenderPassEncoder::APISetStencilReference(uint32_t reference) {
|
void RenderPassEncoder::APISetStencilReference(uint32_t reference) {
|
||||||
mEncodingContext->TryEncode(
|
mEncodingContext->TryEncode(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -48,7 +48,6 @@ class RenderPassEncoder final : public RenderEncoderBase {
|
||||||
// NOTE: this will lock the device internally. To avoid deadlock when the device is already
|
// NOTE: this will lock the device internally. To avoid deadlock when the device is already
|
||||||
// locked, use End() instead.
|
// locked, use End() instead.
|
||||||
void APIEnd();
|
void APIEnd();
|
||||||
void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period.
|
|
||||||
|
|
||||||
void APISetStencilReference(uint32_t reference);
|
void APISetStencilReference(uint32_t reference);
|
||||||
void APISetBlendConstant(const Color* color);
|
void APISetBlendConstant(const Color* color);
|
||||||
|
|
|
@ -24,57 +24,3 @@ WGPUDevice DeprecationTests::CreateTestDevice(dawn::native::Adapter dawnAdapter)
|
||||||
wgpu::DeviceDescriptor descriptor = {};
|
wgpu::DeviceDescriptor descriptor = {};
|
||||||
return dawnAdapter.CreateDevice(&descriptor);
|
return dawnAdapter.CreateDevice(&descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that endPass() is deprecated for both render and compute passes.
|
|
||||||
TEST_P(DeprecationTests, EndPass) {
|
|
||||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
|
||||||
|
|
||||||
{
|
|
||||||
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);
|
|
||||||
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
|
||||||
|
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.EndPass());
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
|
|
||||||
|
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.EndPass());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test that dispatch() and dispatchIndirect() is deprecated.
|
|
||||||
TEST_P(DeprecationTests, Dispatch) {
|
|
||||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
|
||||||
@compute @workgroup_size(1, 1, 1)
|
|
||||||
fn main() {
|
|
||||||
})");
|
|
||||||
|
|
||||||
wgpu::ComputePipelineDescriptor csDesc;
|
|
||||||
csDesc.compute.module = module;
|
|
||||||
csDesc.compute.entryPoint = "main";
|
|
||||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&csDesc);
|
|
||||||
|
|
||||||
std::array<uint32_t, 3> indirectBufferData = {1, 0, 0};
|
|
||||||
|
|
||||||
wgpu::Buffer indirectBuffer = utils::CreateBufferFromData(
|
|
||||||
device, &indirectBufferData[0], indirectBufferData.size() * sizeof(uint32_t),
|
|
||||||
wgpu::BufferUsage::Indirect);
|
|
||||||
|
|
||||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
|
||||||
wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
|
|
||||||
pass.SetPipeline(pipeline);
|
|
||||||
|
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.Dispatch(1));
|
|
||||||
|
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.DispatchIndirect(indirectBuffer, 0));
|
|
||||||
|
|
||||||
pass.End();
|
|
||||||
}
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(DeprecatedAPITest,
|
|
||||||
DeprecationTests,
|
|
||||||
testing::Values(true, false),
|
|
||||||
[](const testing::TestParamInfo<DeprecationTests::ParamType>& info) {
|
|
||||||
return info.param ? "Disallowed" : "Allowed";
|
|
||||||
});
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class WireArgumentTests : public WireTest {
|
||||||
TEST_F(WireArgumentTests, ValueArgument) {
|
TEST_F(WireArgumentTests, ValueArgument) {
|
||||||
WGPUCommandEncoder encoder = wgpuDeviceCreateCommandEncoder(device, nullptr);
|
WGPUCommandEncoder encoder = wgpuDeviceCreateCommandEncoder(device, nullptr);
|
||||||
WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(encoder, nullptr);
|
WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(encoder, nullptr);
|
||||||
wgpuComputePassEncoderDispatch(pass, 1, 2, 3);
|
wgpuComputePassEncoderDispatchWorkgroups(pass, 1, 2, 3);
|
||||||
|
|
||||||
WGPUCommandEncoder apiEncoder = api.GetNewCommandEncoder();
|
WGPUCommandEncoder apiEncoder = api.GetNewCommandEncoder();
|
||||||
EXPECT_CALL(api, DeviceCreateCommandEncoder(apiDevice, nullptr)).WillOnce(Return(apiEncoder));
|
EXPECT_CALL(api, DeviceCreateCommandEncoder(apiDevice, nullptr)).WillOnce(Return(apiEncoder));
|
||||||
|
@ -42,7 +42,7 @@ TEST_F(WireArgumentTests, ValueArgument) {
|
||||||
WGPUComputePassEncoder apiPass = api.GetNewComputePassEncoder();
|
WGPUComputePassEncoder apiPass = api.GetNewComputePassEncoder();
|
||||||
EXPECT_CALL(api, CommandEncoderBeginComputePass(apiEncoder, nullptr)).WillOnce(Return(apiPass));
|
EXPECT_CALL(api, CommandEncoderBeginComputePass(apiEncoder, nullptr)).WillOnce(Return(apiPass));
|
||||||
|
|
||||||
EXPECT_CALL(api, ComputePassEncoderDispatch(apiPass, 1, 2, 3)).Times(1);
|
EXPECT_CALL(api, ComputePassEncoderDispatchWorkgroups(apiPass, 1, 2, 3)).Times(1);
|
||||||
|
|
||||||
FlushClient();
|
FlushClient();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue