iris: better BT asserts

Probably nothing is working because texture upload isn't implemented
This commit is contained in:
Kenneth Graunke
2018-04-07 07:07:19 -07:00
parent 0148bd6839
commit 35afa8c8f3
2 changed files with 14 additions and 5 deletions

View File

@@ -155,9 +155,14 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
struct brw_stage_prog_data *prog_data, struct brw_stage_prog_data *prog_data,
uint32_t next_binding_table_offset) uint32_t next_binding_table_offset)
{ {
prog_data->binding_table.texture_start = next_binding_table_offset; if (info->num_textures) {
prog_data->binding_table.gather_texture_start = next_binding_table_offset; prog_data->binding_table.texture_start = next_binding_table_offset;
next_binding_table_offset += info->num_textures; prog_data->binding_table.gather_texture_start = next_binding_table_offset;
next_binding_table_offset += info->num_textures;
} else {
prog_data->binding_table.texture_start = 0xd0d0d0d0;
prog_data->binding_table.gather_texture_start = 0xd0d0d0d0;
}
if (info->num_ubos) { if (info->num_ubos) {
//assert(info->num_ubos <= BRW_MAX_UBO); //assert(info->num_ubos <= BRW_MAX_UBO);

View File

@@ -2088,6 +2088,7 @@ iris_upload_render_state(struct iris_context *ice,
struct brw_stage_prog_data *prog_data = (void *) shader->prog_data; struct brw_stage_prog_data *prog_data = (void *) shader->prog_data;
uint32_t bt_offset = 0; uint32_t bt_offset = 0;
uint32_t *bt_map = NULL; uint32_t *bt_map = NULL;
int s = 0;
if (prog_data->binding_table.size_bytes != 0) { if (prog_data->binding_table.size_bytes != 0) {
iris_use_pinned_bo(batch, ice->state.binder.bo, false); iris_use_pinned_bo(batch, ice->state.binder.bo, false);
@@ -2104,14 +2105,17 @@ iris_upload_render_state(struct iris_context *ice,
if (stage == MESA_SHADER_FRAGMENT) { if (stage == MESA_SHADER_FRAGMENT) {
struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer; struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) { for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
*bt_map++ = use_surface(batch, cso_fb->cbufs[i], true); bt_map[s++] = use_surface(batch, cso_fb->cbufs[i], true);
} }
} }
assert(prog_data->binding_table.texture_start ==
ice->state.num_textures[stage] ? s : 0xd0d0d0d0);
for (int i = 0; i < ice->state.num_textures[stage]; i++) { for (int i = 0; i < ice->state.num_textures[stage]; i++) {
struct iris_sampler_view *view = ice->state.textures[stage][i]; struct iris_sampler_view *view = ice->state.textures[stage][i];
struct iris_resource *res = (void *) view->pipe.texture; struct iris_resource *res = (void *) view->pipe.texture;
*bt_map++ = use_sampler_view(batch, view); bt_map[s++] = use_sampler_view(batch, view);
} }
#if 0 #if 0