OSDN Git Service

Merge branch 'mesa_7_7_branch'
[android-x86/external-mesa.git] / src / mesa / drivers / dri / r300 / r300_context.c
index 2ad5186..eedb7b6 100644 (file)
@@ -52,12 +52,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "tnl/t_pipeline.h"
 
 #include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
 
 #include "r300_context.h"
 #include "radeon_span.h"
+#include "r300_blit.h"
 #include "r300_cmdbuf.h"
 #include "r300_state.h"
-#include "r300_ioctl.h"
 #include "r300_tex.h"
 #include "r300_emit.h"
 #include "r300_swtcl.h"
@@ -87,7 +88,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "main/remap_helper.h"
 
-
 static const struct dri_extension card_extensions[] = {
   /* *INDENT-OFF* */
   {"GL_ARB_depth_texture",             NULL},
@@ -319,6 +319,8 @@ static void r300_init_vtbl(radeonContextPtr radeon)
                        radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z;
        } else
                radeon->vtbl.emit_query_finish = r300_emit_query_finish;
+
+    radeon->vtbl.blit = r300_blit;
 }
 
 static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
@@ -444,15 +446,24 @@ static void r300InitGLExtensions(GLcontext *ctx)
        if (!r300->radeon.radeonScreen->drmSupportsOcclusionQueries) {
                _mesa_disable_extension(ctx, "GL_ARB_occlusion_query");
        }
+       if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV350)
+               _mesa_enable_extension(ctx, "GL_ARB_half_float_vertex");
+}
+
+static void r300InitIoctlFuncs(struct dd_function_table *functions)
+{
+       functions->Clear = _mesa_meta_Clear;
+       functions->Finish = radeonFinish;
+       functions->Flush = radeonFlush;
 }
 
 /* Create the device specific rendering context.
  */
 GLboolean r300CreateContext(const __GLcontextModes * glVisual,
-                           __DRIcontextPrivate * driContextPriv,
+                           __DRIcontext * driContextPriv,
                            void *sharedContextPrivate)
 {
-       __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+       __DRIscreen *sPriv = driContextPriv->driScreenPriv;
        radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
        struct dd_function_table functions;
        r300ContextPtr r300;
@@ -474,7 +485,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        _mesa_init_driver_functions(&functions);
        r300InitIoctlFuncs(&functions);
        r300InitStateFuncs(&functions);
-       r300InitTextureFuncs(&functions);
+       r300InitTextureFuncs(&r300->radeon, &functions);
        r300InitShaderFuncs(&functions);
        radeonInitQueryObjFunctions(&functions);
        radeonInitBufferObjectFuncs(&functions);
@@ -525,6 +536,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
                r300InitSwtcl(ctx);
        }
 
+       r300_blit_init(r300);
        radeon_fbo_init(&r300->radeon);
        radeonInitSpanFuncs( ctx );
        r300InitCmdBuf(r300);