diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 9cfb6058c..032ad025f 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -10831,8 +10831,20 @@ static bool sm4_generate_vsir_instr_resource_store(struct hlsl_ctx *ctx, if (store->store_type != HLSL_RESOURCE_STORE) { - hlsl_fixme(ctx, &instr->loc, "Stream output operations."); - return false; + enum vkd3d_shader_opcode opcode = store->store_type == HLSL_RESOURCE_STREAM_APPEND + ? VKD3DSIH_EMIT : VKD3DSIH_CUT; + + VKD3D_ASSERT(!store->value.node && !store->coords.node); + VKD3D_ASSERT(store->resource.var->regs[HLSL_REGSET_STREAM_OUTPUTS].allocated); + + if (store->resource.var->regs[HLSL_REGSET_STREAM_OUTPUTS].index) + { + hlsl_fixme(ctx, &instr->loc, "Stream output operation with a nonzero stream index."); + return false; + } + + ins = generate_vsir_add_program_instruction(ctx, program, &store->node.loc, opcode, 0, 0); + return !!ins; } if (!store->resource.var->is_uniform) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 48814ffc7..29b03871e 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -4165,6 +4165,7 @@ static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_ case VKD3DSIH_BREAK: case VKD3DSIH_CASE: case VKD3DSIH_CONTINUE: + case VKD3DSIH_CUT: case VKD3DSIH_DEFAULT: case VKD3DSIH_DISCARD: case VKD3DSIH_DIV: @@ -4178,6 +4179,7 @@ static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_ case VKD3DSIH_DSY_COARSE: case VKD3DSIH_DSY_FINE: case VKD3DSIH_ELSE: + case VKD3DSIH_EMIT: case VKD3DSIH_ENDIF: case VKD3DSIH_ENDLOOP: case VKD3DSIH_ENDSWITCH: diff --git a/tests/hlsl/geometry-shader-syntax.shader_test b/tests/hlsl/geometry-shader-syntax.shader_test index fa6717ce0..be481a534 100644 --- a/tests/hlsl/geometry-shader-syntax.shader_test +++ b/tests/hlsl/geometry-shader-syntax.shader_test @@ -598,7 +598,7 @@ void main(point gs_data vin[1], inout TriangleStream vout1, inout Trian } % An output stream is only validated when it is used. -[geometry shader todo] +[geometry shader] struct gs_data { float4 pos : SV_POSITION; @@ -650,7 +650,7 @@ void main(point gs_data vin[1], inout PointStream vout1, inout PointStr } % Max vertex count * output data component count must be less than or equal to 1024. -[geometry shader todo] +[geometry shader] struct gs_data { float2 x : X; @@ -675,7 +675,7 @@ void main(point gs_data vin[1], inout PointStream vout) } % The component count of the output is used, not its allocated register size. -[geometry shader todo] +[geometry shader] struct gs_data { float2 x : X; // Allocates to o0.xy diff --git a/tests/hlsl/geometry.shader_test b/tests/hlsl/geometry.shader_test index 870de43d0..4653ccf43 100644 --- a/tests/hlsl/geometry.shader_test +++ b/tests/hlsl/geometry.shader_test @@ -22,7 +22,7 @@ void main(in struct vs_data vs_input, out struct vs_data vs_output) vs_output.color = vs_input.color; } -[geometry shader todo] +[geometry shader] struct gs_data { float4 pos : SV_POSITION; @@ -60,9 +60,9 @@ float4 main(struct ps_data ps_input) : SV_Target } [test] -todo(sm<6) draw point list 1 -todo(mvk) probe rtv 0 (320, 190) rgba(0.0, 0.0, 0.0, 0.0) -todo(mvk) probe rtv 0 (255, 240) rgba(0.0, 0.0, 0.0, 0.0) -todo(mvk) probe rtv 0 (320, 240) rgba(0.0, 1.0, 1.0, 1.0) -todo(mvk) probe rtv 0 (385, 240) rgba(0.0, 0.0, 0.0, 0.0) -todo(mvk) probe rtv 0 (320, 290) rgba(0.0, 0.0, 0.0, 0.0) +todo(msl) draw point list 1 +probe rtv 0 (320, 190) rgba(0.0, 0.0, 0.0, 0.0) +probe rtv 0 (255, 240) rgba(0.0, 0.0, 0.0, 0.0) +todo(opengl & llvmpipe | mvk) probe rtv 0 (320, 240) rgba(0.0, 1.0, 1.0, 1.0) +probe rtv 0 (385, 240) rgba(0.0, 0.0, 0.0, 0.0) +probe rtv 0 (320, 290) rgba(0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/patch-syntax.shader_test b/tests/hlsl/patch-syntax.shader_test index 1d7b8e8c6..e0c23c506 100644 --- a/tests/hlsl/patch-syntax.shader_test +++ b/tests/hlsl/patch-syntax.shader_test @@ -191,7 +191,7 @@ float4 main(patch_constant_data input, InputPatch patch) : POSITION return 0; } -[geometry shader fail(sm<5) todo(sm>=5)] +[geometry shader fail(sm<5)] struct data { float4 val : VAL; diff --git a/tests/shader_runner_gl.c b/tests/shader_runner_gl.c index 08d5077f1..6cb863b55 100644 --- a/tests/shader_runner_gl.c +++ b/tests/shader_runner_gl.c @@ -922,6 +922,9 @@ static GLenum get_topology_gl(D3D_PRIMITIVE_TOPOLOGY topology) { switch (topology) { + case D3D_PRIMITIVE_TOPOLOGY_POINTLIST: + return GL_POINTS; + case D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST: return GL_TRIANGLES;