Add SREM tests for HLSL/MSL.
This commit is contained in:
parent
7cba89b4a5
commit
46bf17c5d3
29
reference/opt/shaders-hlsl/asm/frag/srem.asm.frag
Normal file
29
reference/opt/shaders-hlsl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,29 @@
|
||||
static float4 FragColor;
|
||||
static int4 vA;
|
||||
static int4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int4 vA : TEXCOORD0;
|
||||
nointerpolation int4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(vA - vB * (vA / vB));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
23
reference/opt/shaders-msl/asm/frag/srem.asm.frag
Normal file
23
reference/opt/shaders-msl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,23 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int4 vB [[user(locn1)]];
|
||||
int4 vA [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float4(in.vA - in.vB * (in.vA / in.vB));
|
||||
return out;
|
||||
}
|
||||
|
29
reference/shaders-hlsl/asm/frag/srem.asm.frag
Normal file
29
reference/shaders-hlsl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,29 @@
|
||||
static float4 FragColor;
|
||||
static int4 vA;
|
||||
static int4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int4 vA : TEXCOORD0;
|
||||
nointerpolation int4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(vA - vB * (vA / vB));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
23
reference/shaders-msl/asm/frag/srem.asm.frag
Normal file
23
reference/shaders-msl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,23 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int4 vB [[user(locn1)]];
|
||||
int4 vA [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float4(in.vA - in.vB * (in.vA / in.vB));
|
||||
return out;
|
||||
}
|
||||
|
43
shaders-hlsl/asm/frag/srem.asm.frag
Normal file
43
shaders-hlsl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,43 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 2
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %FragColor %vA %vB
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %FragColor "FragColor"
|
||||
OpName %vA "vA"
|
||||
OpName %vB "vB"
|
||||
OpDecorate %FragColor RelaxedPrecision
|
||||
OpDecorate %FragColor Location 0
|
||||
OpDecorate %vA Flat
|
||||
OpDecorate %vA Location 0
|
||||
OpDecorate %vB Flat
|
||||
OpDecorate %vB Location 1
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%FragColor = OpVariable %_ptr_Output_v4float Output
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%_ptr_Input_v4int = OpTypePointer Input %v4int
|
||||
%vA = OpVariable %_ptr_Input_v4int Input
|
||||
%vB = OpVariable %_ptr_Input_v4int Input
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%14 = OpLoad %v4int %vA
|
||||
%16 = OpLoad %v4int %vB
|
||||
%17 = OpLoad %v4int %vA
|
||||
%18 = OpLoad %v4int %vB
|
||||
%19 = OpSRem %v4int %17 %18
|
||||
%20 = OpConvertSToF %v4float %19
|
||||
OpStore %FragColor %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
43
shaders-msl/asm/frag/srem.asm.frag
Normal file
43
shaders-msl/asm/frag/srem.asm.frag
Normal file
@ -0,0 +1,43 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 2
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %FragColor %vA %vB
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %FragColor "FragColor"
|
||||
OpName %vA "vA"
|
||||
OpName %vB "vB"
|
||||
OpDecorate %FragColor RelaxedPrecision
|
||||
OpDecorate %FragColor Location 0
|
||||
OpDecorate %vA Flat
|
||||
OpDecorate %vA Location 0
|
||||
OpDecorate %vB Flat
|
||||
OpDecorate %vB Location 1
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%FragColor = OpVariable %_ptr_Output_v4float Output
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%_ptr_Input_v4int = OpTypePointer Input %v4int
|
||||
%vA = OpVariable %_ptr_Input_v4int Input
|
||||
%vB = OpVariable %_ptr_Input_v4int Input
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%14 = OpLoad %v4int %vA
|
||||
%16 = OpLoad %v4int %vB
|
||||
%17 = OpLoad %v4int %vA
|
||||
%18 = OpLoad %v4int %vB
|
||||
%19 = OpSRem %v4int %17 %18
|
||||
%20 = OpConvertSToF %v4float %19
|
||||
OpStore %FragColor %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
Loading…
Reference in New Issue
Block a user