summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga/svga_cmd.c')
-rw-r--r--src/gallium/drivers/svga/svga_cmd.c154
1 files changed, 12 insertions, 142 deletions
diff --git a/src/gallium/drivers/svga/svga_cmd.c b/src/gallium/drivers/svga/svga_cmd.c
index b271832171d..d3cf52f08e2 100644
--- a/src/gallium/drivers/svga/svga_cmd.c
+++ b/src/gallium/drivers/svga/svga_cmd.c
@@ -66,7 +66,7 @@ surface_to_surfaceid(struct svga_winsys_context *swc, // IN
if (surface) {
struct svga_surface *s = svga_surface(surface);
swc->surface_relocation(swc, &id->sid, NULL, s->handle, flags);
- id->face = s->real_face; /* faces have the same order */
+ id->face = s->real_layer; /* faces have the same order */
id->mipmap = s->real_level;
}
else {
@@ -460,7 +460,7 @@ SVGA3D_SurfaceDMA(struct svga_winsys_context *swc,
swc->surface_relocation(swc, &cmd->host.sid, NULL,
texture->handle, surface_flags);
- cmd->host.face = st->face; /* PIPE_TEX_FACE_* and SVGA3D_CUBEFACE_* match */
+ cmd->host.face = st->slice; /* PIPE_TEX_FACE_* and SVGA3D_CUBEFACE_* match */
cmd->host.mipmap = st->base.level;
cmd->transfer = transfer;
@@ -842,6 +842,8 @@ SVGA3D_SetShader(struct svga_winsys_context *swc,
{
SVGA3dCmdSetShader *cmd;
+ assert(type == SVGA3D_SHADERTYPE_VS || type == SVGA3D_SHADERTYPE_PS);
+
cmd = SVGA3D_FIFOReserve(swc,
SVGA_3D_CMD_SET_SHADER, sizeof *cmd,
0);
@@ -1385,7 +1387,7 @@ SVGA3D_BeginGBQuery(struct svga_winsys_context *swc,
if(!cmd)
return PIPE_ERROR_OUT_OF_MEMORY;
- swc->context_relocation(swc, &cmd->cid);
+ cmd->cid = swc->cid;
cmd->type = type;
swc->commit(swc);
@@ -1465,7 +1467,7 @@ SVGA3D_EndGBQuery(struct svga_winsys_context *swc,
if(!cmd)
return PIPE_ERROR_OUT_OF_MEMORY;
- swc->context_relocation(swc, &cmd->cid);
+ cmd->cid = swc->cid;
cmd->type = type;
swc->mob_relocation(swc, &cmd->mobid, &cmd->offset, buffer,
@@ -1552,7 +1554,7 @@ SVGA3D_WaitForGBQuery(struct svga_winsys_context *swc,
if(!cmd)
return PIPE_ERROR_OUT_OF_MEMORY;
- swc->context_relocation(swc, &cmd->cid);
+ cmd->cid = swc->cid;
cmd->type = type;
swc->mob_relocation(swc, &cmd->mobid, &cmd->offset, buffer,
@@ -1615,36 +1617,6 @@ SVGA3D_WaitForQuery(struct svga_winsys_context *swc,
enum pipe_error
-SVGA3D_DefineGBShader(struct svga_winsys_context *swc,
- struct svga_winsys_gb_shader *gbshader,
- SVGA3dShaderType type,
- uint32 sizeInBytes)
-{
- SVGA3dCmdDefineGBShader *cmd;
-
- assert(sizeInBytes % 4 == 0);
- assert(type == SVGA3D_SHADERTYPE_VS ||
- type == SVGA3D_SHADERTYPE_PS);
-
- cmd = SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_DEFINE_GB_SHADER,
- sizeof *cmd,
- 1); /* one relocation */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->shader_relocation(swc, &cmd->shid, NULL, NULL, gbshader);
- cmd->type = type;
- cmd->sizeInBytes = sizeInBytes;
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
-enum pipe_error
SVGA3D_BindGBShader(struct svga_winsys_context *swc,
struct svga_winsys_gb_shader *gbshader)
{
@@ -1658,7 +1630,7 @@ SVGA3D_BindGBShader(struct svga_winsys_context *swc,
return PIPE_ERROR_OUT_OF_MEMORY;
swc->shader_relocation(swc, &cmd->shid, &cmd->mobid,
- &cmd->offsetInBytes, gbshader);
+ &cmd->offsetInBytes, gbshader, 0);
swc->commit(swc);
@@ -1672,6 +1644,8 @@ SVGA3D_SetGBShader(struct svga_winsys_context *swc,
struct svga_winsys_gb_shader *gbshader)
{
SVGA3dCmdSetShader *cmd;
+
+ assert(type == SVGA3D_SHADERTYPE_VS || type == SVGA3D_SHADERTYPE_PS);
cmd = SVGA3D_FIFOReserve(swc,
SVGA_3D_CMD_SET_SHADER,
@@ -1680,10 +1654,10 @@ SVGA3D_SetGBShader(struct svga_winsys_context *swc,
if (!cmd)
return PIPE_ERROR_OUT_OF_MEMORY;
- swc->context_relocation(swc, &cmd->cid);
+ cmd->cid = swc->cid;
cmd->type = type;
if (gbshader)
- swc->shader_relocation(swc, &cmd->shid, NULL, NULL, gbshader);
+ swc->shader_relocation(swc, &cmd->shid, NULL, NULL, gbshader, 0);
else
cmd->shid = SVGA_ID_INVALID;
swc->commit(swc);
@@ -1692,27 +1666,6 @@ SVGA3D_SetGBShader(struct svga_winsys_context *swc,
}
-enum pipe_error
-SVGA3D_DestroyGBShader(struct svga_winsys_context *swc,
- struct svga_winsys_gb_shader *gbshader)
-{
- SVGA3dCmdDestroyGBShader *cmd =
- SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_DESTROY_GB_SHADER,
- sizeof *cmd,
- 1); /* one relocation */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->shader_relocation(swc, &cmd->shid, NULL, NULL, gbshader);
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
/**
* \param flags mask of SVGA_RELOC_READ / _WRITE
*/
@@ -1738,89 +1691,6 @@ SVGA3D_BindGBSurface(struct svga_winsys_context *swc,
}
-enum pipe_error
-SVGA3D_DefineGBContext(struct svga_winsys_context *swc)
-{
- SVGA3dCmdDefineGBContext *cmd =
- SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_DEFINE_GB_CONTEXT,
- sizeof *cmd,
- 1); /* one relocation */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->context_relocation(swc, &cmd->cid);
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
-enum pipe_error
-SVGA3D_DestroyGBContext(struct svga_winsys_context *swc)
-{
- SVGA3dCmdDestroyGBContext *cmd =
- SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_DESTROY_GB_CONTEXT,
- sizeof *cmd,
- 1); /* one relocation */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->context_relocation(swc, &cmd->cid);
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
-enum pipe_error
-SVGA3D_BindGBContext(struct svga_winsys_context *swc)
-{
- SVGA3dCmdBindGBContext *cmd =
- SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_BIND_GB_CONTEXT,
- sizeof *cmd,
- 2); /* two relocations */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->context_relocation(swc, &cmd->cid);
- swc->context_relocation(swc, &cmd->mobid);
- cmd->validContents = 0; /* XXX pass as a parameter? */
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
-enum pipe_error
-SVGA3D_InvalidateGBContext(struct svga_winsys_context *swc)
-{
- SVGA3dCmdInvalidateGBContext *cmd =
- SVGA3D_FIFOReserve(swc,
- SVGA_3D_CMD_INVALIDATE_GB_CONTEXT,
- sizeof *cmd,
- 1); /* one relocation */
-
- if (!cmd)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- swc->context_relocation(swc, &cmd->cid);
-
- swc->commit(swc);
-
- return PIPE_OK;
-}
-
-
-
/**
* Update an image in a guest-backed surface.
* (Inform the device that the guest-contents have been updated.)