aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-autoroll <android-autoroll@skia-public.iam.gserviceaccount.com>2024-01-30 14:50:37 +0000
committerandroid-autoroll <android-autoroll@skia-public.iam.gserviceaccount.com>2024-01-30 14:50:37 +0000
commit6f4c9b7b738bf55f7572896ea19788fb46f4e0b2 (patch)
treec4180a045d5dce383186528b80bb08aecca6f5fd
parentae1ff4352160fb0f7e5946c44118ad453241c625 (diff)
parent2cc2b392c9ef02f363850de20e3938676e8be48f (diff)
downloadswiftshader-6f4c9b7b738bf55f7572896ea19788fb46f4e0b2.tar.gz
Roll SwiftShader from 328e794f0c8b to 2cc2b392c9ef (5 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/328e794f0c8b..2cc2b392c9ef Please enable autosubmit on changes if possible when approving them. If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/swiftshader-android Please CC natsu@google.com,nicolascapens@google.com,swiftshader-eng@google.com on the revert to ensure that a human is aware of the problem. To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Test: Presubmit checks will test this change. Exempt-From-Owner-Approval: The autoroll bot does not require owner approval. Change-Id: Ia7537d55850f00b0afed7a6aff1a8dcd0d3b5930
-rw-r--r--src/Device/Renderer.cpp6
-rw-r--r--src/Pipeline/SamplerCore.cpp2
-rw-r--r--src/Pipeline/SpirvShaderSampling.cpp6
-rw-r--r--src/Reactor/BUILD.gn2
-rw-r--r--src/Vulkan/VkImageView.cpp10
-rw-r--r--src/Vulkan/VkImageView.hpp5
-rw-r--r--third_party/llvm-10.0/llvm/include/llvm/Demangle/ItaniumDemangle.h7
-rw-r--r--third_party/llvm-16.0/llvm/include/llvm/Demangle/ItaniumDemangle.h6
8 files changed, 30 insertions, 14 deletions
diff --git a/src/Device/Renderer.cpp b/src/Device/Renderer.cpp
index b80ee4639..93d2993da 100644
--- a/src/Device/Renderer.cpp
+++ b/src/Device/Renderer.cpp
@@ -285,11 +285,7 @@ void Renderer::draw(const vk::GraphicsPipeline *pipeline, const vk::DynamicState
data->layer = layer;
data->instanceID = instanceID;
data->baseVertex = baseVertex;
-
- if(indexBuffer)
- {
- draw->indexType = pipeline->getIndexBuffer().getIndexType();
- }
+ draw->indexType = indexBuffer ? pipeline->getIndexBuffer().getIndexType() : VK_INDEX_TYPE_UINT16;
draw->vertexRoutine = vertexRoutine;
diff --git a/src/Pipeline/SamplerCore.cpp b/src/Pipeline/SamplerCore.cpp
index 403ed3bdd..ab55c036a 100644
--- a/src/Pipeline/SamplerCore.cpp
+++ b/src/Pipeline/SamplerCore.cpp
@@ -133,6 +133,8 @@ Vector4f SamplerCore::sampleTexture128(Pointer<Byte> &texture, Float4 uvwa[4], c
{
// TODO: Eliminate int-float-int conversion.
lod = Float(As<Int>(lodOrBias));
+ lod = Max(lod, state.minLod);
+ lod = Min(lod, state.maxLod);
}
else if(function == Base || function == Gather)
{
diff --git a/src/Pipeline/SpirvShaderSampling.cpp b/src/Pipeline/SpirvShaderSampling.cpp
index 47ce57b64..4c674050e 100644
--- a/src/Pipeline/SpirvShaderSampling.cpp
+++ b/src/Pipeline/SpirvShaderSampling.cpp
@@ -108,6 +108,12 @@ SpirvEmitter::ImageSampler *SpirvEmitter::getImageSampler(const vk::Device *devi
samplerState.minLod = 0.0f;
samplerState.maxLod = 0.0f;
}
+ // Otherwise make sure LOD is clamped for robustness
+ else
+ {
+ samplerState.minLod = imageViewState.minLod;
+ samplerState.maxLod = imageViewState.maxLod;
+ }
}
else if(samplerMethod == Write)
{
diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn
index 67dfeb0ec..dcb13614a 100644
--- a/src/Reactor/BUILD.gn
+++ b/src/Reactor/BUILD.gn
@@ -307,7 +307,7 @@ if (supports_subzero) {
if (supports_llvm) {
swiftshader_source_set("swiftshader_llvm_reactor") {
- llvm_dir = "../../third_party/llvm-10.0"
+ llvm_dir = "../../third_party/llvm-16.0"
deps = [
":swiftshader_reactor_base",
diff --git a/src/Vulkan/VkImageView.cpp b/src/Vulkan/VkImageView.cpp
index 511c02cbb..1b25544a5 100644
--- a/src/Vulkan/VkImageView.cpp
+++ b/src/Vulkan/VkImageView.cpp
@@ -89,13 +89,15 @@ Identifier::Identifier(const VkImageViewCreateInfo *pCreateInfo)
const Image *sampledImage = image->getSampledImage(viewFormat);
vk::Format samplingFormat = (image == sampledImage) ? viewFormat : sampledImage->getFormat().getAspectFormat(subresource.aspectMask);
- pack({ pCreateInfo->viewType, samplingFormat, ResolveComponentMapping(pCreateInfo->components, viewFormat), subresource.levelCount <= 1u });
+ pack({ pCreateInfo->viewType, samplingFormat, ResolveComponentMapping(pCreateInfo->components, viewFormat),
+ static_cast<uint8_t>(subresource.baseMipLevel),
+ static_cast<uint8_t>(subresource.baseMipLevel + subresource.levelCount), subresource.levelCount <= 1u });
}
Identifier::Identifier(VkFormat bufferFormat)
{
constexpr VkComponentMapping identityMapping = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
- pack({ VK_IMAGE_VIEW_TYPE_1D, bufferFormat, ResolveComponentMapping(identityMapping, bufferFormat), true });
+ pack({ VK_IMAGE_VIEW_TYPE_1D, bufferFormat, ResolveComponentMapping(identityMapping, bufferFormat), 0, 1, true });
}
void Identifier::pack(const State &state)
@@ -106,6 +108,8 @@ void Identifier::pack(const State &state)
g = static_cast<uint32_t>(state.mapping.g);
b = static_cast<uint32_t>(state.mapping.b);
a = static_cast<uint32_t>(state.mapping.a);
+ minLod = state.minLod;
+ maxLod = state.maxLod;
singleMipLevel = state.singleMipLevel;
}
@@ -117,6 +121,8 @@ Identifier::State Identifier::getState() const
static_cast<VkComponentSwizzle>(g),
static_cast<VkComponentSwizzle>(b),
static_cast<VkComponentSwizzle>(a) },
+ static_cast<uint8_t>(minLod),
+ static_cast<uint8_t>(maxLod),
static_cast<bool>(singleMipLevel) };
}
diff --git a/src/Vulkan/VkImageView.hpp b/src/Vulkan/VkImageView.hpp
index bf4d666a4..25feebc9e 100644
--- a/src/Vulkan/VkImageView.hpp
+++ b/src/Vulkan/VkImageView.hpp
@@ -53,6 +53,8 @@ union Identifier
VkImageViewType imageViewType;
VkFormat format;
VkComponentMapping mapping;
+ uint8_t minLod;
+ uint8_t maxLod;
bool singleMipLevel;
};
State getState() const;
@@ -61,6 +63,7 @@ private:
void pack(const State &data);
// Identifier is a union of this struct and the integer below.
+ static_assert(sw::MIPMAP_LEVELS <= 15);
struct
{
uint32_t imageViewType : 3;
@@ -69,6 +72,8 @@ private:
uint32_t g : 3;
uint32_t b : 3;
uint32_t a : 3;
+ uint32_t minLod : 4;
+ uint32_t maxLod : 4;
uint32_t singleMipLevel : 1;
};
diff --git a/third_party/llvm-10.0/llvm/include/llvm/Demangle/ItaniumDemangle.h b/third_party/llvm-10.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 14f8102b4..d1d9617e7 100644
--- a/third_party/llvm-10.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/third_party/llvm-10.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -28,6 +28,7 @@
#include <cstring>
#include <exception>
#include <numeric>
+#include <type_traits>
#include <utility>
#define FOR_EACH_NODE_KIND(X) \
@@ -2171,13 +2172,13 @@ FOR_EACH_NODE_KIND(SPECIALIZATION)
template <class T, size_t N>
class PODSmallVector {
- static_assert(std::is_pod<T>::value,
- "T is required to be a plain old data type");
+ static_assert(std::is_trivial<T>::value,
+ "T is required to be a trivial type");
T* First = nullptr;
T* Last = nullptr;
T* Cap = nullptr;
- T Inline[N] = {0};
+ T Inline[N] = {};
bool isInline() const { return First == Inline; }
diff --git a/third_party/llvm-16.0/llvm/include/llvm/Demangle/ItaniumDemangle.h b/third_party/llvm-16.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 121eae193..e20b04d54 100644
--- a/third_party/llvm-16.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/third_party/llvm-16.0/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -33,13 +33,13 @@
DEMANGLE_NAMESPACE_BEGIN
template <class T, size_t N> class PODSmallVector {
- static_assert(std::is_pod<T>::value,
- "T is required to be a plain old data type");
+ static_assert(std::is_trivial<T>::value,
+ "T is required to be a trivial type");
T *First = nullptr;
T *Last = nullptr;
T *Cap = nullptr;
- T Inline[N] = {0};
+ T Inline[N] = {};
bool isInline() const { return First == Inline; }