Fix non-inclusive language in toggle name
Use 'Mock' instead of non-inclusive language 'Dummy' in toggle MetalUseDummyBlitEncoderForWriteTimestamp to pass PRESUBMIT.py check. Bug: dawn:1250 Change-Id: I47dff4adec08d4d076b5ae5b4e0a521b235d5868 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110060 Reviewed-by: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
10fae7ac79
commit
fbd00b44ee
|
@ -306,9 +306,9 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
|
|||
"integer that is greater than 2^24 or smaller than -2^24). This toggle is also enabled on "
|
||||
"Intel GPUs on Metal backend due to a driver issue on Intel Metal driver.",
|
||||
"https://crbug.com/dawn/537"}},
|
||||
{Toggle::MetalUseDummyBlitEncoderForWriteTimestamp,
|
||||
{"metal_use_dummy_blit_encoder_for_write_timestamp",
|
||||
"Add dummy blit command to blit encoder when encoding writeTimestamp as workaround on Metal."
|
||||
{Toggle::MetalUseMockBlitEncoderForWriteTimestamp,
|
||||
{"metal_use_mock_blit_encoder_for_write_timestamp",
|
||||
"Add mock blit command to blit encoder when encoding writeTimestamp as workaround on Metal."
|
||||
"This toggle is enabled by default on Metal backend where GPU counters cannot be stored to"
|
||||
"sampleBufferAttachments on empty blit encoder.",
|
||||
"https://crbug.com/dawn/1473"}},
|
||||
|
|
|
@ -79,7 +79,7 @@ enum class Toggle {
|
|||
D3D12AllocateExtraMemoryFor2DArrayTexture,
|
||||
D3D12UseTempBufferInDepthStencilTextureAndBufferCopyWithNonZeroBufferOffset,
|
||||
ApplyClearBigIntegerColorValueWithDraw,
|
||||
MetalUseDummyBlitEncoderForWriteTimestamp,
|
||||
MetalUseMockBlitEncoderForWriteTimestamp,
|
||||
VulkanSplitCommandBufferOnDepthStencilComputeSampleAfterRenderPass,
|
||||
|
||||
EnumCount,
|
||||
|
|
|
@ -342,8 +342,8 @@ void EncodeEmptyBlitEncoderForWriteTimestamp(Device* device,
|
|||
descriptor.sampleBufferAttachments[0].endOfEncoderSampleIndex = NSUInteger(cmd->queryIndex);
|
||||
|
||||
id<MTLBlitCommandEncoder> blit = commandContext->BeginBlit(descriptor);
|
||||
if (device->IsToggleEnabled(Toggle::MetalUseDummyBlitEncoderForWriteTimestamp)) {
|
||||
[blit fillBuffer:device->GetDummyBlitMtlBuffer() range:NSMakeRange(0, 1) value:0];
|
||||
if (device->IsToggleEnabled(Toggle::MetalUseMockBlitEncoderForWriteTimestamp)) {
|
||||
[blit fillBuffer:device->GetMockBlitMtlBuffer() range:NSMakeRange(0, 1) value:0];
|
||||
}
|
||||
commandContext->EndBlit();
|
||||
}
|
||||
|
|
|
@ -82,9 +82,9 @@ class Device final : public DeviceBase {
|
|||
bool UseCounterSamplingAtCommandBoundary() const;
|
||||
bool UseCounterSamplingAtStageBoundary() const;
|
||||
|
||||
// Get a MTLBuffer that can be used as a dummy in a no-op blit encoder based on filling this
|
||||
// Get a MTLBuffer that can be used as a mock in a no-op blit encoder based on filling this
|
||||
// single-byte buffer
|
||||
id<MTLBuffer> GetDummyBlitMtlBuffer();
|
||||
id<MTLBuffer> GetMockBlitMtlBuffer();
|
||||
|
||||
void ForceEventualFlushOfCommands() override;
|
||||
|
||||
|
@ -168,7 +168,7 @@ class Device final : public DeviceBase {
|
|||
// Support counter sampling at the begin and end of blit pass, compute pass and render pass's
|
||||
// vertex/fragement stage
|
||||
bool mCounterSamplingAtStageBoundary;
|
||||
NSPRef<id<MTLBuffer>> mDummyBlitMtlBuffer;
|
||||
NSPRef<id<MTLBuffer>> mMockBlitMtlBuffer;
|
||||
};
|
||||
|
||||
} // namespace dawn::native::metal
|
||||
|
|
|
@ -251,11 +251,11 @@ void Device::InitTogglesFromDriver() {
|
|||
}
|
||||
|
||||
// TODO(dawn:1473): Metal fails to store GPU counters to sampleBufferAttachments on empty
|
||||
// encoders on macOS 11.0+, we need to add dummy blit command to blit encoder when encoding
|
||||
// encoders on macOS 11.0+, we need to add mock blit command to blit encoder when encoding
|
||||
// writeTimestamp as workaround by enabling the toggle
|
||||
// "metal_use_dummy_blit_encoder_for_write_timestamp".
|
||||
// "metal_use_mock_blit_encoder_for_write_timestamp".
|
||||
if (@available(macos 11.0, iOS 14.0, *)) {
|
||||
SetToggle(Toggle::MetalUseDummyBlitEncoderForWriteTimestamp, true);
|
||||
SetToggle(Toggle::MetalUseMockBlitEncoderForWriteTimestamp, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ void Device::DestroyImpl() {
|
|||
|
||||
mCommandQueue = nullptr;
|
||||
mMtlDevice = nullptr;
|
||||
mDummyBlitMtlBuffer = nullptr;
|
||||
mMockBlitMtlBuffer = nullptr;
|
||||
}
|
||||
|
||||
uint32_t Device::GetOptimalBytesPerRowAlignment() const {
|
||||
|
@ -581,13 +581,13 @@ bool Device::UseCounterSamplingAtStageBoundary() const {
|
|||
return mCounterSamplingAtStageBoundary;
|
||||
}
|
||||
|
||||
id<MTLBuffer> Device::GetDummyBlitMtlBuffer() {
|
||||
if (mDummyBlitMtlBuffer == nullptr) {
|
||||
mDummyBlitMtlBuffer.Acquire(
|
||||
id<MTLBuffer> Device::GetMockBlitMtlBuffer() {
|
||||
if (mMockBlitMtlBuffer == nullptr) {
|
||||
mMockBlitMtlBuffer.Acquire(
|
||||
[GetMTLDevice() newBufferWithLength:1 options:MTLResourceStorageModePrivate]);
|
||||
}
|
||||
|
||||
return mDummyBlitMtlBuffer.Get();
|
||||
return mMockBlitMtlBuffer.Get();
|
||||
}
|
||||
|
||||
} // namespace dawn::native::metal
|
||||
|
|
Loading…
Reference in New Issue