mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests: Implement check_requirements() for the OpenGL shader runner.
This commit is contained in:
parent
aac3916fcf
commit
0f3a42c34b
Notes:
Alexandre Julliard
2024-02-13 23:12:23 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/646
@ -1350,10 +1350,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
|
|||||||
|
|
||||||
case STATE_REQUIRE:
|
case STATE_REQUIRE:
|
||||||
if (runner->maximum_shader_model < runner->minimum_shader_model
|
if (runner->maximum_shader_model < runner->minimum_shader_model
|
||||||
|| (runner->ops->check_requirements && !runner->ops->check_requirements(runner)))
|
|| !runner->ops->check_requirements(runner))
|
||||||
{
|
|
||||||
skip_tests = true;
|
skip_tests = true;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_RESOURCE:
|
case STATE_RESOURCE:
|
||||||
|
@ -59,6 +59,12 @@ struct gl_runner
|
|||||||
{
|
{
|
||||||
struct shader_runner r;
|
struct shader_runner r;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool float64;
|
||||||
|
bool int64;
|
||||||
|
} caps;
|
||||||
|
|
||||||
EGLDisplay display;
|
EGLDisplay display;
|
||||||
EGLContext context;
|
EGLContext context;
|
||||||
|
|
||||||
@ -93,7 +99,7 @@ static bool check_gl_extension(const char *extension, GLint extension_count)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_gl_extensions(void)
|
static bool check_gl_extensions(struct gl_runner *runner)
|
||||||
{
|
{
|
||||||
GLint count;
|
GLint count;
|
||||||
|
|
||||||
@ -114,6 +120,11 @@ static bool check_gl_extensions(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (check_gl_extension("GL_ARB_gpu_shader_fp64", count))
|
||||||
|
runner->caps.float64 = true;
|
||||||
|
if (check_gl_extension("GL_ARB_gpu_shader_int64", count))
|
||||||
|
runner->caps.int64 = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +221,8 @@ static bool gl_runner_init(struct gl_runner *runner)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check_gl_extensions())
|
memset(&runner->caps, 0, sizeof(runner->caps));
|
||||||
|
if (!check_gl_extensions(runner))
|
||||||
{
|
{
|
||||||
trace("Device %u lacks required extensions.\n", i);
|
trace("Device %u lacks required extensions.\n", i);
|
||||||
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
@ -237,6 +249,9 @@ static bool gl_runner_init(struct gl_runner *runner)
|
|||||||
trace("GL_RENDERER: %s\n", glGetString(GL_RENDERER));
|
trace("GL_RENDERER: %s\n", glGetString(GL_RENDERER));
|
||||||
trace(" GL_VERSION: %s\n", glGetString(GL_VERSION));
|
trace(" GL_VERSION: %s\n", glGetString(GL_VERSION));
|
||||||
|
|
||||||
|
trace(" float64: %u.\n", runner->caps.float64);
|
||||||
|
trace(" int64: %u.\n", runner->caps.int64);
|
||||||
|
|
||||||
p_glSpecializeShader = (void *)eglGetProcAddress("glSpecializeShader");
|
p_glSpecializeShader = (void *)eglGetProcAddress("glSpecializeShader");
|
||||||
|
|
||||||
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, NULL, GL_FALSE);
|
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, NULL, GL_FALSE);
|
||||||
@ -274,6 +289,18 @@ static void gl_runner_cleanup(struct gl_runner *runner)
|
|||||||
ok(ret, "Failed to terminate EGL display connection.\n");
|
ok(ret, "Failed to terminate EGL display connection.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool gl_runner_check_requirements(struct shader_runner *r)
|
||||||
|
{
|
||||||
|
struct gl_runner *runner = gl_runner(r);
|
||||||
|
|
||||||
|
if (r->require_float64 && !runner->caps.float64)
|
||||||
|
return false;
|
||||||
|
if (r->require_int64 && !runner->caps.int64)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct format_info *get_format_info(enum DXGI_FORMAT format)
|
static const struct format_info *get_format_info(enum DXGI_FORMAT format)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -979,6 +1006,7 @@ static void gl_runner_release_readback(struct shader_runner *runner, struct reso
|
|||||||
|
|
||||||
static const struct shader_runner_ops gl_runner_ops =
|
static const struct shader_runner_ops gl_runner_ops =
|
||||||
{
|
{
|
||||||
|
.check_requirements = gl_runner_check_requirements,
|
||||||
.create_resource = gl_runner_create_resource,
|
.create_resource = gl_runner_create_resource,
|
||||||
.destroy_resource = gl_runner_destroy_resource,
|
.destroy_resource = gl_runner_destroy_resource,
|
||||||
.dispatch = gl_runner_dispatch,
|
.dispatch = gl_runner_dispatch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user