Implement the D3DCOLORtoUBYTE4
HLSL Function
#99092
Labels
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
D3DCOLORtoUBYTE4
in thehlsl_intrinsics.h
headerclang/test/CodeGenHLSL/builtins/D3DCOLORtoUBYTE4.hlsl
clang/test/SemaHLSL/BuiltIns/D3DCOLORtoUBYTE4-errors.hlsl
DirectX
There were no DXIL opcodes found for
D3DCOLORtoUBYTE4
. That should make it easy to do entirely in the frontend.In DXC it was done via emitting llvmir. We do not want to do that in upstream.
SPIRV
There is no SPIRV opcode, but SPIRV has a custom implementation. We should try to consolidate behavior between backends. If you need to pick between implementations treat the implementation targeting the DirectX backend as the working spec.
Test Case(s)
Example 1
HLSL:
Converts a floating-point, 4D vector set by a D3DCOLOR to a UBYTE4.
This function swizzles and scales components of the x parameter. Use this function to compensate for the lack of UBYTE4 support in some hardware.
Parameters
Return Value
The UBYTE4 representation of the x parameter.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
See also
Intrinsic Functions (DirectX HLSL)
The text was updated successfully, but these errors were encountered: