Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #142 from renchenglei/gfx_regression
Browse files Browse the repository at this point in the history
Fix Car Chase regression when running Gfxbench
  • Loading branch information
feijiang1 authored Dec 26, 2019
2 parents 934f002 + 7b2c751 commit 5bdb896
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 52 deletions.
2 changes: 0 additions & 2 deletions Android.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ LOCAL_CFLAGS += \
-DHAVE___BUILTIN_CLZLL \
-DHAVE___BUILTIN_UNREACHABLE \
-DHAVE_PTHREAD=1 \
-DGLX_USE_TLS \
-DHAVE_DLADDR \
-DHAVE_DL_ITERATE_PHDR \
-DHAVE_LINUX_FUTEX_H \
Expand All @@ -88,7 +87,6 @@ LOCAL_CFLAGS += \
-Wno-enum-conversion

LOCAL_CPPFLAGS += \
-DGLX_USE_TLS \
-D__STDC_CONSTANT_MACROS \
-D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS \
Expand Down
1 change: 0 additions & 1 deletion src/mapi/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ LOCAL_SRC_FILES := \
u_execmem.c

LOCAL_CFLAGS := \
-DGLX_USE_TLS \
-DMAPI_MODE_GLAPI \
-DMAPI_ABI_HEADER=\"$(abi_header)\"

Expand Down
4 changes: 2 additions & 2 deletions src/mapi/glapi/glapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ _GLAPI_EXPORT extern __thread void * _glapi_tls_Context
_GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
_GLAPI_EXPORT extern const void *_glapi_Context;

# define GET_DISPATCH() _glapi_get_dispatch()
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_get_context()
# define GET_DISPATCH() _glapi_tls_Dispatch
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context

#else

Expand Down
49 changes: 2 additions & 47 deletions src/mesa/drivers/dri/i965/brw_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,51 +1189,6 @@ brw_draw_prims(struct gl_context *ctx,
brw->predicate.state = predicate_state;
}

#define MAX_PATCH_PER_DRAW 2

static void
brw_draw_prims_patch(struct gl_context *ctx,
const struct _mesa_prim *prims,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLboolean index_bounds_valid,
GLuint min_index,
GLuint max_index,
struct gl_transform_feedback_object *gl_xfb_obj,
unsigned stream,
struct gl_buffer_object *indirect) {

if (ctx != NULL && nr_prims == 1 && prims != NULL && prims->mode == GL_PATCHES && ib != NULL) {
struct _mesa_index_buffer ib_loop;
GLint patch_vertices = ctx->TessCtrlProgram.patch_vertices;
ib_loop = *ib;
GLuint count = ib->count;
unsigned index_size = ib->index_size;
struct gl_buffer_object *obj = ib->obj;
void *ptr = ib->ptr;
GLuint startindx = 0;
while (count > MAX_PATCH_PER_DRAW * patch_vertices) {
struct _mesa_index_buffer ib_new;
struct _mesa_prim prims_new;
ib_new.index_size = index_size;
ib_new.obj = obj;
ib_new.count = patch_vertices * MAX_PATCH_PER_DRAW;
ib_new.ptr = ptr + startindx * index_size;
prims_new = *prims;
prims_new.count = patch_vertices * MAX_PATCH_PER_DRAW;
brw_draw_prims(ctx, &prims_new, nr_prims,
&ib_new, index_bounds_valid, min_index, max_index,
gl_xfb_obj, stream, indirect);
startindx += MAX_PATCH_PER_DRAW * patch_vertices;
count -= MAX_PATCH_PER_DRAW * patch_vertices;
}
} else {
brw_draw_prims(ctx, prims, nr_prims,
ib, index_bounds_valid, min_index, max_index,
gl_xfb_obj, stream, indirect);
}
}

void
brw_draw_indirect_prims(struct gl_context *ctx,
GLuint mode,
Expand Down Expand Up @@ -1275,7 +1230,7 @@ brw_draw_indirect_prims(struct gl_context *ctx,
brw->draw.draw_params_count_offset = indirect_params_offset;
}

brw_draw_prims_patch(ctx, prim, draw_count,
brw_draw_prims(ctx, prim, draw_count,
ib, false, 0, ~0,
NULL, 0,
indirect_data);
Expand All @@ -1288,7 +1243,7 @@ brw_init_draw_functions(struct dd_function_table *functions)
{
/* Register our drawing function:
*/
functions->Draw = brw_draw_prims_patch;
functions->Draw = brw_draw_prims;
functions->DrawIndirect = brw_draw_indirect_prims;
}

Expand Down

0 comments on commit 5bdb896

Please sign in to comment.