summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_virgl_cmd.c9
-rw-r--r--tests/testvirgl_encode.c12
-rw-r--r--tests/testvirgl_encode.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_virgl_cmd.c b/tests/test_virgl_cmd.c
index 3c2fd24..4c8d689 100644
--- a/tests/test_virgl_cmd.c
+++ b/tests/test_virgl_cmd.c
@@ -372,6 +372,15 @@ START_TEST(virgl_test_render_simple)
virgl_encode_bind_shader(&ctx, fs_handle, PIPE_SHADER_FRAGMENT);
}
+ /* link shader */
+ {
+ uint32_t handles[PIPE_SHADER_TYPES];
+ memset(handles, 0, sizeof(handles));
+ handles[PIPE_SHADER_VERTEX] = vs_handle;
+ handles[PIPE_SHADER_FRAGMENT] = fs_handle;
+ virgl_encode_link_shader(&ctx, handles);
+ }
+
/* set blend state */
{
struct pipe_blend_state blend;
diff --git a/tests/testvirgl_encode.c b/tests/testvirgl_encode.c
index f44a640..38ad5e1 100644
--- a/tests/testvirgl_encode.c
+++ b/tests/testvirgl_encode.c
@@ -942,6 +942,18 @@ int virgl_encoder_destroy_sub_ctx(struct virgl_context *ctx, uint32_t sub_ctx_id
return 0;
}
+int virgl_encode_link_shader(struct virgl_context *ctx, uint32_t *handles)
+{
+ virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_LINK_SHADER, 0, VIRGL_LINK_SHADER_SIZE));
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_VERTEX]);
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_FRAGMENT]);
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_GEOMETRY]);
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_TESS_CTRL]);
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_TESS_EVAL]);
+ virgl_encoder_write_dword(ctx->cbuf, handles[PIPE_SHADER_COMPUTE]);
+ return 0;
+}
+
int virgl_encode_bind_shader(struct virgl_context *ctx,
uint32_t handle, uint32_t type)
{
diff --git a/tests/testvirgl_encode.h b/tests/testvirgl_encode.h
index c5bd9c1..cd1ab2b 100644
--- a/tests/testvirgl_encode.h
+++ b/tests/testvirgl_encode.h
@@ -258,6 +258,7 @@ int virgl_encoder_render_condition(struct virgl_context *ctx,
int virgl_encoder_set_sub_ctx(struct virgl_context *ctx, uint32_t sub_ctx_id);
int virgl_encoder_create_sub_ctx(struct virgl_context *ctx, uint32_t sub_ctx_id);
int virgl_encoder_destroy_sub_ctx(struct virgl_context *ctx, uint32_t sub_ctx_id);
+int virgl_encode_link_shader(struct virgl_context *ctx, uint32_t *handles);
int virgl_encode_bind_shader(struct virgl_context *ctx,
uint32_t handle, uint32_t type);
#endif