diff --git a/Makefile.am b/Makefile.am index fe4b1261..d801ee51 100644 --- a/Makefile.am +++ b/Makefile.am @@ -212,6 +212,7 @@ vkd3d_shader_tests = \ tests/hlsl/saturate.shader_test \ tests/hlsl/shade-mode.shader_test \ tests/hlsl/shader-interstage-interface.shader_test \ + tests/hlsl/shader-point-size.shader_test \ tests/hlsl/shape.shader_test \ tests/hlsl/side-effects.shader_test \ tests/hlsl/sign.shader_test \ diff --git a/tests/hlsl/shader-point-size.shader_test b/tests/hlsl/shader-point-size.shader_test new file mode 100644 index 00000000..1e7a3395 --- /dev/null +++ b/tests/hlsl/shader-point-size.shader_test @@ -0,0 +1,34 @@ +[require] +shader model < 4.0 + +[input layout] +0 r32g32-float position +0 r32-float psize + +[vb 0] +-0.5 0 20 + 0.5 0 40 + +[vertex shader] +void main(inout float4 pos : position, inout float size : psize) +{ +} + +[pixel shader] +float4 main() : color +{ + return float4(0, 1, 0, 1); +} + +[test] +draw point list 2 + +probe (149, 240) rgba (0, 0, 0, 0) +todo probe (151, 240) rgba (0, 1, 0, 1) +todo probe (169, 240) rgba (0, 1, 0, 1) +probe (171, 240) rgba (0, 0, 0, 0) + +probe (459, 240) rgba (0, 0, 0, 0) +todo probe (461, 240) rgba (0, 1, 0, 1) +todo probe (499, 240) rgba (0, 1, 0, 1) +probe (501, 240) rgba (0, 0, 0, 0) diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index 30fc5cdc..48683af0 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -300,6 +300,9 @@ static D3DDECLTYPE vertex_decl_type_from_format(DXGI_FORMAT format) { switch (format) { + case DXGI_FORMAT_R32_FLOAT: + return D3DDECLTYPE_FLOAT1; + case DXGI_FORMAT_R32G32_FLOAT: return D3DDECLTYPE_FLOAT2; @@ -315,6 +318,8 @@ static D3DDECLUSAGE vertex_decl_usage_from_name(const char *name) { if (!strcasecmp(name, "position") || !strcasecmp(name, "sv_position")) return D3DDECLUSAGE_POSITION; + if (!strcasecmp(name, "psize")) + return D3DDECLUSAGE_PSIZE; if (!strcasecmp(name, "texcoord")) return D3DDECLUSAGE_TEXCOORD; fatal_error("Cannot translate usage \"%s\" to a d3d9 usage.\n", name); @@ -501,6 +506,10 @@ static bool d3d9_runner_draw(struct shader_runner *r, switch (primitive_topology) { + case D3D_PRIMITIVE_TOPOLOGY_POINTLIST: + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_POINTLIST, 0, vertex_count); + break; + case D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST: hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, vertex_count / 3); break; diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index 879d3761..33e30cbd 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -515,6 +515,8 @@ static VkPrimitiveTopology vulkan_primitive_topology_from_d3d(D3D_PRIMITIVE_TOPO default: fatal_error("Unhandled primitive topology %#x.\n", topology); /* fall through */ + case D3D_PRIMITIVE_TOPOLOGY_POINTLIST: + return VK_PRIMITIVE_TOPOLOGY_POINT_LIST; case D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST: return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; case D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP: