return false;
}
+void
+i830_hiz_resolve_noop(struct intel_context *intel,
+ struct intel_region *region)
+{
+ /* empty */
+}
+
void
i830InitVtbl(struct i830_context *i830)
{
i830->intel.vtbl.invalidate_state = i830_invalidate_state;
i830->intel.vtbl.render_target_supported = i830_render_target_supported;
i830->intel.vtbl.is_hiz_depth_format = i830_is_hiz_depth_format;
+ i830->intel.vtbl.hiz_resolve_depthbuffer = i830_hiz_resolve_noop;
+ i830->intel.vtbl.hiz_resolve_hizbuffer = i830_hiz_resolve_noop;
}
return false;
}
+void
+i915_hiz_resolve_noop(struct intel_context *intel,
+ struct intel_region *region)
+{
+ /* empty */
+}
+
static void
i915_invalidate_state(struct intel_context *intel, GLuint new_state)
{
i915->intel.vtbl.invalidate_state = i915_invalidate_state;
i915->intel.vtbl.render_target_supported = i915_render_target_supported;
i915->intel.vtbl.is_hiz_depth_format = i915_is_hiz_depth_format;
+ i915->intel.vtbl.hiz_resolve_depthbuffer = i915_hiz_resolve_noop;
+ i915->intel.vtbl.hiz_resolve_hizbuffer = i915_hiz_resolve_noop;
}
gen6_clip_state.c \
gen6_depthstencil.c \
gen6_gs_state.c \
+ gen6_hiz.c \
gen6_sampler_state.c \
gen6_scissor_state.c \
gen6_sf_state.c \
#include "brw_vs.h"
#include "brw_wm.h"
+#include "gen6_hiz.h"
+
#include "glsl/ralloc.h"
static void
return intel->has_hiz && (format == MESA_FORMAT_X8_Z24);
}
+static void brw_hiz_resolve_noop(struct intel_context *intel,
+ struct intel_region *depth_region)
+{
+ /* empty */
+}
void brwInitVtbl( struct brw_context *brw )
{
brw->intel.vtbl.debug_batch = brw_debug_batch;
brw->intel.vtbl.render_target_supported = brw_render_target_supported;
brw->intel.vtbl.is_hiz_depth_format = brw_is_hiz_depth_format;
+
+ if (brw->intel.has_hiz) {
+ brw->intel.vtbl.hiz_resolve_hizbuffer = gen6_hiz_resolve_hizbuffer;
+ brw->intel.vtbl.hiz_resolve_depthbuffer = gen6_hiz_resolve_depthbuffer;
+ } else {
+ brw->intel.vtbl.hiz_resolve_hizbuffer = brw_hiz_resolve_noop;
+ brw->intel.vtbl.hiz_resolve_depthbuffer = brw_hiz_resolve_noop;
+ }
}
--- /dev/null
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "gen6_hiz.h"
+
+#include <assert.h>
+
+void
+gen6_hiz_resolve_depthbuffer(struct intel_context *intel,
+ struct intel_region *depth_region)
+{
+ assert("!stub");
+}
+
+void
+gen6_hiz_resolve_hizbuffer(struct intel_context *intel,
+ struct intel_region *depth_region)
+{
+ assert("!stub");
+}
--- /dev/null
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+
+struct intel_context;
+struct intel_region;
+
+void
+gen6_hiz_resolve_depthbuffer(struct intel_context *intel,
+ struct intel_region *depth_region);
+
+void
+gen6_hiz_resolve_hizbuffer(struct intel_context *intel,
+ struct intel_region *depth_region);
/** Can HiZ be enabled on a depthbuffer of the given format? */
bool (*is_hiz_depth_format)(struct intel_context *intel,
gl_format format);
+
+ /**
+ * \name HiZ operations
+ *
+ * See the following sections of the Sandy Bridge PRM, Volume 1, Part2:
+ * - 7.5.3.1 Depth Buffer Clear
+ * - 7.5.3.2 Depth Buffer Resolve
+ * - 7.5.3.3 Hierarchical Depth Buffer Resolve
+ * \{
+ */
+ void (*hiz_resolve_depthbuffer)(struct intel_context *intel,
+ struct intel_region *depth_region);
+ void (*hiz_resolve_hizbuffer)(struct intel_context *intel,
+ struct intel_region *depth_region);
+ /** \} */
+
} vtbl;
GLbitfield Fallback; /**< mask of INTEL_FALLBACK_x bits */