This is required for D3D1x and supported by hardware.
float scale;
float units;
+ float clamp;
};
float zoffset = offset->units + MAX2(dzdx, dzdy) * offset->scale;
+ if (offset->clamp)
+ zoffset = (offset->clamp < 0.0f) ? MAX2(zoffset, offset->clamp) :
+ MIN2(zoffset, offset->clamp);
+
/*
* Note: we're applying the offset and clamping per-vertex.
* Ideally, the offset is applied per-fragment prior to fragment shading.
offset->units = (float) (stage->draw->rasterizer->offset_units * stage->draw->mrd);
offset->scale = stage->draw->rasterizer->offset_scale;
+ offset->clamp = stage->draw->rasterizer->offset_clamp;
stage->tri = offset_tri;
stage->tri( stage, header );
util_dump_member(stream, float, state, point_size);
util_dump_member(stream, float, state, offset_units);
util_dump_member(stream, float, state, offset_scale);
+ util_dump_member(stream, float, state, offset_clamp);
util_dump_struct_end(stream);
}
Specifies the polygon offset bias
offset_scale
Specifies the polygon offset scale
+offset_clamp
+ Upper (if > 0) or lower (if < 0) bound on the polygon offset result
trace_dump_member(float, state, point_size);
trace_dump_member(float, state, offset_units);
trace_dump_member(float, state, offset_scale);
+ trace_dump_member(float, state, offset_clamp);
trace_dump_struct_end();
}
float point_size; /**< used when no per-vertex size */
float offset_units;
float offset_scale;
+ float offset_clamp;
};