Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

swpipe: Update for new Mesa

* Fix swpipe build.
* DriverCtx went away.. lovely.
  • Loading branch information...
commit 2b69feb92e32b49d3909e4e9ec1b65a5b144306d 1 parent 066ca38
@kallisti5 kallisti5 authored
View
17 src/add-ons/opengl/swpipe/GalliumContext.cpp
@@ -51,7 +51,9 @@ hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
{
TRACE("%s(glContext: %p, x: %d, y: %d, width: %d, height: %d\n", __func__,
glContext, x, y, width, height);
- struct hgl_context *context = (struct hgl_context*)glContext->DriverCtx;
+
+#if 0
+ struct hgl_context* context = DOWNCAST(hgl_context, gl_context, glContext);
if (!context) {
ERROR("%s: No context yet. bailing.\n", __func__);
@@ -72,6 +74,16 @@ hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
if (read)
_mesa_resize_framebuffer(glContext, read, bitmapWidth, bitmapHeight);
}
+#endif
+ struct gl_framebuffer *draw = glContext->WinSysDrawBuffer;
+ struct gl_framebuffer *read = glContext->WinSysReadBuffer;
+
+ // TODO: SLOW! We need to check for changes in size here.
+
+ if (draw)
+ _mesa_resize_framebuffer(glContext, draw, width, height);
+ if (read)
+ _mesa_resize_framebuffer(glContext, read, width, height);
}
@@ -362,14 +374,13 @@ GalliumContext::CreateContext(Bitmap *bitmap)
}
// Init Gallium3D Post Processing
- context->postProcess = pp_init(fScreen, context->postProcessEnable);
+ //context->postProcess = pp_init(fScreen, context->postProcessEnable);
assert(!context->st->st_manager_private);
context->st->st_manager_private = (void*)context;
struct st_context *stContext = (struct st_context*)context->st;
- stContext->ctx->DriverCtx = context;
stContext->ctx->Driver.Viewport = hgl_viewport;
// TODO: Closely review this next context logic...
View
7 src/add-ons/opengl/swpipe/GalliumContext.h
@@ -9,6 +9,8 @@
#define GALLIUMCONTEXT_H
+#include <stddef.h>
+
extern "C" {
#include "state_tracker/st_api.h"
#include "pipe/p_compiler.h"
@@ -22,11 +24,6 @@ extern "C" {
#define CONTEXT_MAX 32
-// HACK: offsetof must be redefined before loading sp_context.h
-// in GalliumContext.cpp
-#undef offsetof
-#define offsetof( type, member ) ((size_t) &((type *)0)->member)
-
typedef int64 context_id;
View
4 src/add-ons/opengl/swpipe/GalliumFramebuffer.cpp
@@ -30,8 +30,8 @@ extern "C" {
static boolean
-hgl_framebuffer_flush_front(struct st_framebuffer_iface* stfb,
- enum st_attachment_type statt)
+hgl_framebuffer_flush_front(struct st_context_iface *stctx,
+ struct st_framebuffer_iface* stfb, enum st_attachment_type statt)
{
CALLED();
// TODO: I have *NO* idea how we are going to access this data...
View
1  src/add-ons/opengl/swpipe/SoftwareRenderer.cpp
@@ -354,6 +354,7 @@ SoftwareRenderer::_AllocateBitmap()
TRACE("%s: Can't create bitmap!\n", __func__);
return;
}
+
#if 0
// debug..
void *data = fBitmap->Bits();
View
8 src/add-ons/opengl/swpipe/SoftwareWinsys.cpp
@@ -79,11 +79,11 @@ hook_winsys_displaytarget_create(struct sw_winsys* winsys,
haikuDisplayTarget->width = width;
haikuDisplayTarget->height = height;
- //unsigned bitsPerPixel = util_format_get_blocksizebits(format);
- unsigned colorsPerPalette = util_format_get_blocksize(format);
+ unsigned formatStride = util_format_get_stride(format, width);
+ unsigned blockSize = util_format_get_nblocksy(format, height);
- haikuDisplayTarget->stride = align(width * colorsPerPalette, alignment);
- haikuDisplayTarget->size = haikuDisplayTarget->stride * height;
+ haikuDisplayTarget->stride = align(formatStride, alignment);
+ haikuDisplayTarget->size = haikuDisplayTarget->stride * blockSize;
haikuDisplayTarget->data
= align_malloc(haikuDisplayTarget->size, alignment);
Please sign in to comment.
Something went wrong with that request. Please try again.