|
|
|
@ -267,47 +267,42 @@ int testvirgl_create_backed_simple_buffer(struct virgl_resource *res, |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uint32_t testvirgl_get_glsl_level_from_caps(void) |
|
|
|
|
static void *get_caps(void) |
|
|
|
|
{ |
|
|
|
|
uint32_t max_ver, max_size, glsl_level; |
|
|
|
|
void *caps; |
|
|
|
|
|
|
|
|
|
virgl_renderer_get_cap_set(1, &max_ver, &max_size); |
|
|
|
|
ck_assert_int_eq(max_ver, 1); |
|
|
|
|
ck_assert_int_ne(max_size, 0); |
|
|
|
|
ck_assert_int_eq(max_size, sizeof(struct virgl_caps_v1)); |
|
|
|
|
uint32_t max_ver, max_size, glsl_level; |
|
|
|
|
void *caps; |
|
|
|
|
|
|
|
|
|
caps = malloc(max_size); |
|
|
|
|
virgl_renderer_get_cap_set(1, &max_ver, &max_size); |
|
|
|
|
ck_assert_int_eq(max_ver, 1); |
|
|
|
|
ck_assert_int_ne(max_size, 0); |
|
|
|
|
ck_assert_int_eq(max_size, sizeof(struct virgl_caps_v1)); |
|
|
|
|
caps = malloc(max_size); |
|
|
|
|
|
|
|
|
|
virgl_renderer_fill_caps(0, 0, caps); |
|
|
|
|
virgl_renderer_fill_caps(0, 0, caps); |
|
|
|
|
return caps; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
struct virgl_caps_v1 *v1 = (struct virgl_caps_v1*) caps; |
|
|
|
|
glsl_level = v1->glsl_level; |
|
|
|
|
uint32_t testvirgl_get_glsl_level_from_caps(void) |
|
|
|
|
{ |
|
|
|
|
uint32_t glsl_level; |
|
|
|
|
void *caps = get_caps(); |
|
|
|
|
struct virgl_caps_v1 *v1 = (struct virgl_caps_v1*) caps; |
|
|
|
|
glsl_level = v1->glsl_level; |
|
|
|
|
|
|
|
|
|
free(caps); |
|
|
|
|
free(caps); |
|
|
|
|
|
|
|
|
|
return glsl_level; |
|
|
|
|
return glsl_level; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned testvirgl_get_multisample_from_caps(void) |
|
|
|
|
{ |
|
|
|
|
uint32_t max_ver, max_size; |
|
|
|
|
unsigned multisample; |
|
|
|
|
void *caps; |
|
|
|
|
|
|
|
|
|
virgl_renderer_get_cap_set(1, &max_ver, &max_size); |
|
|
|
|
ck_assert_int_eq(max_ver, 1); |
|
|
|
|
ck_assert_int_ne(max_size, 0); |
|
|
|
|
ck_assert_int_eq(max_size, sizeof(struct virgl_caps_v1)); |
|
|
|
|
|
|
|
|
|
caps = malloc(max_size); |
|
|
|
|
|
|
|
|
|
virgl_renderer_fill_caps(0, 0, caps); |
|
|
|
|
void *caps = get_caps(); |
|
|
|
|
unsigned multisample; |
|
|
|
|
|
|
|
|
|
struct virgl_caps_v1 *v1 = (struct virgl_caps_v1*) caps; |
|
|
|
|
multisample = v1->bset.texture_multisample; |
|
|
|
|
struct virgl_caps_v1 *v1 = (struct virgl_caps_v1*) caps; |
|
|
|
|
multisample = v1->bset.texture_multisample; |
|
|
|
|
|
|
|
|
|
free(caps); |
|
|
|
|
free(caps); |
|
|
|
|
|
|
|
|
|
return multisample; |
|
|
|
|
return multisample; |
|
|
|
|
} |
|
|
|
|