svga: Performance fixes
[mesa.git] / src / gallium / drivers / svga / svga_cmd_vgpu10.c
index eb5a482d9ba0360ed0e304138785d6b6c2e365e7..30e174a754affe14ad7b51e1d8271de670ee7695 100644 (file)
@@ -1264,6 +1264,31 @@ SVGA3D_vgpu10_SetSingleConstantBuffer(struct svga_winsys_context *swc,
 }
 
 
+enum pipe_error
+SVGA3D_vgpu10_SetConstantBufferOffset(struct svga_winsys_context *swc,
+                                      unsigned command,
+                                      unsigned slot,
+                                      uint32 offsetInBytes)
+{
+   SVGA3dCmdDXSetConstantBufferOffset *cmd;
+
+   assert(offsetInBytes % 256 == 0);
+
+   cmd = SVGA3D_FIFOReserve(swc, command,
+                            sizeof(SVGA3dCmdDXSetConstantBufferOffset),
+                            0);  /* one relocation */
+   if (!cmd)
+      return PIPE_ERROR_OUT_OF_MEMORY;
+
+   cmd->slot = slot;
+   cmd->offsetInBytes = offsetInBytes;
+
+   swc->commit(swc);
+
+   return PIPE_OK;
+}
+
+
 enum pipe_error
 SVGA3D_vgpu10_ReadbackSubResource(struct svga_winsys_context *swc,
                                   struct svga_winsys_surface *surface,