upload_vs_state(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
+ uint32_t floating_point_mode = 0;
if (brw->vs.push_const_size == 0) {
/* Disable the push constant buffers. */
ADVANCE_BATCH();
}
+ /* Use ALT floating point mode for ARB vertex programs, because they
+ * require 0^0 == 1.
+ */
+ if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+ floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
+
BEGIN_BATCH(6);
OUT_BATCH(_3DSTATE_VS << 16 | (6 - 2));
OUT_BATCH(brw->vs.prog_offset);
OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) |
- GEN6_VS_FLOATING_POINT_MODE_ALT |
+ floating_point_mode |
(brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
if (brw->vs.prog_data->total_scratch) {
dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0;
dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5;
- /* OpenGL non-ieee floating point mode */
- dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT;
+ /* Use ALT floating point mode for ARB fragment programs, because they
+ * require 0^0 == 1.
+ */
+ if (ctx->Shader.CurrentFragmentProgram == NULL)
+ dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT;
/* BRW_NEW_NR_WM_SURFACES */
dw2 |= brw->wm.nr_surfaces << GEN6_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT;
upload_vs_state(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
+ uint32_t floating_point_mode = 0;
BEGIN_BATCH(2);
OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_VS << 16 | (2 - 2));
ADVANCE_BATCH();
}
+ /* Use ALT floating point mode for ARB vertex programs, because they
+ * require 0^0 == 1.
+ */
+ if (intel->ctx.Shader.CurrentVertexProgram == NULL)
+ floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT;
+
BEGIN_BATCH(6);
OUT_BATCH(_3DSTATE_VS << 16 | (6 - 2));
OUT_BATCH(brw->vs.prog_offset);
OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) |
- GEN6_VS_FLOATING_POINT_MODE_ALT |
+ floating_point_mode |
(brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
if (brw->vs.prog_data->total_scratch) {
/* BRW_NEW_NR_WM_SURFACES */
dw2 |= brw->wm.nr_surfaces << GEN7_PS_BINDING_TABLE_ENTRY_COUNT_SHIFT;
- /* OpenGL non-ieee floating point mode */
- dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
+ /* Use ALT floating point mode for ARB fragment programs, because they
+ * require 0^0 == 1.
+ */
+ if (intel->ctx.Shader.CurrentFragmentProgram == NULL)
+ dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
/* CACHE_NEW_SAMPLER */
dw4 |= (brw->max_wm_threads - 1) << GEN7_PS_MAX_THREADS_SHIFT;