aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/glsl_tests/fract.glsl
blob: 4333203924233fecb3346f610acc52686f39b6e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: ./amdgcn_glslc -mcpu=tahiti %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=SI %s
; RUN: ./amdgcn_glslc -mcpu=bonaire %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=CI %s
; RUN: ./amdgcn_glslc -mcpu=tonga %s | FileCheck -check-prefix=GCN -check-prefix=FUNC -check-prefix=CI %s

; Only SI has buggy v_fract and must use v_floor.
; The amdgcn.fract intrinsic can be used only if LLVM passes are able to move it.

; FUNC-LABEL: {{^}}@fract:
; GCN: main
; GCN: v_interp_mov
; SI-NEXT: v_floor_f32
; SI-NEXT: v_subrev_f32
; CI-NEXT: v_fract_f32
; GCN-NEXT: epilog

#shader fs fract
#version 400
flat in float f;
void main() {
    gl_FragColor.x = fract(f);
}