Pass the vk::Device to every routine as an extra parameter Previously we stowed away the pointer to the device in the SampledImageDescriptor structure. With OpImageWrite with an Unknown format we'd also have to store it in the StorageImageDescriptor if we were to follow the same approach for accessing the device's sampler routine cache. This change refactors things to instead pass the device pointer as an argument of the processing routines. Note that previously the pointer would be read again for every descriptor access since the JIT has no way of knowing that the device is the same for each of them. Bug: b/203730083 Change-Id: I63f6f797610fb56b53d0b7f62811692f78e0d2f8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/59328 Kokoro-Result: 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/PixelProcessor.hpp b/src/Device/PixelProcessor.hpp index 0b6da36..5d4b9bb 100644 --- a/src/Device/PixelProcessor.hpp +++ b/src/Device/PixelProcessor.hpp
@@ -28,7 +28,7 @@ struct Primitive; class SpirvShader; -using RasterizerFunction = FunctionT<void(const Primitive *primitive, int count, int cluster, int clusterCount, DrawData *draw)>; +using RasterizerFunction = FunctionT<void(const vk::Device *device, const Primitive *primitive, int count, int cluster, int clusterCount, DrawData *draw)>; class PixelProcessor {
diff --git a/src/Device/Rasterizer.hpp b/src/Device/Rasterizer.hpp index a0c475a..b40d70a 100644 --- a/src/Device/Rasterizer.hpp +++ b/src/Device/Rasterizer.hpp
@@ -24,15 +24,17 @@ { public: Rasterizer() - : primitive(Arg<0>()) - , count(Arg<1>()) - , cluster(Arg<2>()) - , clusterCount(Arg<3>()) - , data(Arg<4>()) + : device(Arg<0>()) + , primitive(Arg<1>()) + , count(Arg<2>()) + , cluster(Arg<3>()) + , clusterCount(Arg<4>()) + , data(Arg<5>()) {} virtual ~Rasterizer() {} protected: + Pointer<Byte> device; Pointer<Byte> primitive; Int count; Int cluster;
diff --git a/src/Device/Renderer.cpp b/src/Device/Renderer.cpp index 7d9009e..f7a123e 100644 --- a/src/Device/Renderer.cpp +++ b/src/Device/Renderer.cpp
@@ -256,7 +256,6 @@ } DrawData *data = draw->data; - draw->device = device; draw->occlusionQuery = occlusionQuery; draw->batchDataPool = &batchDataPool; draw->numPrimitives = count; @@ -430,7 +429,7 @@ vk::DescriptorSet::PrepareForSampling(draw->descriptorSetObjects, draw->pipelineLayout, device); - DrawCall::run(draw, &drawTickets, clusterQueues); + DrawCall::run(device, draw, &drawTickets, clusterQueues); } void DrawCall::setup() @@ -446,7 +445,7 @@ } } -void DrawCall::teardown() +void DrawCall::teardown(vk::Device *device) { if(events) { @@ -481,7 +480,7 @@ } } -void DrawCall::run(const marl::Loan<DrawCall> &draw, marl::Ticket::Queue *tickets, marl::Ticket::Queue clusterQueues[MaxClusterCount]) +void DrawCall::run(vk::Device *device, const marl::Loan<DrawCall> &draw, marl::Ticket::Queue *tickets, marl::Ticket::Queue clusterQueues[MaxClusterCount]) { draw->setup(); @@ -490,9 +489,9 @@ auto const numBatches = draw->numBatches; auto ticket = tickets->take(); - auto finally = marl::make_shared_finally([draw, ticket] { + auto finally = marl::make_shared_finally([device, draw, ticket] { MARL_SCOPED_EVENT("FINISH draw %d", draw->id); - draw->teardown(); + draw->teardown(device); ticket.done(); }); @@ -508,16 +507,16 @@ batch->clusterTickets[cluster] = std::move(clusterQueues[cluster].take()); } - marl::schedule([draw, batch, finally] { - processVertices(draw.get(), batch.get()); + marl::schedule([device, draw, batch, finally] { + processVertices(device, draw.get(), batch.get()); if(!draw->setupState.rasterizerDiscard) { - processPrimitives(draw.get(), batch.get()); + processPrimitives(device, draw.get(), batch.get()); if(batch->numVisible > 0) { - processPixels(draw, batch, finally); + processPixels(device, draw, batch, finally); return; } } @@ -530,7 +529,7 @@ } } -void DrawCall::processVertices(DrawCall *draw, BatchData *batch) +void DrawCall::processVertices(vk::Device *device, DrawCall *draw, BatchData *batch) { MARL_SCOPED_EVENT("VERTEX draw %d, batch %d", draw->id, batch->id); @@ -557,18 +556,18 @@ vertexTask.vertexCache.drawCall = draw->id; } - draw->vertexRoutine(&batch->triangles.front().v0, &triangleIndices[0][0], &vertexTask, draw->data); + draw->vertexRoutine(device, &batch->triangles.front().v0, &triangleIndices[0][0], &vertexTask, draw->data); } -void DrawCall::processPrimitives(DrawCall *draw, BatchData *batch) +void DrawCall::processPrimitives(vk::Device *device, DrawCall *draw, BatchData *batch) { MARL_SCOPED_EVENT("PRIMITIVES draw %d batch %d", draw->id, batch->id); auto triangles = &batch->triangles[0]; auto primitives = &batch->primitives[0]; - batch->numVisible = draw->setupPrimitives(triangles, primitives, draw, batch->numPrimitives); + batch->numVisible = draw->setupPrimitives(device, triangles, primitives, draw, batch->numPrimitives); } -void DrawCall::processPixels(const marl::Loan<DrawCall> &draw, const marl::Loan<BatchData> &batch, const std::shared_ptr<marl::Finally> &finally) +void DrawCall::processPixels(vk::Device *device, const marl::Loan<DrawCall> &draw, const marl::Loan<BatchData> &batch, const std::shared_ptr<marl::Finally> &finally) { struct Data { @@ -584,11 +583,11 @@ auto data = std::make_shared<Data>(draw, batch, finally); for(int cluster = 0; cluster < MaxClusterCount; cluster++) { - batch->clusterTickets[cluster].onCall([data, cluster] { + batch->clusterTickets[cluster].onCall([device, data, cluster] { auto &draw = data->draw; auto &batch = data->batch; MARL_SCOPED_EVENT("PIXEL draw %d, batch %d, cluster %d", draw->id, batch->id, cluster); - draw->pixelRoutine(&batch->primitives.front(), batch->numVisible, cluster, MaxClusterCount, draw->data); + draw->pixelRoutine(device, &batch->primitives.front(), batch->numVisible, cluster, MaxClusterCount, draw->data); batch->clusterTickets[cluster].done(); }); } @@ -657,7 +656,7 @@ } } -int DrawCall::setupSolidTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) +int DrawCall::setupSolidTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) { auto &state = drawCall->setupState; @@ -692,7 +691,7 @@ } } - if(drawCall->setupRoutine(primitives, triangles, &polygon, data)) + if(drawCall->setupRoutine(device, primitives, triangles, &polygon, data)) { primitives += ms; visible++; @@ -702,7 +701,7 @@ return visible; } -int DrawCall::setupWireframeTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) +int DrawCall::setupWireframeTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) { auto &state = drawCall->setupState; @@ -746,7 +745,7 @@ for(int i = 0; i < 3; i++) { - if(setupLine(*primitives, lines[i], *drawCall)) + if(setupLine(device, *primitives, lines[i], *drawCall)) { primitives += ms; visible++; @@ -757,7 +756,7 @@ return visible; } -int DrawCall::setupPointTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) +int DrawCall::setupPointTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) { auto &state = drawCall->setupState; @@ -791,7 +790,7 @@ for(int i = 0; i < 3; i++) { - if(setupPoint(*primitives, points[i], *drawCall)) + if(setupPoint(device, *primitives, points[i], *drawCall)) { primitives += ms; visible++; @@ -802,7 +801,7 @@ return visible; } -int DrawCall::setupLines(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) +int DrawCall::setupLines(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) { auto &state = drawCall->setupState; @@ -811,7 +810,7 @@ for(int i = 0; i < count; i++) { - if(setupLine(*primitives, *triangles, *drawCall)) + if(setupLine(device, *primitives, *triangles, *drawCall)) { primitives += ms; visible++; @@ -823,7 +822,7 @@ return visible; } -int DrawCall::setupPoints(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) +int DrawCall::setupPoints(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count) { auto &state = drawCall->setupState; @@ -832,7 +831,7 @@ for(int i = 0; i < count; i++) { - if(setupPoint(*primitives, *triangles, *drawCall)) + if(setupPoint(device, *primitives, *triangles, *drawCall)) { primitives += ms; visible++; @@ -844,7 +843,7 @@ return visible; } -bool DrawCall::setupLine(Primitive &primitive, Triangle &triangle, const DrawCall &draw) +bool DrawCall::setupLine(vk::Device *device, Primitive &primitive, Triangle &triangle, const DrawCall &draw) { const DrawData &data = *draw.data; @@ -932,7 +931,7 @@ } } - return draw.setupRoutine(&primitive, &triangle, &polygon, &data); + return draw.setupRoutine(device, &primitive, &triangle, &polygon, &data); } } else if(false) // TODO(b/80135519): Deprecate @@ -1043,7 +1042,7 @@ } } - return draw.setupRoutine(&primitive, &triangle, &polygon, &data); + return draw.setupRoutine(device, &primitive, &triangle, &polygon, &data); } } else @@ -1134,14 +1133,14 @@ } } - return draw.setupRoutine(&primitive, &triangle, &polygon, &data); + return draw.setupRoutine(device, &primitive, &triangle, &polygon, &data); } } return false; } -bool DrawCall::setupPoint(Primitive &primitive, Triangle &triangle, const DrawCall &draw) +bool DrawCall::setupPoint(vk::Device *device, Primitive &primitive, Triangle &triangle, const DrawCall &draw) { const DrawData &data = *draw.data; @@ -1199,7 +1198,7 @@ primitive.pointSizeInv = 1.0f / pSize; - return draw.setupRoutine(&primitive, &triangle, &polygon, &data); + return draw.setupRoutine(device, &primitive, &triangle, &polygon, &data); } return false;
diff --git a/src/Device/Renderer.hpp b/src/Device/Renderer.hpp index 9d550ad..7ce27a8 100644 --- a/src/Device/Renderer.hpp +++ b/src/Device/Renderer.hpp
@@ -135,17 +135,17 @@ }; using Pool = marl::BoundedPool<DrawCall, MaxDrawCount, marl::PoolPolicy::Preserve>; - using SetupFunction = int (*)(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + using SetupFunction = int (*)(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); DrawCall(); ~DrawCall(); - static void run(const marl::Loan<DrawCall> &draw, marl::Ticket::Queue *tickets, marl::Ticket::Queue clusterQueues[MaxClusterCount]); - static void processVertices(DrawCall *draw, BatchData *batch); - static void processPrimitives(DrawCall *draw, BatchData *batch); - static void processPixels(const marl::Loan<DrawCall> &draw, const marl::Loan<BatchData> &batch, const std::shared_ptr<marl::Finally> &finally); + static void run(vk::Device *device, const marl::Loan<DrawCall> &draw, marl::Ticket::Queue *tickets, marl::Ticket::Queue clusterQueues[MaxClusterCount]); + static void processVertices(vk::Device *device, DrawCall *draw, BatchData *batch); + static void processPrimitives(vk::Device *device, DrawCall *draw, BatchData *batch); + static void processPixels(vk::Device *device, const marl::Loan<DrawCall> &draw, const marl::Loan<BatchData> &batch, const std::shared_ptr<marl::Finally> &finally); void setup(); - void teardown(); + void teardown(vk::Device *device); int id; @@ -169,7 +169,6 @@ SetupFunction setupPrimitives; SetupProcessor::State setupState; - vk::Device *device; vk::ImageView *colorBuffer[MAX_COLOR_BUFFERS]; vk::ImageView *depthBuffer; vk::ImageView *stencilBuffer; @@ -190,14 +189,14 @@ VkPrimitiveTopology topology, VkProvokingVertexModeEXT provokingVertexMode); - static int setupSolidTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); - static int setupWireframeTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); - static int setupPointTriangles(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); - static int setupLines(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); - static int setupPoints(Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + static int setupSolidTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + static int setupWireframeTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + static int setupPointTriangles(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + static int setupLines(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); + static int setupPoints(vk::Device *device, Triangle *triangles, Primitive *primitives, const DrawCall *drawCall, int count); - static bool setupLine(Primitive &primitive, Triangle &triangle, const DrawCall &draw); - static bool setupPoint(Primitive &primitive, Triangle &triangle, const DrawCall &draw); + static bool setupLine(vk::Device *device, Primitive &primitive, Triangle &triangle, const DrawCall &draw); + static bool setupPoint(vk::Device *device, Primitive &primitive, Triangle &triangle, const DrawCall &draw); }; class alignas(16) Renderer
diff --git a/src/Device/SetupProcessor.hpp b/src/Device/SetupProcessor.hpp index 8aeb216..2fdb632 100644 --- a/src/Device/SetupProcessor.hpp +++ b/src/Device/SetupProcessor.hpp
@@ -32,7 +32,7 @@ struct DrawCall; struct DrawData; -using SetupFunction = FunctionT<int(Primitive *primitive, const Triangle *triangle, const Polygon *polygon, const DrawData *draw)>; +using SetupFunction = FunctionT<int(const vk::Device *device, Primitive *primitive, const Triangle *triangle, const Polygon *polygon, const DrawData *draw)>; class SetupProcessor {
diff --git a/src/Device/VertexProcessor.hpp b/src/Device/VertexProcessor.hpp index f202434..e8f6b14 100644 --- a/src/Device/VertexProcessor.hpp +++ b/src/Device/VertexProcessor.hpp
@@ -51,7 +51,7 @@ VertexCache vertexCache; }; -using VertexRoutineFunction = FunctionT<void(Vertex *output, unsigned int *batch, VertexTask *vertextask, DrawData *draw)>; +using VertexRoutineFunction = FunctionT<void(const vk::Device *device, Vertex *output, unsigned int *batch, VertexTask *vertextask, DrawData *draw)>; class VertexProcessor {
diff --git a/src/Pipeline/ComputeProgram.cpp b/src/Pipeline/ComputeProgram.cpp index ad946d0..96e4ad8 100644 --- a/src/Pipeline/ComputeProgram.cpp +++ b/src/Pipeline/ComputeProgram.cpp
@@ -13,8 +13,8 @@ // limitations under the License. #include "ComputeProgram.hpp" -#include "Constants.hpp" +#include "Constants.hpp" #include "System/Debug.hpp" #include "Vulkan/VkPipelineLayout.hpp" @@ -171,14 +171,16 @@ void ComputeProgram::emit(SpirvRoutine *routine) { - Pointer<Byte> data = Arg<0>(); - Int workgroupX = Arg<1>(); - Int workgroupY = Arg<2>(); - Int workgroupZ = Arg<3>(); - Pointer<Byte> workgroupMemory = Arg<4>(); - Int firstSubgroup = Arg<5>(); - Int subgroupCount = Arg<6>(); + Pointer<Byte> device = Arg<0>(); + Pointer<Byte> data = Arg<1>(); + Int workgroupX = Arg<2>(); + Int workgroupY = Arg<3>(); + Int workgroupZ = Arg<4>(); + Pointer<Byte> workgroupMemory = Arg<5>(); + Int firstSubgroup = Arg<6>(); + Int subgroupCount = Arg<7>(); + routine->device = device; routine->descriptorSets = data + OFFSET(Data, descriptorSets); routine->descriptorDynamicOffsets = data + OFFSET(Data, descriptorDynamicOffsets); routine->pushConstants = data + OFFSET(Data, pushConstants); @@ -273,13 +275,13 @@ // together. for(int subgroupIndex = 0; subgroupIndex < subgroupsPerWorkgroup; subgroupIndex++) { - auto coroutine = (*this)(&data, groupX, groupY, groupZ, workgroupMemory.data(), subgroupIndex, 1); + auto coroutine = (*this)(device, &data, groupX, groupY, groupZ, workgroupMemory.data(), subgroupIndex, 1); coroutines.push(std::move(coroutine)); } } else { - auto coroutine = (*this)(&data, groupX, groupY, groupZ, workgroupMemory.data(), 0, subgroupsPerWorkgroup); + auto coroutine = (*this)(device, &data, groupX, groupY, groupZ, workgroupMemory.data(), 0, subgroupsPerWorkgroup); coroutines.push(std::move(coroutine)); }
diff --git a/src/Pipeline/ComputeProgram.hpp b/src/Pipeline/ComputeProgram.hpp index 79a0bcb..99b47bc 100644 --- a/src/Pipeline/ComputeProgram.hpp +++ b/src/Pipeline/ComputeProgram.hpp
@@ -37,6 +37,7 @@ // ComputeProgram builds a SPIR-V compute shader. class ComputeProgram : public Coroutine<SpirvShader::YieldResult( + const vk::Device *device, void *data, int32_t workgroupX, int32_t workgroupY,
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp index 1853b62..b8fc2f7 100644 --- a/src/Pipeline/PixelProgram.cpp +++ b/src/Pipeline/PixelProgram.cpp
@@ -137,6 +137,7 @@ void PixelProgram::executeShader(Int cMask[4], Int sMask[4], Int zMask[4], const SampleSet &samples) { + routine.device = device; routine.descriptorSets = data + OFFSET(DrawData, descriptorSets); routine.descriptorDynamicOffsets = data + OFFSET(DrawData, descriptorDynamicOffsets); routine.pushConstants = data + OFFSET(DrawData, pushConstants);
diff --git a/src/Pipeline/SetupRoutine.cpp b/src/Pipeline/SetupRoutine.cpp index f1711b1..64d1d65 100644 --- a/src/Pipeline/SetupRoutine.cpp +++ b/src/Pipeline/SetupRoutine.cpp
@@ -13,12 +13,12 @@ // limitations under the License. #include "SetupRoutine.hpp" -#include <Device/Vertex.hpp> #include "Constants.hpp" #include "Device/Polygon.hpp" #include "Device/Primitive.hpp" #include "Device/Renderer.hpp" +#include "Device/Vertex.hpp" #include "Reactor/Reactor.hpp" namespace sw { @@ -36,10 +36,11 @@ { SetupFunction function; { - Pointer<Byte> primitive(function.Arg<0>()); - Pointer<Byte> tri(function.Arg<1>()); - Pointer<Byte> polygon(function.Arg<2>()); - Pointer<Byte> data(function.Arg<3>()); + Pointer<Byte> device(function.Arg<0>()); + Pointer<Byte> primitive(function.Arg<1>()); + Pointer<Byte> tri(function.Arg<2>()); + Pointer<Byte> polygon(function.Arg<3>()); + Pointer<Byte> data(function.Arg<4>()); Pointer<Byte> constants = *Pointer<Pointer<Byte> >(data + OFFSET(DrawData, constants));
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp index e0f9a50..08c71a6 100644 --- a/src/Pipeline/SpirvShader.hpp +++ b/src/Pipeline/SpirvShader.hpp
@@ -1472,6 +1472,7 @@ Variable outputs = Variable{ MAX_INTERFACE_COMPONENTS }; InterpolationData interpolationData; + Pointer<Byte> device; Pointer<Byte> workgroupMemory; Pointer<Pointer<Byte>> descriptorSets; Pointer<Int> descriptorDynamicOffsets;
diff --git a/src/Pipeline/SpirvShaderImage.cpp b/src/Pipeline/SpirvShaderImage.cpp index 2b15ad1..1eddd25 100644 --- a/src/Pipeline/SpirvShaderImage.cpp +++ b/src/Pipeline/SpirvShaderImage.cpp
@@ -268,13 +268,12 @@ } auto &cache = state->routine->samplerCache.at(instruction.position); - auto cacheHit = (cache.imageDescriptor == imageDescriptor) && (cache.samplerId == samplerId); // TODO(b/205566405): Skip sampler ID check for samplerless instructions. + Bool cacheHit = (cache.imageDescriptor == imageDescriptor) && (cache.samplerId == samplerId); // TODO(b/205566405): Skip sampler ID check for samplerless instructions. If(!cacheHit) { rr::Int imageViewId = *Pointer<rr::Int>(imageDescriptor + OFFSET(vk::SampledImageDescriptor, imageViewId)); - Pointer<Byte> device = *Pointer<Pointer<Byte>>(imageDescriptor + OFFSET(vk::SampledImageDescriptor, device)); - cache.function = Call(getImageSampler, device, instruction.state, samplerId, imageViewId); + cache.function = Call(getImageSampler, state->routine->device, instruction.state, samplerId, imageViewId); cache.imageDescriptor = imageDescriptor; cache.samplerId = samplerId; }
diff --git a/src/Pipeline/VertexProgram.cpp b/src/Pipeline/VertexProgram.cpp index be9d916..1861380 100644 --- a/src/Pipeline/VertexProgram.cpp +++ b/src/Pipeline/VertexProgram.cpp
@@ -19,7 +19,6 @@ #include "Device/Vertex.hpp" #include "System/Debug.hpp" #include "System/Half.hpp" - #include "Vulkan/VkPipelineLayout.hpp" namespace sw { @@ -55,6 +54,7 @@ value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(SIMD::Width)); }); + routine.device = device; routine.descriptorSets = data + OFFSET(DrawData, descriptorSets); routine.descriptorDynamicOffsets = data + OFFSET(DrawData, descriptorDynamicOffsets); routine.pushConstants = data + OFFSET(DrawData, pushConstants);
diff --git a/src/Pipeline/VertexRoutine.hpp b/src/Pipeline/VertexRoutine.hpp index 8bf7c88..f68e3f2 100644 --- a/src/Pipeline/VertexRoutine.hpp +++ b/src/Pipeline/VertexRoutine.hpp
@@ -29,14 +29,16 @@ { public: VertexRoutinePrototype() - : vertex(Arg<0>()) - , batch(Arg<1>()) - , task(Arg<2>()) - , data(Arg<3>()) + : device(Arg<0>()) + , vertex(Arg<1>()) + , batch(Arg<2>()) + , task(Arg<3>()) + , data(Arg<4>()) {} virtual ~VertexRoutinePrototype() {} protected: + Pointer<Byte> device; Pointer<Byte> vertex; Pointer<UInt> batch; Pointer<Byte> task;
diff --git a/src/Vulkan/VkDescriptorSet.cpp b/src/Vulkan/VkDescriptorSet.cpp index 5c2af95..65f37ac 100644 --- a/src/Vulkan/VkDescriptorSet.cpp +++ b/src/Vulkan/VkDescriptorSet.cpp
@@ -13,6 +13,7 @@ // limitations under the License. #include "VkDescriptorSet.hpp" + #include "VkDevice.hpp" #include "VkImageView.hpp" #include "VkPipelineLayout.hpp"
diff --git a/src/Vulkan/VkDescriptorSetLayout.cpp b/src/Vulkan/VkDescriptorSetLayout.cpp index f839d6b..737cffc 100644 --- a/src/Vulkan/VkDescriptorSetLayout.cpp +++ b/src/Vulkan/VkDescriptorSetLayout.cpp
@@ -302,7 +302,6 @@ { sampledImage[i].samplerId = vk::Cast(update->sampler)->id; } - sampledImage[i].device = device; } } else if(entry.descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) @@ -326,7 +325,6 @@ sampledImage[i].texture.width = sw::float4(static_cast<float>(numElements)); sampledImage[i].texture.height = sw::float4(1); sampledImage[i].texture.depth = sw::float4(1); - sampledImage[i].device = device; sw::Mipmap &mipmap = sampledImage[i].texture.mipmap[0]; mipmap.buffer = bufferView->getPointer(); @@ -371,7 +369,6 @@ sampledImage[i].depth = imageView->getDepthOrLayerCount(0); sampledImage[i].mipLevels = imageView->getSubresourceRange().levelCount; sampledImage[i].sampleCount = imageView->getSampleCount(); - sampledImage[i].device = device; sampledImage[i].memoryOwner = imageView; auto &subresourceRange = imageView->getSubresourceRange();
diff --git a/src/Vulkan/VkDescriptorSetLayout.hpp b/src/Vulkan/VkDescriptorSetLayout.hpp index 3489d2e..1865d78 100644 --- a/src/Vulkan/VkDescriptorSetLayout.hpp +++ b/src/Vulkan/VkDescriptorSetLayout.hpp
@@ -43,7 +43,6 @@ int mipLevels; int sampleCount; - Device *device; ImageView *memoryOwner; // Pointer to the view which owns the memory used by the descriptor set };