mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-01 02:43:29 +00:00
Rename SamplerDescriptor::compareFunction to compare.
This is to match the WebGPU IDL. BUG=dawn:22 Change-Id: I63e32fe980c1727562055221ea2769a670461e93 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8625 Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
35716c204d
commit
e409acf561
@ -901,7 +901,7 @@
|
|||||||
{"name": "mipmap filter", "type": "filter mode"},
|
{"name": "mipmap filter", "type": "filter mode"},
|
||||||
{"name": "lod min clamp", "type": "float"},
|
{"name": "lod min clamp", "type": "float"},
|
||||||
{"name": "lod max clamp", "type": "float"},
|
{"name": "lod max clamp", "type": "float"},
|
||||||
{"name": "compare function", "type": "compare function"}
|
{"name": "compare", "type": "compare function"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"shader module": {
|
"shader module": {
|
||||||
|
@ -46,7 +46,7 @@ namespace dawn_native {
|
|||||||
DAWN_TRY(ValidateAddressMode(descriptor->addressModeU));
|
DAWN_TRY(ValidateAddressMode(descriptor->addressModeU));
|
||||||
DAWN_TRY(ValidateAddressMode(descriptor->addressModeV));
|
DAWN_TRY(ValidateAddressMode(descriptor->addressModeV));
|
||||||
DAWN_TRY(ValidateAddressMode(descriptor->addressModeW));
|
DAWN_TRY(ValidateAddressMode(descriptor->addressModeW));
|
||||||
DAWN_TRY(ValidateCompareFunction(descriptor->compareFunction));
|
DAWN_TRY(ValidateCompareFunction(descriptor->compare));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ namespace dawn_native {
|
|||||||
mMipmapFilter(descriptor->mipmapFilter),
|
mMipmapFilter(descriptor->mipmapFilter),
|
||||||
mLodMinClamp(descriptor->lodMinClamp),
|
mLodMinClamp(descriptor->lodMinClamp),
|
||||||
mLodMaxClamp(descriptor->lodMaxClamp),
|
mLodMaxClamp(descriptor->lodMaxClamp),
|
||||||
mCompareFunction(descriptor->compareFunction),
|
mCompareFunction(descriptor->compare),
|
||||||
mIsBlueprint(blueprint) {
|
mIsBlueprint(blueprint) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ namespace dawn_native { namespace d3d12 {
|
|||||||
mSamplerDesc.AddressW = AddressMode(descriptor->addressModeW);
|
mSamplerDesc.AddressW = AddressMode(descriptor->addressModeW);
|
||||||
mSamplerDesc.MipLODBias = 0.f;
|
mSamplerDesc.MipLODBias = 0.f;
|
||||||
mSamplerDesc.MaxAnisotropy = 1;
|
mSamplerDesc.MaxAnisotropy = 1;
|
||||||
mSamplerDesc.ComparisonFunc = ToD3D12ComparisonFunc(descriptor->compareFunction);
|
mSamplerDesc.ComparisonFunc = ToD3D12ComparisonFunc(descriptor->compare);
|
||||||
mSamplerDesc.MinLOD = descriptor->lodMinClamp;
|
mSamplerDesc.MinLOD = descriptor->lodMinClamp;
|
||||||
mSamplerDesc.MaxLOD = descriptor->lodMaxClamp;
|
mSamplerDesc.MaxLOD = descriptor->lodMaxClamp;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace dawn_native { namespace metal {
|
|||||||
|
|
||||||
mtlDesc.lodMinClamp = descriptor->lodMinClamp;
|
mtlDesc.lodMinClamp = descriptor->lodMinClamp;
|
||||||
mtlDesc.lodMaxClamp = descriptor->lodMaxClamp;
|
mtlDesc.lodMaxClamp = descriptor->lodMaxClamp;
|
||||||
mtlDesc.compareFunction = ToMetalCompareFunction(descriptor->compareFunction);
|
mtlDesc.compareFunction = ToMetalCompareFunction(descriptor->compare);
|
||||||
|
|
||||||
mMtlSamplerState = [device->GetMTLDevice() newSamplerStateWithDescriptor:mtlDesc];
|
mMtlSamplerState = [device->GetMTLDevice() newSamplerStateWithDescriptor:mtlDesc];
|
||||||
|
|
||||||
|
@ -87,10 +87,10 @@ namespace dawn_native { namespace opengl {
|
|||||||
gl.SamplerParameterf(mHandle, GL_TEXTURE_MIN_LOD, descriptor->lodMinClamp);
|
gl.SamplerParameterf(mHandle, GL_TEXTURE_MIN_LOD, descriptor->lodMinClamp);
|
||||||
gl.SamplerParameterf(mHandle, GL_TEXTURE_MAX_LOD, descriptor->lodMaxClamp);
|
gl.SamplerParameterf(mHandle, GL_TEXTURE_MAX_LOD, descriptor->lodMaxClamp);
|
||||||
|
|
||||||
if (ToOpenGLCompareFunction(descriptor->compareFunction) != GL_NEVER) {
|
if (ToOpenGLCompareFunction(descriptor->compare) != GL_NEVER) {
|
||||||
gl.SamplerParameteri(mHandle, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
|
gl.SamplerParameteri(mHandle, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
|
||||||
gl.SamplerParameteri(mHandle, GL_TEXTURE_COMPARE_FUNC,
|
gl.SamplerParameteri(mHandle, GL_TEXTURE_COMPARE_FUNC,
|
||||||
ToOpenGLCompareFunction(descriptor->compareFunction));
|
ToOpenGLCompareFunction(descriptor->compare));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace dawn_native { namespace vulkan {
|
|||||||
createInfo.mipLodBias = 0.0f;
|
createInfo.mipLodBias = 0.0f;
|
||||||
createInfo.anisotropyEnable = VK_FALSE;
|
createInfo.anisotropyEnable = VK_FALSE;
|
||||||
createInfo.maxAnisotropy = 1.0f;
|
createInfo.maxAnisotropy = 1.0f;
|
||||||
createInfo.compareOp = ToVulkanCompareOp(descriptor->compareFunction);
|
createInfo.compareOp = ToVulkanCompareOp(descriptor->compare);
|
||||||
createInfo.compareEnable = createInfo.compareOp == VK_COMPARE_OP_NEVER ? VK_FALSE : VK_TRUE;
|
createInfo.compareEnable = createInfo.compareOp == VK_COMPARE_OP_NEVER ? VK_FALSE : VK_TRUE;
|
||||||
createInfo.minLod = descriptor->lodMinClamp;
|
createInfo.minLod = descriptor->lodMinClamp;
|
||||||
createInfo.maxLod = descriptor->lodMaxClamp;
|
createInfo.maxLod = descriptor->lodMaxClamp;
|
||||||
|
@ -236,7 +236,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
|||||||
samplerDescriptor.addressModeW = dawn::AddressMode::ClampToEdge;
|
samplerDescriptor.addressModeW = dawn::AddressMode::ClampToEdge;
|
||||||
samplerDescriptor.lodMinClamp = kLodMin;
|
samplerDescriptor.lodMinClamp = kLodMin;
|
||||||
samplerDescriptor.lodMaxClamp = kLodMax;
|
samplerDescriptor.lodMaxClamp = kLodMax;
|
||||||
samplerDescriptor.compareFunction = dawn::CompareFunction::Never;
|
samplerDescriptor.compare = dawn::CompareFunction::Never;
|
||||||
|
|
||||||
dawn::Sampler sampler = device.CreateSampler(&samplerDescriptor);
|
dawn::Sampler sampler = device.CreateSampler(&samplerDescriptor);
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ TEST_P(ObjectCachingTest, SamplerDeduplication) {
|
|||||||
dawn::Sampler otherSamplerLodMaxClamp = device.CreateSampler(&otherSamplerDescLodMaxClamp);
|
dawn::Sampler otherSamplerLodMaxClamp = device.CreateSampler(&otherSamplerDescLodMaxClamp);
|
||||||
|
|
||||||
dawn::SamplerDescriptor otherSamplerDescCompareFunction = utils::GetDefaultSamplerDescriptor();
|
dawn::SamplerDescriptor otherSamplerDescCompareFunction = utils::GetDefaultSamplerDescriptor();
|
||||||
otherSamplerDescCompareFunction.compareFunction = dawn::CompareFunction::Always;
|
otherSamplerDescCompareFunction.compare = dawn::CompareFunction::Always;
|
||||||
dawn::Sampler otherSamplerCompareFunction =
|
dawn::Sampler otherSamplerCompareFunction =
|
||||||
device.CreateSampler(&otherSamplerDescCompareFunction);
|
device.CreateSampler(&otherSamplerDescCompareFunction);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ protected:
|
|||||||
descriptor.addressModeW = w.mMode;
|
descriptor.addressModeW = w.mMode;
|
||||||
descriptor.lodMinClamp = kLodMin;
|
descriptor.lodMinClamp = kLodMin;
|
||||||
descriptor.lodMaxClamp = kLodMax;
|
descriptor.lodMaxClamp = kLodMax;
|
||||||
descriptor.compareFunction = dawn::CompareFunction::Never;
|
descriptor.compare = dawn::CompareFunction::Never;
|
||||||
sampler = device.CreateSampler(&descriptor);
|
sampler = device.CreateSampler(&descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ protected:
|
|||||||
samplerDescriptor.addressModeW = kAddressMode;
|
samplerDescriptor.addressModeW = kAddressMode;
|
||||||
samplerDescriptor.lodMinClamp = kLodMin;
|
samplerDescriptor.lodMinClamp = kLodMin;
|
||||||
samplerDescriptor.lodMaxClamp = kLodMax;
|
samplerDescriptor.lodMaxClamp = kLodMax;
|
||||||
samplerDescriptor.compareFunction = dawn::CompareFunction::Never;
|
samplerDescriptor.compare = dawn::CompareFunction::Never;
|
||||||
mSampler = device.CreateSampler(&samplerDescriptor);
|
mSampler = device.CreateSampler(&samplerDescriptor);
|
||||||
|
|
||||||
mPipelineLayout = utils::MakeBasicPipelineLayout(device, &mBindGroupLayout);
|
mPipelineLayout = utils::MakeBasicPipelineLayout(device, &mBindGroupLayout);
|
||||||
|
@ -273,7 +273,7 @@ TEST_F(WireArgumentTests, StructureOfValuesArgument) {
|
|||||||
descriptor.addressModeW = DAWN_ADDRESS_MODE_MIRRORED_REPEAT;
|
descriptor.addressModeW = DAWN_ADDRESS_MODE_MIRRORED_REPEAT;
|
||||||
descriptor.lodMinClamp = kLodMin;
|
descriptor.lodMinClamp = kLodMin;
|
||||||
descriptor.lodMaxClamp = kLodMax;
|
descriptor.lodMaxClamp = kLodMax;
|
||||||
descriptor.compareFunction = DAWN_COMPARE_FUNCTION_NEVER;
|
descriptor.compare = DAWN_COMPARE_FUNCTION_NEVER;
|
||||||
|
|
||||||
dawnDeviceCreateSampler(device, &descriptor);
|
dawnDeviceCreateSampler(device, &descriptor);
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ TEST_F(WireArgumentTests, StructureOfValuesArgument) {
|
|||||||
desc->addressModeU == DAWN_ADDRESS_MODE_CLAMP_TO_EDGE &&
|
desc->addressModeU == DAWN_ADDRESS_MODE_CLAMP_TO_EDGE &&
|
||||||
desc->addressModeV == DAWN_ADDRESS_MODE_REPEAT &&
|
desc->addressModeV == DAWN_ADDRESS_MODE_REPEAT &&
|
||||||
desc->addressModeW == DAWN_ADDRESS_MODE_MIRRORED_REPEAT &&
|
desc->addressModeW == DAWN_ADDRESS_MODE_MIRRORED_REPEAT &&
|
||||||
desc->compareFunction == DAWN_COMPARE_FUNCTION_NEVER &&
|
desc->compare == DAWN_COMPARE_FUNCTION_NEVER &&
|
||||||
desc->lodMinClamp == kLodMin && desc->lodMaxClamp == kLodMax;
|
desc->lodMinClamp == kLodMin && desc->lodMaxClamp == kLodMax;
|
||||||
})))
|
})))
|
||||||
.WillOnce(Return(apiDummySampler));
|
.WillOnce(Return(apiDummySampler));
|
||||||
|
@ -268,7 +268,7 @@ namespace utils {
|
|||||||
desc.addressModeW = dawn::AddressMode::Repeat;
|
desc.addressModeW = dawn::AddressMode::Repeat;
|
||||||
desc.lodMinClamp = kLodMin;
|
desc.lodMinClamp = kLodMin;
|
||||||
desc.lodMaxClamp = kLodMax;
|
desc.lodMaxClamp = kLodMax;
|
||||||
desc.compareFunction = dawn::CompareFunction::Never;
|
desc.compare = dawn::CompareFunction::Never;
|
||||||
|
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user