vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4().
5 unresolved threads
5 unresolved threads
Merge request reports
Activity
3295 struct hlsl_type *arg_type = arg->data_type; 3296 struct hlsl_ir_swizzle *swizzle; 3297 struct hlsl_ir_constant *c; 3298 3299 if (arg_type->class != HLSL_CLASS_VECTOR || arg_type->dimx != 4) 3300 { 3301 struct vkd3d_string_buffer *string; 3302 3303 if ((string = hlsl_type_to_string(ctx, arg_type))) 3304 { 3305 hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, "Wrong argument type '%s'.", string->buffer); 3306 hlsl_release_string_buffer(ctx, string); 3307 } 3308 3309 return false; 3310 } - tests/hlsl-trunc.shader_test 0 → 100644
7 [test] 8 uniform 0 float4 -0.5 6.5 7.5 3.4 9 draw quad 10 probe all rgba (0.0, 6.0, 7.0, 3.0) 4 11 uniform 0 float4 -1.5 6.5 7.5 3.4 12 draw quad 13 probe all rgba (-1.0, 6.0, 7.0, 3.0) 4 14 15 [pixel shader] 16 float4 main(uniform float4 u) : sv_target 17 { 18 float a = trunc(u.r); 19 int2 b = trunc(u.gb); 20 float4 res = float4(b, a, u.a); 21 return floor(res); 22 } - tests/hlsl-d3dcolor-to-ubyte4.shader_test 0 → 100644
3312 3312 if (!(arg = intrinsic_float_convert_arg(ctx, params, arg, loc))) 3313 3313 return false; 3314 3314 3315 if (!(c = hlsl_new_constant(ctx, hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 4), loc))) 3316 return false; 3317 c->value[0].f = 255.001953f; 3318 c->value[1].f = 255.001953f; 3319 c->value[2].f = 255.001953f; 3320 c->value[3].f = 255.001953f; 3321 list_add_tail(params->instrs, &c->node.entry); 3315 if (arg_type->class == HLSL_CLASS_SCALAR) 3316 { 3317 if (!(c = hlsl_new_float_constant(ctx, 255.001953f, loc))) 3318 return false; 3319 list_add_tail(params->instrs, &c->node.entry); changed this line in version 3 of the diff
+ if (!(c = hlsl_new_constant(ctx, hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 4), loc))) + return false; + c->value[0].f = 255.001953f; + c->value[1].f = 255.001953f; + c->value[2].f = 255.001953f; + c->value[3].f = 255.001953f;
"255.001953f" doesn't seem quite as readable/obvious as e.g. "255.0f + (0.5f / 256.0f)".
added 1 commit
- 472ecb6e - vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4() function.
added 16 commits
-
472ecb6e...0ce55e8b - 14 commits from branch
wine:master
- b394af0f - vkd3d-shader/hlsl: Partially implement trunc().
- 990ee75b - vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4() function.
-
472ecb6e...0ce55e8b - 14 commits from branch
added 27 commits
-
990ee75b...8e0df3f7 - 25 commits from branch
wine:master
- 560f5350 - vkd3d-shader/hlsl: Partially implement trunc().
- 3c777a65 - vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4() function.
-
990ee75b...8e0df3f7 - 25 commits from branch
added 15 commits
-
3c777a65...af4bb037 - 13 commits from branch
wine:master
- f58c040b - vkd3d-shader/hlsl: Partially implement trunc().
- 34e4ba59 - vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4() function.
-
3c777a65...af4bb037 - 13 commits from branch
Please register or sign in to reply