svga: don't copy blit_info into local var
[mesa.git] / src / gallium / drivers / svga / svga_cmd_vgpu10.c
index 4cd9d5b9d1e2da2efb8b5f64df59840559009fb5..2729655ef47bde9313f88065e9221d97574227ed 100644 (file)
@@ -1112,7 +1112,7 @@ SVGA3D_vgpu10_DefineStreamOutput(struct svga_winsys_context *swc,
    cmd->soid = soid;
    cmd->numOutputStreamEntries = numOutputStreamEntries;
 
-   for (i = 0; i < Elements(cmd->streamOutputStrideInBytes); i++)
+   for (i = 0; i < ARRAY_SIZE(cmd->streamOutputStrideInBytes); i++)
       cmd->streamOutputStrideInBytes[i] = streamOutputStrideInBytes[i];
 
    memcpy(cmd->decl, decl,
@@ -1293,3 +1293,24 @@ SVGA3D_vgpu10_UpdateSubResource(struct svga_winsys_context *swc,
    swc->commit(swc);
    return PIPE_OK;
 }
+
+enum pipe_error
+SVGA3D_vgpu10_GenMips(struct svga_winsys_context *swc,
+                      SVGA3dShaderResourceViewId shaderResourceViewId,
+                      struct svga_winsys_surface *view)
+{
+   SVGA3dCmdDXGenMips *cmd;
+
+   cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_DX_GENMIPS,
+                            sizeof(SVGA3dCmdDXGenMips), 1);
+
+   if (!cmd)
+      return PIPE_ERROR_OUT_OF_MEMORY;
+
+   swc->surface_relocation(swc, &cmd->shaderResourceViewId, NULL, view,
+                           SVGA_RELOC_WRITE);
+   cmd->shaderResourceViewId = shaderResourceViewId;
+
+   swc->commit(swc);
+   return PIPE_OK;
+}