swpipe: Update for new Mesa
* Fix swpipe build. * DriverCtx went away.. lovely.
This commit is contained in:
@@ -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__,
|
TRACE("%s(glContext: %p, x: %d, y: %d, width: %d, height: %d\n", __func__,
|
||||||
glContext, x, y, width, height);
|
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) {
|
if (!context) {
|
||||||
ERROR("%s: No context yet. bailing.\n", __func__);
|
ERROR("%s: No context yet. bailing.\n", __func__);
|
||||||
@@ -72,6 +74,16 @@ hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
|
|||||||
if (read)
|
if (read)
|
||||||
_mesa_resize_framebuffer(glContext, read, bitmapWidth, bitmapHeight);
|
_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
|
// Init Gallium3D Post Processing
|
||||||
context->postProcess = pp_init(fScreen, context->postProcessEnable);
|
//context->postProcess = pp_init(fScreen, context->postProcessEnable);
|
||||||
|
|
||||||
assert(!context->st->st_manager_private);
|
assert(!context->st->st_manager_private);
|
||||||
context->st->st_manager_private = (void*)context;
|
context->st->st_manager_private = (void*)context;
|
||||||
|
|
||||||
struct st_context *stContext = (struct st_context*)context->st;
|
struct st_context *stContext = (struct st_context*)context->st;
|
||||||
|
|
||||||
stContext->ctx->DriverCtx = context;
|
|
||||||
stContext->ctx->Driver.Viewport = hgl_viewport;
|
stContext->ctx->Driver.Viewport = hgl_viewport;
|
||||||
|
|
||||||
// TODO: Closely review this next context logic...
|
// TODO: Closely review this next context logic...
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#define GALLIUMCONTEXT_H
|
#define GALLIUMCONTEXT_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "state_tracker/st_api.h"
|
#include "state_tracker/st_api.h"
|
||||||
#include "pipe/p_compiler.h"
|
#include "pipe/p_compiler.h"
|
||||||
@@ -22,11 +24,6 @@ extern "C" {
|
|||||||
|
|
||||||
#define CONTEXT_MAX 32
|
#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;
|
typedef int64 context_id;
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
hgl_framebuffer_flush_front(struct st_framebuffer_iface* stfb,
|
hgl_framebuffer_flush_front(struct st_context_iface *stctx,
|
||||||
enum st_attachment_type statt)
|
struct st_framebuffer_iface* stfb, enum st_attachment_type statt)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
// TODO: I have *NO* idea how we are going to access this data...
|
// TODO: I have *NO* idea how we are going to access this data...
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ SoftwareRenderer::_AllocateBitmap()
|
|||||||
TRACE("%s: Can't create bitmap!\n", __func__);
|
TRACE("%s: Can't create bitmap!\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// debug..
|
// debug..
|
||||||
void *data = fBitmap->Bits();
|
void *data = fBitmap->Bits();
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ hook_winsys_displaytarget_create(struct sw_winsys* winsys,
|
|||||||
haikuDisplayTarget->width = width;
|
haikuDisplayTarget->width = width;
|
||||||
haikuDisplayTarget->height = height;
|
haikuDisplayTarget->height = height;
|
||||||
|
|
||||||
//unsigned bitsPerPixel = util_format_get_blocksizebits(format);
|
unsigned formatStride = util_format_get_stride(format, width);
|
||||||
unsigned colorsPerPalette = util_format_get_blocksize(format);
|
unsigned blockSize = util_format_get_nblocksy(format, height);
|
||||||
|
|
||||||
haikuDisplayTarget->stride = align(width * colorsPerPalette, alignment);
|
haikuDisplayTarget->stride = align(formatStride, alignment);
|
||||||
haikuDisplayTarget->size = haikuDisplayTarget->stride * height;
|
haikuDisplayTarget->size = haikuDisplayTarget->stride * blockSize;
|
||||||
|
|
||||||
haikuDisplayTarget->data
|
haikuDisplayTarget->data
|
||||||
= align_malloc(haikuDisplayTarget->size, alignment);
|
= align_malloc(haikuDisplayTarget->size, alignment);
|
||||||
|
|||||||
Reference in New Issue
Block a user