i915: Add an option for testing the effect of early Z in classic mode.
The early Z stuff is supposed to be unsafe without some more work in the enable/disable path (in particular, how do we want to get it disabled on the way out to the X Server?), but at the moment is 6% in OA.
This commit is contained in:
@@ -141,6 +141,7 @@
|
|||||||
/* p161 */
|
/* p161 */
|
||||||
#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16))
|
#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16))
|
||||||
/* Dword 1 */
|
/* Dword 1 */
|
||||||
|
#define CLASSIC_EARLY_DEPTH (1<<31)
|
||||||
#define TEX_DEFAULT_COLOR_OGL (0<<30)
|
#define TEX_DEFAULT_COLOR_OGL (0<<30)
|
||||||
#define TEX_DEFAULT_COLOR_D3D (1<<30)
|
#define TEX_DEFAULT_COLOR_D3D (1<<30)
|
||||||
#define ZR_EARLY_DEPTH (1<<29)
|
#define ZR_EARLY_DEPTH (1<<29)
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include "intel_regions.h"
|
#include "intel_regions.h"
|
||||||
#include "intel_tris.h"
|
#include "intel_tris.h"
|
||||||
#include "intel_fbo.h"
|
#include "intel_fbo.h"
|
||||||
|
#include "intel_chipset.h"
|
||||||
|
|
||||||
#include "i915_reg.h"
|
#include "i915_reg.h"
|
||||||
#include "i915_context.h"
|
#include "i915_context.h"
|
||||||
@@ -611,6 +612,14 @@ i915_state_draw_region(struct intel_context *intel,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This isn't quite safe, thus being hidden behind an option. When changing
|
||||||
|
* the value of this bit, the pipeline needs to be MI_FLUSHed. And it
|
||||||
|
* can only be set when a depth buffer is already defined.
|
||||||
|
*/
|
||||||
|
if (IS_945(intel->intelScreen->deviceID) && intel->use_early_z &&
|
||||||
|
depth_region->tiling != I915_TILING_NONE)
|
||||||
|
value |= CLASSIC_EARLY_DEPTH;
|
||||||
|
|
||||||
if (depth_region && depth_region->cpp == 4) {
|
if (depth_region && depth_region->cpp == 4) {
|
||||||
value |= DEPTH_FRMT_24_FIXED_8_OTHER;
|
value |= DEPTH_FRMT_24_FIXED_8_OTHER;
|
||||||
}
|
}
|
||||||
|
@@ -729,6 +729,7 @@ intelInitContext(struct intel_context *intel,
|
|||||||
}
|
}
|
||||||
intel->use_texture_tiling = driQueryOptionb(&intel->optionCache,
|
intel->use_texture_tiling = driQueryOptionb(&intel->optionCache,
|
||||||
"texture_tiling");
|
"texture_tiling");
|
||||||
|
intel->use_early_z = driQueryOptionb(&intel->optionCache, "early_z");
|
||||||
|
|
||||||
intel->prim.primitive = ~0;
|
intel->prim.primitive = ~0;
|
||||||
|
|
||||||
|
@@ -306,6 +306,7 @@ struct intel_context
|
|||||||
GLboolean is_front_buffer_rendering;
|
GLboolean is_front_buffer_rendering;
|
||||||
|
|
||||||
GLboolean use_texture_tiling;
|
GLboolean use_texture_tiling;
|
||||||
|
GLboolean use_early_z;
|
||||||
|
|
||||||
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
|
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
|
||||||
|
|
||||||
|
@@ -75,6 +75,10 @@ PUBLIC const char __driConfigOptions[] =
|
|||||||
DRI_CONF_TEXTURE_TILING(true)
|
DRI_CONF_TEXTURE_TILING(true)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DRI_CONF_OPT_BEGIN(early_z, bool, false)
|
||||||
|
DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
|
||||||
|
DRI_CONF_OPT_END
|
||||||
|
|
||||||
DRI_CONF_SECTION_END
|
DRI_CONF_SECTION_END
|
||||||
DRI_CONF_SECTION_QUALITY
|
DRI_CONF_SECTION_QUALITY
|
||||||
DRI_CONF_FORCE_S3TC_ENABLE(false)
|
DRI_CONF_FORCE_S3TC_ENABLE(false)
|
||||||
@@ -87,7 +91,7 @@ PUBLIC const char __driConfigOptions[] =
|
|||||||
DRI_CONF_SECTION_END
|
DRI_CONF_SECTION_END
|
||||||
DRI_CONF_END;
|
DRI_CONF_END;
|
||||||
|
|
||||||
const GLuint __driNConfigOptions = 9;
|
const GLuint __driNConfigOptions = 10;
|
||||||
|
|
||||||
#ifdef USE_NEW_INTERFACE
|
#ifdef USE_NEW_INTERFACE
|
||||||
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
|
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
|
||||||
|
Reference in New Issue
Block a user