Commit 9d9f30df by Nicolas Capens Committed by Nicolas Capens

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: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent a624d80f
...@@ -1262,8 +1262,8 @@ void Blitter::ApplyScaleAndClamp(Float4 &value, const State &state, bool preScal ...@@ -1262,8 +1262,8 @@ void Blitter::ApplyScaleAndClamp(Float4 &value, const State &state, bool preScal
float4 scale{}, unscale{}; float4 scale{}, unscale{};
if(state.clearOperation && if(state.clearOperation &&
state.sourceFormat.isNonNormalizedInteger() && state.sourceFormat.isUnnormalizedInteger() &&
!state.destFormat.isNonNormalizedInteger()) !state.destFormat.isUnnormalizedInteger())
{ {
// If we're clearing a buffer from an int or uint color into a normalized color, // 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. // then the whole range of the int or uint color must be scaled between 0 and 1.
...@@ -1365,8 +1365,8 @@ Blitter::BlitRoutineType Blitter::generate(const State &state) ...@@ -1365,8 +1365,8 @@ Blitter::BlitRoutineType Blitter::generate(const State &state)
Int sWidth = *Pointer<Int>(blit + OFFSET(BlitData, sWidth)); Int sWidth = *Pointer<Int>(blit + OFFSET(BlitData, sWidth));
Int sHeight = *Pointer<Int>(blit + OFFSET(BlitData, sHeight)); Int sHeight = *Pointer<Int>(blit + OFFSET(BlitData, sHeight));
bool intSrc = state.sourceFormat.isNonNormalizedInteger(); bool intSrc = state.sourceFormat.isUnnormalizedInteger();
bool intDst = state.destFormat.isNonNormalizedInteger(); bool intDst = state.destFormat.isUnnormalizedInteger();
bool intBoth = intSrc && intDst; bool intBoth = intSrc && intDst;
int srcBytes = state.sourceFormat.bytes(); int srcBytes = state.sourceFormat.bytes();
int dstBytes = state.destFormat.bytes(); int dstBytes = state.destFormat.bytes();
......
...@@ -1860,7 +1860,7 @@ void PixelRoutine::alphaBlend(int index, const Pointer<Byte> &cBuffer, Vector4f ...@@ -1860,7 +1860,7 @@ void PixelRoutine::alphaBlend(int index, const Pointer<Byte> &cBuffer, Vector4f
{ {
one = Float4(1.0f); one = Float4(1.0f);
} }
else if(format.isNonNormalizedInteger()) else if(format.isUnnormalizedInteger())
{ {
one = As<Float4>(format.isUnsignedComponent(0) ? Int4(0xFFFFFFFF) : Int4(0x7FFFFFFF)); one = As<Float4>(format.isUnsignedComponent(0) ? Int4(0xFFFFFFFF) : Int4(0x7FFFFFFF));
} }
......
...@@ -2040,7 +2040,7 @@ Vector4f SamplerCore::sampleTexel(Int4 &uuuu, Int4 &vvvv, Int4 &wwww, Float4 &z, ...@@ -2040,7 +2040,7 @@ Vector4f SamplerCore::sampleTexel(Int4 &uuuu, Int4 &vvvv, Int4 &wwww, Float4 &z,
Vector4s cs = sampleTexel(index, buffer); Vector4s cs = sampleTexel(index, buffer);
bool isInteger = state.textureFormat.isNonNormalizedInteger(); bool isInteger = state.textureFormat.isUnnormalizedInteger();
int componentCount = textureComponentCount(); int componentCount = textureComponentCount();
for(int n = 0; n < componentCount; n++) for(int n = 0; n < componentCount; n++)
{ {
...@@ -2511,7 +2511,7 @@ bool SamplerCore::hasFloatTexture() const ...@@ -2511,7 +2511,7 @@ bool SamplerCore::hasFloatTexture() const
bool SamplerCore::hasUnnormalizedIntegerTexture() const bool SamplerCore::hasUnnormalizedIntegerTexture() const
{ {
return state.textureFormat.isNonNormalizedInteger(); return state.textureFormat.isUnnormalizedInteger();
} }
bool SamplerCore::hasUnsignedTextureComponent(int component) const bool SamplerCore::hasUnsignedTextureComponent(int component) const
......
...@@ -70,7 +70,7 @@ bool Format::isSignedNormalized() const ...@@ -70,7 +70,7 @@ bool Format::isSignedNormalized() const
} }
} }
bool Format::isSignedNonNormalizedInteger() const bool Format::isSignedUnnormalizedInteger() const
{ {
switch(format) switch(format)
{ {
...@@ -101,7 +101,7 @@ bool Format::isSignedNonNormalizedInteger() const ...@@ -101,7 +101,7 @@ bool Format::isSignedNonNormalizedInteger() const
} }
} }
bool Format::isUnsignedNonNormalizedInteger() const bool Format::isUnsignedUnnormalizedInteger() const
{ {
switch(format) switch(format)
{ {
...@@ -133,9 +133,9 @@ bool Format::isUnsignedNonNormalizedInteger() const ...@@ -133,9 +133,9 @@ bool Format::isUnsignedNonNormalizedInteger() const
} }
} }
bool Format::isNonNormalizedInteger() const bool Format::isUnnormalizedInteger() const
{ {
return isSignedNonNormalizedInteger() || isUnsignedNonNormalizedInteger(); return isSignedUnnormalizedInteger() || isUnsignedUnnormalizedInteger();
} }
VkImageAspectFlags Format::getAspects() const VkImageAspectFlags Format::getAspects() const
......
...@@ -30,9 +30,9 @@ public: ...@@ -30,9 +30,9 @@ public:
bool isUnsignedNormalized() const; bool isUnsignedNormalized() const;
bool isSignedNormalized() const; bool isSignedNormalized() const;
bool isSignedNonNormalizedInteger() const; bool isSignedUnnormalizedInteger() const;
bool isUnsignedNonNormalizedInteger() const; bool isUnsignedUnnormalizedInteger() const;
bool isNonNormalizedInteger() const; bool isUnnormalizedInteger() const;
VkImageAspectFlags getAspects() const; VkImageAspectFlags getAspects() const;
Format getAspectFormat(VkImageAspectFlags aspect) const; Format getAspectFormat(VkImageAspectFlags aspect) const;
......
...@@ -274,7 +274,7 @@ void Image::copyTo(Image *dstImage, const VkImageCopy &region) const ...@@ -274,7 +274,7 @@ void Image::copyTo(Image *dstImage, const VkImageCopy &region) const
Format srcFormat = getFormat(srcAspect); Format srcFormat = getFormat(srcAspect);
Format dstFormat = dstImage->getFormat(dstAspect); 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 // Requires multisampling resolve
VkImageBlit blitRegion; VkImageBlit blitRegion;
...@@ -863,11 +863,11 @@ VkFormat Image::getClearFormat() const ...@@ -863,11 +863,11 @@ VkFormat Image::getClearFormat() const
{ {
// Set the proper format for the clear value, as described here: // 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 // 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; return VK_FORMAT_R32G32B32A32_SINT;
} }
else if(format.isUnsignedNonNormalizedInteger()) else if(format.isUnsignedUnnormalizedInteger())
{ {
return VK_FORMAT_R32G32B32A32_UINT; return VK_FORMAT_R32G32B32A32_UINT;
} }
......
...@@ -318,7 +318,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -318,7 +318,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
sw::Stream &input = context.input[desc.location]; sw::Stream &input = context.input[desc.location];
input.count = getNumberOfChannels(desc.format); input.count = getNumberOfChannels(desc.format);
input.type = getStreamType(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.offset = desc.offset;
input.binding = desc.binding; input.binding = desc.binding;
input.vertexStride = vertexStrides[desc.binding]; input.vertexStride = vertexStrides[desc.binding];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment