Choice of tests is slightly odd -- but there are a number of tests in
this group which *don't* use the derivative instructions (glslang is
smart enough to not emit them when the expression is known to be uniform).
Bug: b/
126330097
Test: dEQP-VK.glsl.derivate.*
Test: dEQP-VK.ubo.*
Change-Id: I8864149104f2ea9b62c75ceae59da4ff8adebc32
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26548
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
void Context::init()
{
+ for(int i = 0; i < vk::MAX_BOUND_DESCRIPTOR_SETS; i++)
+ {
+ descriptorSets[i] = nullptr;
+ }
+
// Set vertex streams to null stream
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
#include "Vertex.hpp"
#include "System/Types.hpp"
+#include <Vulkan/VkConfig.h>
+
namespace vk
{
+ class DescriptorSet;
class ImageView;
class PipelineLayout;
} // namespace vk
int colorWriteActive(int index);
bool colorUsed();
+ vk::DescriptorSet *descriptorSets[vk::MAX_BOUND_DESCRIPTOR_SETS];
Stream input[MAX_VERTEX_INPUTS];
void *indexBuffer;
QuadRasterizer(const PixelProcessor::State &state, SpirvShader const *spirvShader);
virtual ~QuadRasterizer();
- void generate();
+ virtual void generate();
protected:
Pointer<Byte> constants;
draw->setupPrimitives = setupPrimitives;
draw->setupState = setupState;
+ for(int i = 0; i < vk::MAX_BOUND_DESCRIPTOR_SETS; i++)
+ {
+ data->descriptorSets[i] = context->descriptorSets[i];
+ }
+
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
data->input[i] = context->input[i].buffer;
#include <list>
+namespace vk
+{
+ class DescriptorSet;
+}
+
namespace sw
{
class Clipper;
{
const Constants *constants;
+ vk::DescriptorSet *descriptorSets[vk::MAX_BOUND_DESCRIPTOR_SETS];
+
const void *input[MAX_VERTEX_INPUTS];
unsigned int stride[MAX_VERTEX_INPUTS];
Texture mipmap[TOTAL_IMAGE_UNITS];
int (*XShmPutImage)(Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height, bool send_event);
};
-#undef Bool
+#undef Bool // b/127920555
class LibX11
{
#include "Device/QuadRasterizer.hpp"
#include "Device/Primitive.hpp"
#include "Vulkan/VkDebug.hpp"
+#include "Vulkan/VkPipelineLayout.hpp"
+
+#ifdef Bool
+#undef Bool // b/127920555
+#endif
namespace sw
{
{
}
+ void PixelRoutine::generate()
+ {
+ Pointer<Pointer<Byte>> descriptorSets = Pointer<Pointer<Byte>>(data + OFFSET(DrawData, descriptorSets));
+ auto numDescriptorSets = routine.pipelineLayout->getNumDescriptorSets();
+ for(unsigned int i = 0; i < numDescriptorSets; i++)
+ {
+ routine.descriptorSets[i] = descriptorSets[i];
+ }
+
+ QuadRasterizer::generate();
+ }
+
void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBuffer, Pointer<Byte> &sBuffer, Int cMask[4], Int &x, Int &y)
{
#if PERF_PROFILE
virtual ~PixelRoutine();
+ void generate() override;
+
protected:
Float4 z[4]; // Multisampled z
Float4 w; // Used as is
#include "System/Half.hpp"
#include "Vulkan/VkDebug.hpp"
+#include "Vulkan/VkPipelineLayout.hpp"
+
namespace sw
{
VertexProgram::VertexProgram(
}
routine.pushConstants = data + OFFSET(DrawData, pushConstants);
+
+ Pointer<Pointer<Byte>> descriptorSets = Pointer<Pointer<Byte>>(data + OFFSET(DrawData, descriptorSets));
+ auto numDescriptorSets = routine.pipelineLayout->getNumDescriptorSets();
+ for(unsigned int i = 0; i < numDescriptorSets; i++)
+ {
+ routine.descriptorSets[i] = descriptorSets[i];
+ }
}
VertexProgram::~VertexProgram()
#include <string>
-#undef Bool
+#undef Bool // b/127920555
#if !defined(NDEBUG) && (REACTOR_LLVM_VERSION >= 7)
#define ENABLE_RR_PRINT 1 // Enables RR_PRINT(), RR_WATCH()
sw::Context context = pipeline->getContext();
executionState.bindVertexInputs(context, firstVertex);
+ const auto& boundDescriptorSets = executionState.boundDescriptorSets[VK_PIPELINE_BIND_POINT_GRAPHICS];
+ for(int i = 0; i < vk::MAX_BOUND_DESCRIPTOR_SETS; i++)
+ {
+ context.descriptorSets[i] = reinterpret_cast<vk::DescriptorSet*>(boundDescriptorSets[i]);
+ }
+
context.pushConstants = executionState.pushConstants;
executionState.renderer->setContext(context);
sw::Context context = pipeline->getContext();
executionState.bindVertexInputs(context, vertexOffset);
+ const auto& boundDescriptorSets = executionState.boundDescriptorSets[VK_PIPELINE_BIND_POINT_GRAPHICS];
+ for(int i = 0; i < vk::MAX_BOUND_DESCRIPTOR_SETS; i++)
+ {
+ context.descriptorSets[i] = reinterpret_cast<vk::DescriptorSet*>(boundDescriptorSets[i]);
+ }
+
context.pushConstants = executionState.pushConstants;
context.indexBuffer = Cast(executionState.indexBufferBinding.buffer)->getOffsetPointer(
int (*XShmPutImage)(Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height, bool send_event);
};
-#undef Bool
+#undef Bool // b/127920555
class LibX11
{