Remove remnants of non-descriptor UBO support

All vulkan resource access will be through descriptors. We don't need
any of this context-side state.

Bug: b/125909515
Change-Id: Id6d1da0f8a851e057dd3a16fc844b6a70cf9b935
Reviewed-on: https://swiftshader-review.googlesource.com/c/25330
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Device/PixelProcessor.cpp b/src/Device/PixelProcessor.cpp
index 1996bb6..30a4125 100644
--- a/src/Device/PixelProcessor.cpp
+++ b/src/Device/PixelProcessor.cpp
@@ -58,12 +58,6 @@
 		return memcmp(static_cast<const States*>(this), static_cast<const States*>(&state), sizeof(States)) == 0;
 	}
 
-	PixelProcessor::UniformBufferInfo::UniformBufferInfo()
-	{
-		buffer = nullptr;
-		offset = 0;
-	}
-
 	PixelProcessor::PixelProcessor(Context *context) : context(context)
 	{
 		routineCache = nullptr;
@@ -76,21 +70,6 @@
 		routineCache = nullptr;
 	}
 
-	void PixelProcessor::setUniformBuffer(int index, sw::Resource* buffer, int offset)
-	{
-		uniformBufferInfo[index].buffer = buffer;
-		uniformBufferInfo[index].offset = offset;
-	}
-
-	void PixelProcessor::lockUniformBuffers(byte** u, sw::Resource* uniformBuffers[])
-	{
-		for(int i = 0; i < MAX_UNIFORM_BUFFER_BINDINGS; ++i)
-		{
-			u[i] = uniformBufferInfo[i].buffer ? static_cast<byte*>(uniformBufferInfo[i].buffer->lock(PUBLIC, PRIVATE)) + uniformBufferInfo[i].offset : nullptr;
-			uniformBuffers[i] = uniformBufferInfo[i].buffer;
-		}
-	}
-
 	void PixelProcessor::setRenderTarget(int index, Surface *renderTarget, unsigned int layer)
 	{
 		context->renderTarget[index] = renderTarget;
diff --git a/src/Device/PixelProcessor.hpp b/src/Device/PixelProcessor.hpp
index e51fa18..7b37266 100644
--- a/src/Device/PixelProcessor.hpp
+++ b/src/Device/PixelProcessor.hpp
@@ -145,13 +145,6 @@
 
 		virtual ~PixelProcessor();
 
-		void setFloatConstant(unsigned int index, const float value[4]);
-		void setIntegerConstant(unsigned int index, const int value[4]);
-		void setBooleanConstant(unsigned int index, int boolean);
-
-		void setUniformBuffer(int index, sw::Resource* buffer, int offset);
-		void lockUniformBuffers(byte** u, sw::Resource* uniformBuffers[]);
-
 		void setRenderTarget(int index, Surface *renderTarget, unsigned int layer = 0);
 		Surface *getRenderTarget(int index);
 		void setDepthBuffer(Surface *depthBuffer, unsigned int layer = 0);
@@ -238,15 +231,6 @@
 		Factor factor;
 
 	private:
-		struct UniformBufferInfo
-		{
-			UniformBufferInfo();
-
-			Resource* buffer;
-			int offset;
-		};
-		UniformBufferInfo uniformBufferInfo[MAX_UNIFORM_BUFFER_BINDINGS];
-
 		Context *const context;
 
 		RoutineCache<State> *routineCache;
diff --git a/src/Device/Renderer.cpp b/src/Device/Renderer.cpp
index d9411b7..13e62a8 100644
--- a/src/Device/Renderer.cpp
+++ b/src/Device/Renderer.cpp
@@ -346,18 +346,6 @@
 			}
 		}
 
-		if(context->pixelShader)
-		{
-			PixelProcessor::lockUniformBuffers(data->ps.u, draw->pUniformBuffers);
-		}
-		else
-		{
-			for(int i = 0; i < MAX_UNIFORM_BUFFER_BINDINGS; i++)
-			{
-				draw->pUniformBuffers[i] = nullptr;
-			}
-		}
-
 		for(int sampler = 0; sampler < VERTEX_TEXTURE_IMAGE_UNITS; sampler++)
 		{
 			if(vertexState.sampler[sampler].textureType != TEXTURE_NULL)
@@ -374,8 +362,6 @@
 			data->instanceID = context->instanceID;
 		}
 
