A fragment shader and method of operation are provided for a hybrid ray
tracing system. The method includes determining whether a fragment is to
be rasterized or raytraced. If a determination is made that the fragment
is to be rasterized, a predetermined value for the fragment is stored
into a rasterization target, the predetermined value indicating that the
fragment is to be excluded from raytracing operations. If a determination
is made that the fragment is to be raytraced, a primitive identifier of
the fragment is stored into a rasterization target.