* to have allocated the fifo space before converting.
*
* Results:
- * id is filld out.
+ * id is filled out.
*
* Side effects:
- * One surface relocation is preformed for texture handle.
+ * One surface relocation is performed for texture handle.
*
*----------------------------------------------------------------------
*/
* containers for host VRAM objects like textures, vertex
* buffers, and depth/stencil buffers.
*
- * Surfaces are hierarchial:
+ * Surfaces are hierarchical:
*
* - Surface may have multiple faces (for cube maps)
*
/*
*----------------------------------------------------------------------
*
- * SVGA3D_BeginSurfaceDMA--
+ * SVGA3D_SurfaceDMA--
*
- * Begin a SURFACE_DMA command. This reserves space for it in
- * the FIFO, and returns a pointer to the command's box array.
- * This function must be paired with SVGA_FIFOCommitAll().
+ * Emit a SURFACE_DMA command.
*
* When the SVGA3D device asynchronously processes this FIFO
* command, a DMA operation is performed between host VRAM and
struct svga_transfer *st, // IN
SVGA3dTransferType transfer, // IN
const SVGA3dCopyBox *boxes, // IN
- uint32 numBoxes) // IN
+ uint32 numBoxes, // IN
+ SVGA3dSurfaceDMAFlags flags) // IN
{
struct svga_texture *texture = svga_texture(st->base.resource);
SVGA3dCmdSurfaceDMA *cmd;
cmd->guest.pitch = st->base.stride;
swc->surface_relocation(swc, &cmd->host.sid, texture->handle, surface_flags);
- cmd->host.face = st->base.sr.face; /* PIPE_TEX_FACE_* and SVGA3D_CUBEFACE_* match */
- cmd->host.mipmap = st->base.sr.level;
+ cmd->host.face = st->face; /* PIPE_TEX_FACE_* and SVGA3D_CUBEFACE_* match */
+ cmd->host.mipmap = st->base.level;
cmd->transfer = transfer;
pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + boxesSize);
pSuffix->suffixSize = sizeof *pSuffix;
pSuffix->maximumOffset = st->hw_nblocksy*st->base.stride;
- memset(&pSuffix->flags, 0, sizeof pSuffix->flags);
+ pSuffix->flags = flags;
swc->commit(swc);
}
+/*
+ *----------------------------------------------------------------------
+ *
+ * SVGA3D_SetShaderConsts --
+ *
+ * Set the value of successive shader constants.
+ *
+ * Shader constants are analogous to uniform variables in GLSL,
+ * except that they belong to the render context rather than to
+ * an individual shader.
+ *
+ * Constants may have one of three types: A 4-vector of floats,
+ * a 4-vector of integers, or a single boolean flag.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+enum pipe_error
+SVGA3D_SetShaderConsts(struct svga_winsys_context *swc,
+ uint32 reg, // IN
+ uint32 numRegs, // IN
+ SVGA3dShaderType type, // IN
+ SVGA3dShaderConstType ctype, // IN
+ const void *values) // IN
+{
+ SVGA3dCmdSetShaderConst *cmd;
+
+ cmd = SVGA3D_FIFOReserve(swc,
+ SVGA_3D_CMD_SET_SHADER_CONST,
+ sizeof *cmd + (numRegs - 1) * sizeof cmd->values,
+ 0);
+ if(!cmd)
+ return PIPE_ERROR_OUT_OF_MEMORY;
+
+ cmd->cid = swc->cid;
+ cmd->reg = reg;
+ cmd->type = type;
+ cmd->ctype = ctype;
+
+ memcpy(&cmd->values, values, numRegs * sizeof cmd->values);
+
+ swc->commit(swc);
+
+ return PIPE_OK;
+}
+
+
*----------------------------------------------------------------------
*/
-enum pipe_error SVGA3D_SetClipPlane(struct svga_winsys_context *swc,
- uint32 index, const float *plane)
+enum pipe_error
+SVGA3D_SetClipPlane(struct svga_winsys_context *swc,
+ uint32 index, const float *plane)
{
SVGA3dCmdSetClipPlane *cmd;