Rename NonNormalized to Unnormalized
That's what it's called by the Vulkan spec.
Fixes: b/29203875
Change-Id: Id5049147692b0c845b1bb7afeb8ff5fa94c25773
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40114
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Device/Blitter.cpp b/src/Device/Blitter.cpp
index d67968f..99e9d3a 100644
--- a/src/Device/Blitter.cpp
+++ b/src/Device/Blitter.cpp
@@ -1262,8 +1262,8 @@
float4 scale{}, unscale{};
if(state.clearOperation &&
- state.sourceFormat.isNonNormalizedInteger() &&
- !state.destFormat.isNonNormalizedInteger())
+ state.sourceFormat.isUnnormalizedInteger() &&
+ !state.destFormat.isUnnormalizedInteger())
{
// If we're clearing a buffer from an int or uint color into a normalized color,
// then the whole range of the int or uint color must be scaled between 0 and 1.
@@ -1365,8 +1365,8 @@
Int sWidth = *Pointer<Int>(blit + OFFSET(BlitData, sWidth));
Int sHeight = *Pointer<Int>(blit + OFFSET(BlitData, sHeight));
- bool intSrc = state.sourceFormat.isNonNormalizedInteger();
- bool intDst = state.destFormat.isNonNormalizedInteger();
+ bool intSrc = state.sourceFormat.isUnnormalizedInteger();
+ bool intDst = state.destFormat.isUnnormalizedInteger();
bool intBoth = intSrc && intDst;
int srcBytes = state.sourceFormat.bytes();
int dstBytes = state.destFormat.bytes();
diff --git a/src/Pipeline/PixelRoutine.cpp b/src/Pipeline/PixelRoutine.cpp
index c6fd4e3..652d2ae 100644
--- a/src/Pipeline/PixelRoutine.cpp
+++ b/src/Pipeline/PixelRoutine.cpp
@@ -1860,7 +1860,7 @@
{
one = Float4(1.0f);
}
- else if(format.isNonNormalizedInteger())
+ else if(format.isUnnormalizedInteger())
{
one = As<Float4>(format.isUnsignedComponent(0) ? Int4(0xFFFFFFFF) : Int4(0x7FFFFFFF));
}
diff --git a/src/Pipeline/SamplerCore.cpp b/src/Pipeline/SamplerCore.cpp
index 9668d12..9b20c1d 100644
--- a/src/Pipeline/SamplerCore.cpp
+++ b/src/Pipeline/SamplerCore.cpp
@@ -2040,7 +2040,7 @@
Vector4s cs = sampleTexel(index, buffer);
- bool isInteger = state.textureFormat.isNonNormalizedInteger();
+ bool isInteger = state.textureFormat.isUnnormalizedInteger();
int componentCount = textureComponentCount();
for(int n = 0; n < componentCount; n++)
{
@@ -2511,7 +2511,7 @@
bool SamplerCore::hasUnnormalizedIntegerTexture() const
{
- return state.textureFormat.isNonNormalizedInteger();
+ return state.textureFormat.isUnnormalizedInteger();
}
bool SamplerCore::hasUnsignedTextureComponent(int component) const
diff --git a/src/Vulkan/VkFormat.cpp b/src/Vulkan/VkFormat.cpp
index 6fb6264..edd8f12 100644
--- a/src/Vulkan/VkFormat.cpp
+++ b/src/Vulkan/VkFormat.cpp
@@ -70,7 +70,7 @@
}
}
-bool Format::isSignedNonNormalizedInteger() const
+bool Format::isSignedUnnormalizedInteger() const
{
switch(format)
{
@@ -101,7 +101,7 @@
}
}
-bool Format::isUnsignedNonNormalizedInteger() const
+bool Format::isUnsignedUnnormalizedInteger() const
{
switch(format)
{
@@ -133,9 +133,9 @@
}
}
-bool Format::isNonNormalizedInteger() const
+bool Format::isUnnormalizedInteger() const
{
- return isSignedNonNormalizedInteger() || isUnsignedNonNormalizedInteger();
+ return isSignedUnnormalizedInteger() || isUnsignedUnnormalizedInteger();
}
VkImageAspectFlags Format::getAspects() const
diff --git a/src/Vulkan/VkFormat.h b/src/Vulkan/VkFormat.h
index 1e20340..9e4b1f8 100644
--- a/src/Vulkan/VkFormat.h
+++ b/src/Vulkan/VkFormat.h
@@ -30,9 +30,9 @@
bool isUnsignedNormalized() const;
bool isSignedNormalized() const;
- bool isSignedNonNormalizedInteger() const;
- bool isUnsignedNonNormalizedInteger() const;
- bool isNonNormalizedInteger() const;
+ bool isSignedUnnormalizedInteger() const;
+ bool isUnsignedUnnormalizedInteger() const;
+ bool isUnnormalizedInteger() const;
VkImageAspectFlags getAspects() const;
Format getAspectFormat(VkImageAspectFlags aspect) const;
diff --git a/src/Vulkan/VkImage.cpp b/src/Vulkan/VkImage.cpp
index c605f4a..b1e7916 100644
--- a/src/Vulkan/VkImage.cpp
+++ b/src/Vulkan/VkImage.cpp
@@ -274,7 +274,7 @@
Format srcFormat = getFormat(srcAspect);
Format dstFormat = dstImage->getFormat(dstAspect);
- if((samples > VK_SAMPLE_COUNT_1_BIT) && (imageType == VK_IMAGE_TYPE_2D) && !format.isNonNormalizedInteger())
+ if((samples > VK_SAMPLE_COUNT_1_BIT) && (imageType == VK_IMAGE_TYPE_2D) && !format.isUnnormalizedInteger())
{
// Requires multisampling resolve
VkImageBlit blitRegion;
@@ -863,11 +863,11 @@
{
// Set the proper format for the clear value, as described here:
// https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#clears-values
- if(format.isSignedNonNormalizedInteger())
+ if(format.isSignedUnnormalizedInteger())
{
return VK_FORMAT_R32G32B32A32_SINT;
}
- else if(format.isUnsignedNonNormalizedInteger())
+ else if(format.isUnsignedUnnormalizedInteger())
{
return VK_FORMAT_R32G32B32A32_UINT;
}
diff --git a/src/Vulkan/VkPipeline.cpp b/src/Vulkan/VkPipeline.cpp
index 71ad391..a89a2bc 100644
--- a/src/Vulkan/VkPipeline.cpp
+++ b/src/Vulkan/VkPipeline.cpp
@@ -318,7 +318,7 @@
sw::Stream &input = context.input[desc.location];
input.count = getNumberOfChannels(desc.format);
input.type = getStreamType(desc.format);
- input.normalized = !vk::Format(desc.format).isNonNormalizedInteger();
+ input.normalized = !vk::Format(desc.format).isUnnormalizedInteger();
input.offset = desc.offset;
input.binding = desc.binding;
input.vertexStride = vertexStrides[desc.binding];