*/
static void
emit_null_surface_state(struct brw_context *brw,
- unsigned width,
- unsigned height,
- unsigned samples,
+ const struct gl_framebuffer *fb,
uint32_t *out_offset)
{
uint32_t *surf = brw_state_batch(brw,
brw->isl_dev.ss.align,
out_offset);
+ /* Use the fb dimensions or 1x1x1 */
+ const unsigned width = fb ? _mesa_geometric_width(fb) : 1;
+ const unsigned height = fb ? _mesa_geometric_height(fb) : 1;
+ const unsigned samples = fb ? _mesa_geometric_samples(fb) : 1;
+
if (brw->gen != 6 || samples <= 1) {
isl_null_fill_state(&brw->isl_dev, surf,
isl_extent3d(width, height, 1));
uint32_t *surf_offset)
{
GLuint i;
- const unsigned int w = _mesa_geometric_width(fb);
- const unsigned int h = _mesa_geometric_height(fb);
- const unsigned int s = _mesa_geometric_samples(fb);
/* Update surfaces for drawing buffers */
if (fb->_NumColorDrawBuffers >= 1) {
gen6_update_renderbuffer_surface(brw, rb, i, surf_index) :
gen4_update_renderbuffer_surface(brw, rb, i, surf_index);
} else {
- emit_null_surface_state(brw, w, h, s, &surf_offset[surf_index]);
+ emit_null_surface_state(brw, fb, &surf_offset[surf_index]);
}
}
} else {
const uint32_t surf_index = render_target_start;
- emit_null_surface_state(brw, w, h, s, &surf_offset[surf_index]);
+ emit_null_surface_state(brw, fb, &surf_offset[surf_index]);
}
}
0);
} else {
- emit_null_surface_state(brw,
- _mesa_geometric_width(fb),
- _mesa_geometric_height(fb),
- _mesa_geometric_samples(fb),
- surf_offset);
+ emit_null_surface_state(brw, fb, surf_offset);
}
}
&ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
- emit_null_surface_state(brw, 1, 1, 1, &ubo_surf_offsets[i]);
+ emit_null_surface_state(brw, NULL, &ubo_surf_offsets[i]);
} else {
struct intel_buffer_object *intel_bo =
intel_buffer_object(binding->BufferObject);
&ctx->ShaderStorageBufferBindings[prog->sh.ShaderStorageBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
- emit_null_surface_state(brw, 1, 1, 1, &ssbo_surf_offsets[i]);
+ emit_null_surface_state(brw, NULL, &ssbo_surf_offsets[i]);
} else {
struct intel_buffer_object *intel_bo =
intel_buffer_object(binding->BufferObject);
}
} else {
- emit_null_surface_state(brw, 1, 1, 1, surf_offset);
+ emit_null_surface_state(brw, NULL, surf_offset);
update_default_image_param(brw, u, surface_idx, param);
}
}