diff options
author | Andreas Fänger <[email protected]> | 2011-08-10 08:07:29 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-08-11 08:33:59 -0600 |
commit | e411cd7b0a54d2f9b9f4cda4918aa7742ed5c2a6 (patch) | |
tree | b1d4f68c4a49d4ff7cc36fc03680120c57eb934e /src/mesa/swrast/s_texcombine.c | |
parent | fa351bd2e0aecccd5ed6ef8744d5ba4a6dbf5d2c (diff) |
swrast: initial multi-threaded span rendering
Optional parallel rendering of spans using OpenMP.
Initial implementation for aa triangles. A new option for scons is
also provided to activate the openmp support (off by default).
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_texcombine.c')
-rw-r--r-- | src/mesa/swrast/s_texcombine.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 086ed0b33d7..80b9dff3cc2 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -48,7 +48,11 @@ typedef float (*float4_array)[4]; static INLINE float4_array get_texel_array(SWcontext *swrast, GLuint unit) { +#ifdef _OPENMP + return (float4_array) (swrast->TexelBuffer + unit * MAX_WIDTH * 4 * omp_get_num_threads() + (MAX_WIDTH * 4 * omp_get_thread_num())); +#else return (float4_array) (swrast->TexelBuffer + unit * MAX_WIDTH * 4); +#endif } |