screen->transfer_map = softpipe_transfer_map;
screen->transfer_unmap = softpipe_transfer_unmap;
}
+
+
+boolean
+softpipe_get_texture_buffer( struct pipe_texture *texture,
+ struct pipe_buffer **buf,
+ unsigned *stride )
+{
+ struct softpipe_texture *tex = (struct softpipe_texture *)texture;
+
+ if (!tex)
+ return FALSE;
+
+ pipe_buffer_reference(buf, tex->buffer);
+
+ if (stride)
+ *stride = tex->stride[0];
+
+ return TRUE;
+}
softpipe_create_screen(struct pipe_winsys *);
+boolean
+softpipe_get_texture_buffer( struct pipe_texture *texture,
+ struct pipe_buffer **buf,
+ unsigned *stride );
+
+
#ifdef __cplusplus
}
#endif
#include "pipe/p_screen.h"
+#include "softpipe/sp_winsys.h"
+
#include "intel_be_device.h"
#include "intel_be_context.h"
#include "intel_be_batchbuffer.h"
intel_be_init_context(intel, device);
-#if 0
- pipe = intel_create_softpipe(intel, screen->winsys);
-#else
- pipe = i915_create_context(screen, &device->base, &intel->base);
-#endif
+ if (getenv("INTEL_SOFTPIPE"))
+ pipe = softpipe_create(screen);
+ else
+ pipe = i915_create_context(screen, &device->base, &intel->base);
- pipe->priv = intel;
+ if (pipe)
+ pipe->priv = intel;
return pipe;
}
#include "intel_be_fence.h"
#include "i915simple/i915_winsys.h"
+#include "softpipe/sp_winsys.h"
#include "intel_be_api.h"
intel_be_init_device(dev, drmFD, deviceID);
- screen = i915_create_screen(&dev->base, deviceID);
+ if (getenv("INTEL_SOFTPIPE")) {
+ screen = softpipe_create_screen(&dev->base);
+ drm_api_hooks.buffer_from_texture = softpipe_get_texture_buffer;
+ } else
+ screen = i915_create_screen(&dev->base, deviceID);
return screen;
}
$(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a \
$(GALLIUMDIR)/winsys/drm/intel/gem/libinteldrm.a \
$(TOP)/src/gallium/drivers/i915simple/libi915simple.a \
+ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(GALLIUM_AUXILIARIES)
#############################################
all default: $(TARGET)
-$(TARGET): $(OBJECTS) Makefile $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a
+$(TARGET): $(OBJECTS) Makefile $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a $(LIBS)
$(TOP)/bin/mklib -noprefix -o $@ \
$(OBJECTS) $(LIBS) $(shell pkg-config --libs libdrm) -ldrm_intel