tests/shader_runner_gl: Implement geometry shaders.

This commit is contained in:
Henri Verbeet
2025-06-26 18:12:50 +02:00
parent 673c26a040
commit 00f53b72a1
Notes: Henri Verbeet 2025-07-14 18:53:35 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1610
2 changed files with 20 additions and 3 deletions

View File

@@ -60,9 +60,9 @@ float4 main(struct ps_data ps_input) : SV_Target
} }
[test] [test]
draw point list 1 todo(glsl) draw point list 1
bug(mvk) probe rtv 0 (320, 190) rgba(0.0, 0.0, 0.0, 0.0) bug(mvk) probe rtv 0 (320, 190) rgba(0.0, 0.0, 0.0, 0.0)
bug(mvk) probe rtv 0 (255, 240) rgba(0.0, 0.0, 0.0, 0.0) bug(mvk) probe rtv 0 (255, 240) rgba(0.0, 0.0, 0.0, 0.0)
bug(opengl & llvmpipe | mvk) probe rtv 0 (320, 240) rgba(0.0, 1.0, 1.0, 1.0) bug(mvk) probe rtv 0 (320, 240) rgba(0.0, 1.0, 1.0, 1.0)
bug(mvk) probe rtv 0 (385, 240) rgba(0.0, 0.0, 0.0, 0.0) bug(mvk) probe rtv 0 (385, 240) rgba(0.0, 0.0, 0.0, 0.0)
bug(mvk) probe rtv 0 (320, 290) rgba(0.0, 0.0, 0.0, 0.0) bug(mvk) probe rtv 0 (320, 290) rgba(0.0, 0.0, 0.0, 0.0)

View File

@@ -857,6 +857,11 @@ static GLuint create_shader(struct gl_runner *runner, enum shader_type shader_ty
name = "tessellation evaluation"; name = "tessellation evaluation";
break; break;
case SHADER_TYPE_GS:
gl_shader_type = GL_GEOMETRY_SHADER;
name = "geometry";
break;
case SHADER_TYPE_CS: case SHADER_TYPE_CS:
gl_shader_type = GL_COMPUTE_SHADER; gl_shader_type = GL_COMPUTE_SHADER;
name = "compute"; name = "compute";
@@ -1055,7 +1060,7 @@ static GLenum get_compare_op_gl(D3D12_COMPARISON_FUNC op)
static GLuint compile_graphics_shader_program(struct gl_runner *runner, ID3D10Blob **vs_blob) static GLuint compile_graphics_shader_program(struct gl_runner *runner, ID3D10Blob **vs_blob)
{ {
ID3D10Blob *fs_blob, *hs_blob = NULL, *ds_blob = NULL, *gs_blob = NULL; ID3D10Blob *fs_blob, *hs_blob = NULL, *ds_blob = NULL, *gs_blob = NULL;
GLuint program_id, vs_id, fs_id, hs_id = 0, ds_id = 0; GLuint program_id, vs_id, fs_id, hs_id = 0, ds_id = 0, gs_id = 0;
bool succeeded; bool succeeded;
GLint status; GLint status;
@@ -1108,6 +1113,14 @@ static GLuint compile_graphics_shader_program(struct gl_runner *runner, ID3D10Bl
ds_blob = NULL; ds_blob = NULL;
} }
if (gs_blob)
{
if (!(gs_id = create_shader(runner, SHADER_TYPE_GS, gs_blob)))
goto fail;
ID3D10Blob_Release(gs_blob);
gs_blob = NULL;
}
/* TODO: compile and use the gs blobs too, but currently this /* TODO: compile and use the gs blobs too, but currently this
* point is not reached because compile_hlsl() fails on these. */ * point is not reached because compile_hlsl() fails on these. */
@@ -1118,11 +1131,15 @@ static GLuint compile_graphics_shader_program(struct gl_runner *runner, ID3D10Bl
glAttachShader(program_id, hs_id); glAttachShader(program_id, hs_id);
if (ds_id) if (ds_id)
glAttachShader(program_id, ds_id); glAttachShader(program_id, ds_id);
if (gs_id)
glAttachShader(program_id, gs_id);
glLinkProgram(program_id); glLinkProgram(program_id);
glGetProgramiv(program_id, GL_LINK_STATUS, &status); glGetProgramiv(program_id, GL_LINK_STATUS, &status);
ok(status, "Failed to link program.\n"); ok(status, "Failed to link program.\n");
trace_info_log(program_id, true); trace_info_log(program_id, true);
if (gs_id)
glDeleteShader(gs_id);
if (ds_id) if (ds_id)
glDeleteShader(ds_id); glDeleteShader(ds_id);
if (hs_id) if (hs_id)