-		VertexProcessor::lockUniformBuffers(data->vs.u, draw->vUniformBuffers);
-
 		if(pixelState.stencilActive)
 		{
 			data->stencil[0] = stencil;
@@ -895,18 +881,6 @@
 					draw.indexBuffer->unlock();
 				}
 
-				for(int i = 0; i < MAX_UNIFORM_BUFFER_BINDINGS; i++)
-				{
-					if(draw.pUniformBuffers[i])
-					{
-						draw.pUniformBuffers[i]->unlock();
-					}
-					if(draw.vUniformBuffers[i])
-					{
-						draw.vUniformBuffers[i]->unlock();
-					}
-				}
-
 				draw.vertexRoutine->unbind();
 				draw.setupRoutine->unbind();
 				draw.pixelRoutine->unbind();
diff --git a/src/Device/Renderer.hpp b/src/Device/Renderer.hpp
index 0e552a9..4724086 100644
--- a/src/Device/Renderer.hpp
+++ b/src/Device/Renderer.hpp
@@ -432,8 +432,6 @@
 		Surface *depthBuffer;
 		Surface *stencilBuffer;
 		Resource *texture[TOTAL_IMAGE_UNITS];
-		Resource* pUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS];
-		Resource* vUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS];
 
 		std::list<Query*> *queries;
 
diff --git a/src/Device/VertexProcessor.cpp b/src/Device/VertexProcessor.cpp
index 00af07b..4c2d441 100644
--- a/src/Device/VertexProcessor.cpp
+++ b/src/Device/VertexProcessor.cpp
@@ -61,12 +61,6 @@
 		return memcmp(static_cast<const States*>(this), static_cast<const States*>(&state), sizeof(States)) == 0;
 	}
 
-	VertexProcessor::UniformBufferInfo::UniformBufferInfo()
-	{
-		buffer = nullptr;
-		offset = 0;
-	}
-
 	VertexProcessor::VertexProcessor(Context *context) : context(context)
 	{
 		routineCache = nullptr;
@@ -92,21 +86,6 @@
 		}
 	}
 
-	void VertexProcessor::setUniformBuffer(int index, sw::Resource* buffer, int offset)
-	{
-		uniformBufferInfo[index].buffer = buffer;
-		uniformBufferInfo[index].offset = offset;
-	}
-
-	void VertexProcessor::lockUniformBuffers(byte** u, sw::Resource* uniformBuffers[])
-	{
-		for(int i = 0; i < MAX_UNIFORM_BUFFER_BINDINGS; ++i)
-		{
-			u[i] = uniformBufferInfo[i].buffer ? static_cast<byte*>(uniformBufferInfo[i].buffer->lock(PUBLIC, PRIVATE)) + uniformBufferInfo[i].offset : nullptr;
-			uniformBuffers[i] = uniformBufferInfo[i].buffer;
-		}
-	}
-
 	void VertexProcessor::setInstanceID(int instanceID)
 	{
 		context->instanceID = instanceID;
diff --git a/src/Device/VertexProcessor.hpp b/src/Device/VertexProcessor.hpp
index ba51325..f2dfc3d 100644
--- a/src/Device/VertexProcessor.hpp
+++ b/src/Device/VertexProcessor.hpp
@@ -91,9 +91,6 @@
 		void setInputStream(int index, const Stream &stream);
 		void resetInputStreams();
 
-		void setUniformBuffer(int index, sw::Resource* uniformBuffer, int offset);
-		void lockUniformBuffers(byte** u, sw::Resource* uniformBuffers[]);
-
 		void setInstanceID(int instanceID);
 
 		void setTextureFilter(unsigned int sampler, FilterType textureFilter);
@@ -130,15 +127,6 @@
 		float pointSizeMax;
 
 	private:
-		struct UniformBufferInfo
-		{
-			UniformBufferInfo();
-
-			Resource* buffer;
-			int offset;
-		};
-		UniformBufferInfo uniformBufferInfo[MAX_UNIFORM_BUFFER_BINDINGS];
-
 		Context *const context;
 
 		RoutineCache<State> *routineCache;