-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <stdint.h> | ||
|
||
#define location(i) __attribute__((annotate("shady::location::"#i))) | ||
#define input __attribute__((address_space(389))) | ||
#define output __attribute__((address_space(390))) | ||
|
||
typedef float vec4 __attribute__((ext_vector_type(4))); | ||
|
||
location(0) output vec4 fragColor; | ||
|
||
__attribute__((annotate("shady::builtin::FragCoord"))) | ||
input vec4 fragCoord; | ||
|
||
__attribute__((annotate("shady::entry_point::Fragment"))) | ||
void main() { | ||
int fillx = (((int) fragCoord[0]) / 16) % 2; | ||
int filly = (((int) fragCoord[1]) / 16) % 2; | ||
int fill = fillx ^ filly; | ||
fragColor = (vec4) {fill, fill, 0.0f, 1.0f }; | ||
} |