Commit 286d9ab6 authored by bonnell's avatar bonnell

Modified SLIVR renderer to return early if shaders aren't supported. Added...

Modified SLIVR renderer to return early if shaders aren't supported. Added special warning for non-support of Intel drivers. This prevents crash on Windows with Intel drivers, resolving #1656.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@22606 18c085ea-50e0-402c-830e-de6fd14e8384
parent e5d2add9
......@@ -364,6 +364,9 @@ avtOpenGLSLIVRVolumeRenderer::OnlyLightingFlagIsDifferent(
// Brad Whitlock, Wed Apr 22 12:10:06 PDT 2009
// I changed the interface.
//
// Kathleen Biagas, Thu Jan 9 16:29:43 PST 2014
// Added early return and intel-specific warning message.
//
// ****************************************************************************
void
......@@ -372,7 +375,7 @@ avtOpenGLSLIVRVolumeRenderer::Render(
const avtVolumeRendererImplementation::VolumeData &volume)
{
const char *mName = "avtOpenGLSLIVRVolumeRenderer::Render: ";
static bool haveIssuedWarning = false;
// Initializes SLIVR shaders and GLEW.
if(!slivrInit)
{
......@@ -381,6 +384,25 @@ avtOpenGLSLIVRVolumeRenderer::Render(
slivrInit = true;
}
if (SLIVR::ShaderProgramARB::shaders_supported() == false)
{
if (!haveIssuedWarning)
{
std::stringstream sstr;
if (SLIVR::ShaderProgramARB::isGFXIntel())
{
sstr << "SLIVR currently does not support Intel graphics cards.";
}
else
{
sstr << "SLIVR uses shaders which your graphics card does not support.";
}
avtCallback::IssueWarning(sstr.str().c_str());
haveIssuedWarning = true;
}
return;
}
// Get the sampling rate that the renderer will use.
float samplingRate = props.atts.GetRendererSamples();
if(samplingRate < 1.f)
......
......@@ -70,7 +70,7 @@ ShaderProgramARB::valid()
}
bool
ShaderProgramARB::init_shaders_supported(std::string& error)
ShaderProgramARB::init_shaders_supported(std::string& error, bool forceIntel)
{
if (!init_)
{
......@@ -105,7 +105,8 @@ ShaderProgramARB::init_shaders_supported(std::string& error)
// support shaders but crash when you try to use them. This
// covers the Intel integrated chipsets in most laptops.
const GLubyte* glRendererString = glGetString(GL_RENDERER);
if (strncmp((const char *)glRendererString, "Intel", 5) == 0)
if (strncmp((const char *)glRendererString, "Intel", 5) == 0 &&
!forceIntel)
{
supported_ = false;
}
......@@ -182,7 +183,16 @@ ShaderProgramARB::init_shaders_supported(std::string& error)
}
return (true);
}
bool
ShaderProgramARB::isGFXIntel()
{
const GLubyte* glRendererString = glGetString(GL_RENDERER);
if (strncmp((const char *)glRendererString, "Intel", 5) == 0)
return true;
else
return false;
}
bool
ShaderProgramARB::shaders_supported()
......
......@@ -55,7 +55,8 @@ class SLIVRSHARE ShaderProgramARB
void setLocalParam(int, float, float, float, float);
// Call init_shaders_supported before shaders_supported queries!
static bool init_shaders_supported(std::string& error);
static bool init_shaders_supported(std::string& error, bool forceIntel = false);
static bool isGFXIntel();
static bool shaders_supported();
static bool initialized();
......
......@@ -628,7 +628,7 @@ TextureRenderer::draw_polygons_wireframe(vector<float>& vertex,
void
TextureRenderer::build_colormap1(vector<float> cmap_array,
TextureRenderer::build_colormap1(vector<float> &cmap_array,
unsigned int& cmap_tex, bool& cmap_dirty,
bool& alpha_dirty, double level_exponent)
{
......@@ -984,7 +984,7 @@ TextureRenderer::build_colormap2()
}
void
TextureRenderer::bind_colormap1(vector<float> cmap_array,
TextureRenderer::bind_colormap1(vector<float> &cmap_array,
unsigned int cmap_tex)
{
#if defined( GL_TEXTURE_COLOR_TABLE_SGI ) && defined(__sgi)
......
......@@ -149,7 +149,7 @@ protected:
bool normal, bool fog,
vector<int> *mask=0);
void build_colormap1(vector<float> cmap_array,
void build_colormap1(vector<float> &cmap_array,
unsigned int& cmap_tex, bool& cmap_dirty,
bool& alpha_dirty, double level_exponent = 0.0);
......@@ -159,7 +159,7 @@ protected:
void colormap2_hardware_rasterize();
void bind_colormap1(vector<float> cmap_array, unsigned int cmap_tex);
void bind_colormap1(vector<float> &cmap_array, unsigned int cmap_tex);
void bind_colormap2();
void release_colormap1();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment