summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-10-23 14:35:46 +1000
committerDave Airlie <airlied@redhat.com>2015-10-23 14:35:46 +1000
commit85602b31bd16ea2e403ac2c39702b25ec84bb063 (patch)
treecfb8c4ffc2da397ea001c57ddd1bc61a56269776 /tests
parent5bfba519086c58ade8128e4976594a8d1c77dde0 (diff)
renderer: fix regression in shader binding
made a mistake in the shader binding code, not good, time for brown paper bag.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_virgl_cmd.c17
-rw-r--r--tests/testvirgl_encode.c9
-rw-r--r--tests/testvirgl_encode.h2
3 files changed, 19 insertions, 9 deletions
diff --git a/tests/test_virgl_cmd.c b/tests/test_virgl_cmd.c
index 525cef3..c91d70a 100644
--- a/tests/test_virgl_cmd.c
+++ b/tests/test_virgl_cmd.c
@@ -346,7 +346,7 @@ START_TEST(virgl_test_render_simple)
vs_handle = ctx_handle++;
virgl_encode_shader_state(&ctx, vs_handle, PIPE_SHADER_VERTEX,
&vs, text);
- virgl_encode_bind_object(&ctx, vs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, vs_handle, PIPE_SHADER_VERTEX);
}
/* create fragment shader */
@@ -363,7 +363,7 @@ START_TEST(virgl_test_render_simple)
virgl_encode_shader_state(&ctx, fs_handle, PIPE_SHADER_FRAGMENT,
&fs, text);
- virgl_encode_bind_object(&ctx, fs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, fs_handle, PIPE_SHADER_FRAGMENT);
}
/* set blend state */
@@ -571,7 +571,7 @@ START_TEST(virgl_test_render_geom_simple)
vs_handle = ctx_handle++;
virgl_encode_shader_state(&ctx, vs_handle, PIPE_SHADER_VERTEX,
&vs, text);
- virgl_encode_bind_object(&ctx, vs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, vs_handle, PIPE_SHADER_VERTEX);
}
/* create geometry shader */
@@ -602,7 +602,7 @@ START_TEST(virgl_test_render_geom_simple)
gs_handle = ctx_handle++;
virgl_encode_shader_state(&ctx, gs_handle, PIPE_SHADER_GEOMETRY,
&gs, text);
- virgl_encode_bind_object(&ctx, gs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, gs_handle, PIPE_SHADER_GEOMETRY);
}
/* create fragment shader */
@@ -619,7 +619,7 @@ START_TEST(virgl_test_render_geom_simple)
virgl_encode_shader_state(&ctx, fs_handle, PIPE_SHADER_FRAGMENT,
&fs, text);
- virgl_encode_bind_object(&ctx, fs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, fs_handle, PIPE_SHADER_FRAGMENT);
}
/* set blend state */
@@ -847,7 +847,7 @@ START_TEST(virgl_test_render_xfb)
vs.stream_output.output[0].num_components = 4;
virgl_encode_shader_state(&ctx, vs_handle, PIPE_SHADER_VERTEX,
&vs, text);
- virgl_encode_bind_object(&ctx, vs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, vs_handle, PIPE_SHADER_VERTEX);
}
/* create fragment shader */
@@ -863,8 +863,7 @@ START_TEST(virgl_test_render_xfb)
fs_handle = ctx_handle++;
virgl_encode_shader_state(&ctx, fs_handle, PIPE_SHADER_FRAGMENT,
&fs, text);
-
- virgl_encode_bind_object(&ctx, fs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, fs_handle, PIPE_SHADER_FRAGMENT);
}
/* set blend state */
@@ -998,7 +997,7 @@ START_TEST(virgl_test_large_shader)
virgl_encode_shader_state(&ctx, fs_handle, PIPE_SHADER_FRAGMENT,
&fs, text);
- virgl_encode_bind_object(&ctx, fs_handle, VIRGL_OBJECT_SHADER);
+ virgl_encode_bind_shader(&ctx, fs_handle, PIPE_SHADER_FRAGMENT);
}
testvirgl_fini_ctx_cmdbuf(&ctx);
diff --git a/tests/testvirgl_encode.c b/tests/testvirgl_encode.c
index f1d5409..ce62ecc 100644
--- a/tests/testvirgl_encode.c
+++ b/tests/testvirgl_encode.c
@@ -897,3 +897,12 @@ int virgl_encoder_destroy_sub_ctx(struct virgl_context *ctx, uint32_t sub_ctx_id
virgl_encoder_write_dword(ctx->cbuf, sub_ctx_id);
return 0;
}
+
+int virgl_encode_bind_shader(struct virgl_context *ctx,
+ uint32_t handle, uint32_t type)
+{
+ virgl_encoder_write_cmd_dword(ctx, VIRGL_CMD0(VIRGL_CCMD_BIND_SHADER, 0, 2));
+ virgl_encoder_write_dword(ctx->cbuf, handle);
+ virgl_encoder_write_dword(ctx->cbuf, type);
+ return 0;
+}
diff --git a/tests/testvirgl_encode.h b/tests/testvirgl_encode.h
index d717749..310cb14 100644
--- a/tests/testvirgl_encode.h
+++ b/tests/testvirgl_encode.h
@@ -229,4 +229,6 @@ 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_bind_shader(struct virgl_context *ctx,
+ uint32_t handle, uint32_t type);
#endif