summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2007-07-29 18:04:28 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2007-07-29 18:09:35 +0200
commita188ba4bf9364df24842d8727f4c7ddb2f894a2c (patch)
tree89a82858e3f952131e1334c507c1c25c537f9934 /src/mesa/drivers
parent35f35294cd5cc3ca32354b1de0e398ad73c70716 (diff)
Fix crashes when the frag prog can't be handled in hardware (#11131)
Must not change to/from swrast after Render.Start or bad things will happen. (Driver will still somewhat incorrectly report an implementation error, and apps can't really figure out if a prog is natively supported as validation is later - could try doing it earlier to give some hint at least, even though native status may still change later due to fog etc.)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c6
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_vtbl.c8
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h1
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_render.c2
4 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index e432648ada0..a3db6c0c0cd 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -61,6 +61,11 @@ do { \
#define TEXBIND_SET(n, x) ((x)<<((n)*4))
static void
+i830_render_prevalidate(struct intel_context *intel)
+{
+}
+
+static void
i830_render_start(struct intel_context *intel)
{
GLcontext *ctx = &intel->ctx;
@@ -657,5 +662,6 @@ i830InitVtbl(struct i830_context *i830)
i830->intel.vtbl.update_texture_state = i830UpdateTextureState;
i830->intel.vtbl.flush_cmd = i830_flush_cmd;
i830->intel.vtbl.render_start = i830_render_start;
+ i830->intel.vtbl.render_prevalidate = i830_render_prevalidate;
i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty;
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
index ad333b490b7..9de35d8e297 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -44,13 +44,18 @@
#include "i915_context.h"
static void
-i915_render_start(struct intel_context *intel)
+i915_render_prevalidate(struct intel_context *intel)
{
struct i915_context *i915 = i915_context(&intel->ctx);
i915ValidateFragmentProgram(i915);
}
+static void
+i915_render_start(struct intel_context *intel)
+{
+}
+
static void
i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
@@ -546,6 +551,7 @@ i915InitVtbl(struct i915_context *i915)
i915->intel.vtbl.lost_hardware = i915_lost_hardware;
i915->intel.vtbl.reduced_primitive_state = i915_reduced_primitive_state;
i915->intel.vtbl.render_start = i915_render_start;
+ i915->intel.vtbl.render_prevalidate = i915_render_prevalidate;
i915->intel.vtbl.set_draw_region = i915_set_draw_region;
i915->intel.vtbl.update_texture_state = i915UpdateTextureState;
i915->intel.vtbl.flush_cmd = i915_flush_cmd;
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index 9d060eb866f..ddd1439b004 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -131,6 +131,7 @@ struct intel_context
void (*update_texture_state) (struct intel_context * intel);
void (*render_start) (struct intel_context * intel);
+ void (*render_prevalidate) (struct intel_context * intel);
void (*set_draw_region) (struct intel_context * intel,
struct intel_region * draw_region,
struct intel_region * depth_region);
diff --git a/src/mesa/drivers/dri/i915tex/intel_render.c b/src/mesa/drivers/dri/i915tex/intel_render.c
index f9fa55051ea..c8b6d308d96 100644
--- a/src/mesa/drivers/dri/i915tex/intel_render.c
+++ b/src/mesa/drivers/dri/i915tex/intel_render.c
@@ -202,6 +202,8 @@ intel_run_render(GLcontext * ctx, struct tnl_pipeline_stage *stage)
struct vertex_buffer *VB = &tnl->vb;
GLuint i;
+ intel->vtbl.render_prevalidate( intel );
+
/* Don't handle clipping or indexed vertices.
*/
if (intel->RenderIndex != 0 ||