|
|
|
@ -296,16 +296,20 @@ int virgl_encoder_set_framebuffer_state(struct virgl_context *ctx, |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int virgl_encoder_set_viewport_state(struct virgl_context *ctx, |
|
|
|
|
const struct pipe_viewport_state *state) |
|
|
|
|
int virgl_encoder_set_viewport_states(struct virgl_context *ctx, |
|
|
|
|
int start_slot, |
|
|
|
|
int num_viewports, |
|
|
|
|
const struct pipe_viewport_state *states) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_SET_VIEWPORT_STATE, 0, VIRGL_SET_VIEWPORT_STATE_SIZE(1))); |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, 0); |
|
|
|
|
for (i = 0; i < 3; i++) |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, fui(state->scale[i])); |
|
|
|
|
for (i = 0; i < 3; i++) |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, fui(state->translate[i])); |
|
|
|
|
int i,v; |
|
|
|
|
virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_SET_VIEWPORT_STATE, 0, VIRGL_SET_VIEWPORT_STATE_SIZE(num_viewports))); |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, start_slot); |
|
|
|
|
for (v = 0; v < num_viewports; v++) { |
|
|
|
|
for (i = 0; i < 3; i++) |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, fui(states[v].scale[i])); |
|
|
|
|
for (i = 0; i < 3; i++) |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, fui(states[v].translate[i])); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -664,16 +668,16 @@ int virgl_encoder_set_blend_color(struct virgl_context *ctx, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int virgl_encoder_set_scissor_state(struct virgl_context *ctx, |
|
|
|
|
int start_slot, |
|
|
|
|
int num_scissors, |
|
|
|
|
const struct pipe_scissor_state *ss) |
|
|
|
|
unsigned start_slot, |
|
|
|
|
int num_scissors, |
|
|
|
|
const struct pipe_scissor_state *ss) |
|
|
|
|
{ |
|
|
|
|
int s; |
|
|
|
|
int i; |
|
|
|
|
virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_SET_SCISSOR_STATE, 0, VIRGL_SET_SCISSOR_STATE_SIZE(num_scissors))); |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, start_slot); |
|
|
|
|
for (s = 0; s < num_scissors; s++) { |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, (ss[s].minx | ss[s].miny << 16)); |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, (ss[s].maxx | ss[s].maxy << 16)); |
|
|
|
|
for (i = 0; i < num_scissors; i++) { |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, (ss[i].minx | ss[i].miny << 16)); |
|
|
|
|
virgl_encoder_write_dword(ctx->cbuf, (ss[i].maxx | ss[i].maxy << 16)); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|