iris: try to hack around binder issue
This commit is contained in:
parent
d2516358f9
commit
b3bb33c4c1
|
@ -59,6 +59,9 @@
|
||||||
|
|
||||||
#define BTP_ALIGNMENT 32
|
#define BTP_ALIGNMENT 32
|
||||||
|
|
||||||
|
/* Avoid using offset 0, tools consider it NULL */
|
||||||
|
#define INIT_INSERT_POINT BTP_ALIGNMENT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reserve a block of space in the binder, given the raw size in bytes.
|
* Reserve a block of space in the binder, given the raw size in bytes.
|
||||||
*/
|
*/
|
||||||
|
@ -94,7 +97,7 @@ iris_binder_reserve(struct iris_batch *batch, unsigned size)
|
||||||
* Note that you must actually populate the new binding tables after
|
* Note that you must actually populate the new binding tables after
|
||||||
* calling this command - the new area is uninitialized.
|
* calling this command - the new area is uninitialized.
|
||||||
*/
|
*/
|
||||||
void
|
bool
|
||||||
iris_binder_reserve_3d(struct iris_batch *batch,
|
iris_binder_reserve_3d(struct iris_batch *batch,
|
||||||
struct iris_context *ice)
|
struct iris_context *ice)
|
||||||
{
|
{
|
||||||
|
@ -118,9 +121,10 @@ iris_binder_reserve_3d(struct iris_batch *batch,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total_size == 0)
|
if (total_size == 0)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
uint32_t offset = iris_binder_reserve(batch, total_size);
|
uint32_t offset = iris_binder_reserve(batch, total_size);
|
||||||
|
bool flushed = offset == INIT_INSERT_POINT;
|
||||||
|
|
||||||
/* Assign space and record the current binding table. */
|
/* Assign space and record the current binding table. */
|
||||||
for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
|
for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
|
||||||
|
@ -130,10 +134,9 @@ iris_binder_reserve_3d(struct iris_batch *batch,
|
||||||
binder->bt_offset[stage] = sizes[stage] > 0 ? offset : 0;
|
binder->bt_offset[stage] = sizes[stage] > 0 ? offset : 0;
|
||||||
offset += sizes[stage];
|
offset += sizes[stage];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Avoid using offset 0, tools consider it NULL */
|
return flushed;
|
||||||
#define INIT_INSERT_POINT BTP_ALIGNMENT
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
iris_init_binder(struct iris_binder *binder, struct iris_bufmgr *bufmgr)
|
iris_init_binder(struct iris_binder *binder, struct iris_bufmgr *bufmgr)
|
||||||
|
|
|
@ -53,7 +53,7 @@ void iris_init_binder(struct iris_binder *binder, struct iris_bufmgr *bufmgr);
|
||||||
bool iris_binder_is_empty(struct iris_binder *binder);
|
bool iris_binder_is_empty(struct iris_binder *binder);
|
||||||
void iris_destroy_binder(struct iris_binder *binder);
|
void iris_destroy_binder(struct iris_binder *binder);
|
||||||
uint32_t iris_binder_reserve(struct iris_batch *batch, unsigned size);
|
uint32_t iris_binder_reserve(struct iris_batch *batch, unsigned size);
|
||||||
void iris_binder_reserve_3d(struct iris_batch *batch,
|
bool iris_binder_reserve_3d(struct iris_batch *batch,
|
||||||
struct iris_context *ice);
|
struct iris_context *ice);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -64,8 +64,13 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
|
||||||
IRIS_DIRTY_BINDINGS_FS;
|
IRIS_DIRTY_BINDINGS_FS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: don't do this unless things are dirty...
|
if (iris_binder_reserve_3d(batch, ice)) {
|
||||||
iris_binder_reserve_3d(batch, ice);
|
ice->state.dirty |= IRIS_DIRTY_BINDINGS_VS |
|
||||||
|
IRIS_DIRTY_BINDINGS_TCS |
|
||||||
|
IRIS_DIRTY_BINDINGS_TES |
|
||||||
|
IRIS_DIRTY_BINDINGS_GS |
|
||||||
|
IRIS_DIRTY_BINDINGS_FS;
|
||||||
|
}
|
||||||
ice->vtbl.upload_render_state(ice, batch, info);
|
ice->vtbl.upload_render_state(ice, batch, info);
|
||||||
|
|
||||||
ice->state.dirty = 0ull;
|
ice->state.dirty = 0ull;
|
||||||
|
|
Loading…
Reference in New Issue