344.75 driver error

the following code compiles and runs on earlier version of the drive

void sendPrimitive(int p_ViewportIndex) 
{
  for (int i = 0; i < gl_in.length(); ++i) 
  {
    gl_Position = gl_in[i].gl_Position;

    if (u_NbrUserClippingPlanes > 0)
    {
      gl_ClipDistance[0] = gl_in[i].gl_ClipDistance[0];
      gl_ClipDistance[1] = gl_in[i].gl_ClipDistance[1];
      gl_ClipDistance[2] = gl_in[i].gl_ClipDistance[2];
      gl_ClipDistance[3] = gl_in[i].gl_ClipDistance[3];
    }
    vData = vgData[i];
    gl_ViewportIndex = p_ViewportIndex;
    gl_Layer = p_ViewportIndex;
    EmitVertex();
  }
  EndPrimitive();
}

but generates the error
0(100) : error C7531: global variable gl_ClipDistance requires “#extension GL_ARB_compatibility : enable” before use

on the latest driver from the copy of clip distances

If I try to enable this extension I get an error

Please post the code and error message of the corrected shader.

code compiles if I remove gl_Clipdistance

// emit a primitive for a given viewport
void sendPrimitive(int p_ViewportIndex) 
{
  for (int i = 0; i < gl_in.length(); ++i) 
  {
    gl_Position = gl_in[i].gl_Position;

    if (u_NbrUserClippingPlanes > 0)
    {
      //gl_ClipDistance[0] = gl_in[i].gl_ClipDistance[0];
      //gl_ClipDistance[1] = gl_in[i].gl_ClipDistance[1];
      //gl_ClipDistance[2] = gl_in[i].gl_ClipDistance[2];
      //gl_ClipDistance[3] = gl_in[i].gl_ClipDistance[3];
    }
    vData = vgData[i];
    gl_ViewportIndex = p_ViewportIndex;
    gl_Layer = p_ViewportIndex;
    EmitVertex();
  }
  EndPrimitive();
}

That’s not what I meant. According to the former error message you must add #extension GL_ARB_compatibility : enable to your shader code to be able to use gl_ClipDistance. But you said “If I try to enable this extension I get an error”

Now 1.) what is that new error and 2.) what is the complete(!) shader code you used when it happened?
Reproducibility is the key here. A single function won’t help.
That’s the only thing which could be investigated since the driver told you that it won’t compile the original code without the extension enabled.

I can clarify a bit more for you. This code compiles and runs on Windows 8.1 but not on Windows 7.0.

Here are the listings and errors from Windows 7.0

#version 440 
#extension GL_EXT_gpu_shader4 : enable
#extension GL_ARB_separate_shader_objects : enable
// default vertices
#define VERTEX_BINDINGS_POSITION   0
#define VERTEX_BINDINGS_COLOUR     1
#define VERTEX_BINDINGS_NORMAL     2
#define VERTEX_BINDINGS_TEXTURE0   3
#define VERTEX_BINDINGS_TEXTURE1   4
#define VERTEX_BINDINGS_TEXTURE3   6
// extras for cylinders, wedges and spheres
#define VERTEX_BINDINGS_RADIUS     2
#define VERTEX_BINDINGS_CLIP0      3
#define VERTEX_BINDINGS_CLIP1      4
#define VERTEX_BINDINGS_M0         6
#define VERTEX_BINDINGS_M1         7
#define VERTEX_BINDINGS_M2         8
// 2D vertices
// #define VERTEX_BINDINGS_POSITION   0
// #define VERTEX_BINDINGS_COLOUR     1 
#define VERTEX_BINDINGS_DARKCOLOUR 2
// #define VERTEX_BINDINGS_TEXTURE0   3
// #define VERTEX_BINDINGS_TEXTURE1   4
// #define VERTEX_BINDINGS_TEXTURE3   6



struct vertex_NC_struct
{
  vec4  colour;
  vec4	fragmentNormal;
  vec4  worldPos;
};

struct vertex_struct
{
  vec4  colour;
  vec4	fragmentNormal;
  vec2	texture0;
  vec2	texture1;
  vec4  worldPos;
};


layout(std140) uniform SharedSunlightBuffer
{
  mat4 u_SunlightProjection;        // sunlight to screen projection
  mat4 u_SunlightModelView;         // model to sun
  mat4 u_LightVPSBMatrices[4];      // camera to light view-model-proj matrix for cascade
  vec4 u_NormalizedFarPlanes;       // far planes for cascaded shadow map
  vec4 u_LightDirection;            // light direction
  vec4 u_Viewport[4];               // viewports for frustrum
  vec4 u_Ambient;
  vec4 u_AmbientLightLevel;
  vec4 u_Rayleigh;
  vec4 u_Mie;
  vec4 u_ESun;
  vec4 u_Sum;
};



#define MAX_CAMERA_FRUSTUM_SPLIT_COUNT  4
#define LIGHT_TEXTURE_SIZE              4096

layout(triangles) in;
layout(triangle_strip, max_vertices = 12) out;

uniform int   u_NbrUserClippingPlanes;

in  vertex_struct    vgData[];
out vertex_struct    vData;

// converts clip coordinates into window coordinates for a given viewport
vec2 getWindowPos(vec4 clip_Pos, uint viewport) 
{
  vec2 ndc_Pos = (clip_Pos.xy / clip_Pos.w); // -1 to 1
  vec2 blend_factor = (ndc_Pos + 1.0) * 0.5; // 0 to 1
  vec2 view_Pos = (u_Viewport[viewport].zw * blend_factor) + u_Viewport[viewport].xy;
  return view_Pos;
}

// checks if two 2d bounding boxes intersect
bool checkIntersection(vec4 bbox0, vec4 bbox1) 
{
  bool xmiss = bbox0.x > bbox1.z || bbox0.z < bbox1.x;
  bool ymiss = bbox0.y > bbox1.w || bbox0.w < bbox1.y;
  return !xmiss && !ymiss;
}

// emit a primitive for a given viewport
void sendPrimitive(int p_ViewportIndex) 
{
  for (int i = 0; i < gl_in.length(); ++i) 
  {
    gl_Position = gl_in[i].gl_Position;

    if (u_NbrUserClippingPlanes > 0)
    {
      gl_ClipDistance[0] = gl_in[i].gl_ClipDistance[0];
      gl_ClipDistance[1] = gl_in[i].gl_ClipDistance[1];
      gl_ClipDistance[2] = gl_in[i].gl_ClipDistance[2];
      gl_ClipDistance[3] = gl_in[i].gl_ClipDistance[3];
    }
    vData = vgData[i];
    gl_ViewportIndex = p_ViewportIndex;
    gl_Layer = p_ViewportIndex;
    EmitVertex();
  }
  EndPrimitive();
}

void main(void) 
{
  const vec4 mapBounds = vec4(0, 0, LIGHT_TEXTURE_SIZE, LIGHT_TEXTURE_SIZE);
  for (int segment = 0; segment < MAX_CAMERA_FRUSTUM_SPLIT_COUNT; ++segment) 
  {
    vec2 start_Pos = getWindowPos(gl_in[0].gl_Position, segment);
    vec4 primBounds = vec4(start_Pos, start_Pos); // minx, miny, maxx, maxy
    for (int i = 1; i < gl_in.length(); ++i) 
    {
      vec2 window_Pos = getWindowPos(gl_in[i].gl_Position, segment);
      primBounds.x = min(primBounds.x, window_Pos.x);
      primBounds.y = min(primBounds.y, window_Pos.y);
      primBounds.z = max(primBounds.x, window_Pos.x);
      primBounds.w = max(primBounds.y, window_Pos.y);
    }
    // we should only emit the primitive if its bounding box intersects the current viewport
//    if (checkIntersection(primBounds, mapBounds)) 
    {
      sendPrimitive(segment);
    }

  }
}

0(100) : error C7531: global variable gl_ClipDistance requires "#extension GL_ARB_compatibility : enable" before use
Shader compile failed12dViewerd.exe has triggered a breakpoint.

other version

#version 440 
#extension GL_ARB_compatibility : enable
#extension GL_EXT_gpu_shader4 : enable
#extension GL_ARB_separate_shader_objects : enable
// default vertices
#define VERTEX_BINDINGS_POSITION   0
#define VERTEX_BINDINGS_COLOUR     1
#define VERTEX_BINDINGS_NORMAL     2
#define VERTEX_BINDINGS_TEXTURE0   3
#define VERTEX_BINDINGS_TEXTURE1   4
#define VERTEX_BINDINGS_TEXTURE3   6
// extras for cylinders, wedges and spheres
#define VERTEX_BINDINGS_RADIUS     2
#define VERTEX_BINDINGS_CLIP0      3
#define VERTEX_BINDINGS_CLIP1      4
#define VERTEX_BINDINGS_M0         6
#define VERTEX_BINDINGS_M1         7
#define VERTEX_BINDINGS_M2         8
// 2D vertices
// #define VERTEX_BINDINGS_POSITION   0
// #define VERTEX_BINDINGS_COLOUR     1 
#define VERTEX_BINDINGS_DARKCOLOUR 2
// #define VERTEX_BINDINGS_TEXTURE0   3
// #define VERTEX_BINDINGS_TEXTURE1   4
// #define VERTEX_BINDINGS_TEXTURE3   6



struct vertex_NC_struct
{
  vec4  colour;
  vec4	fragmentNormal;
  vec4  worldPos;
};

struct vertex_struct
{
  vec4  colour;
  vec4	fragmentNormal;
  vec2	texture0;
  vec2	texture1;
  vec4  worldPos;
};


layout(std140) uniform SharedSunlightBuffer
{
  mat4 u_SunlightProjection;        // sunlight to screen projection
  mat4 u_SunlightModelView;         // model to sun
  mat4 u_LightVPSBMatrices[4];      // camera to light view-model-proj matrix for cascade
  vec4 u_NormalizedFarPlanes;       // far planes for cascaded shadow map
  vec4 u_LightDirection;            // light direction
  vec4 u_Viewport[4];               // viewports for frustrum
  vec4 u_Ambient;
  vec4 u_AmbientLightLevel;
  vec4 u_Rayleigh;
  vec4 u_Mie;
  vec4 u_ESun;
  vec4 u_Sum;
};



#define MAX_CAMERA_FRUSTUM_SPLIT_COUNT  4
#define LIGHT_TEXTURE_SIZE              4096

layout(triangles) in;
layout(triangle_strip, max_vertices = 12) out;

uniform int   u_NbrUserClippingPlanes;

in  vertex_struct    vgData[];
out vertex_struct    vData;

// converts clip coordinates into window coordinates for a given viewport
vec2 getWindowPos(vec4 clip_Pos, uint viewport) 
{
  vec2 ndc_Pos = (clip_Pos.xy / clip_Pos.w); // -1 to 1
  vec2 blend_factor = (ndc_Pos + 1.0) * 0.5; // 0 to 1
  vec2 view_Pos = (u_Viewport[viewport].zw * blend_factor) + u_Viewport[viewport].xy;
  return view_Pos;
}

// checks if two 2d bounding boxes intersect
bool checkIntersection(vec4 bbox0, vec4 bbox1) 
{
  bool xmiss = bbox0.x > bbox1.z || bbox0.z < bbox1.x;
  bool ymiss = bbox0.y > bbox1.w || bbox0.w < bbox1.y;
  return !xmiss && !ymiss;
}

// emit a primitive for a given viewport
void sendPrimitive(int p_ViewportIndex) 
{
  for (int i = 0; i < gl_in.length(); ++i) 
  {
    gl_Position = gl_in[i].gl_Position;

    if (u_NbrUserClippingPlanes > 0)
    {
      gl_ClipDistance[0] = gl_in[i].gl_ClipDistance[0];
      gl_ClipDistance[1] = gl_in[i].gl_ClipDistance[1];
      gl_ClipDistance[2] = gl_in[i].gl_ClipDistance[2];
      gl_ClipDistance[3] = gl_in[i].gl_ClipDistance[3];
    }
    vData = vgData[i];
    gl_ViewportIndex = p_ViewportIndex;
    gl_Layer = p_ViewportIndex;
    EmitVertex();
  }
  EndPrimitive();
}

void main(void) 
{
  const vec4 mapBounds = vec4(0, 0, LIGHT_TEXTURE_SIZE, LIGHT_TEXTURE_SIZE);
  for (int segment = 0; segment < MAX_CAMERA_FRUSTUM_SPLIT_COUNT; ++segment) 
  {
    vec2 start_Pos = getWindowPos(gl_in[0].gl_Position, segment);
    vec4 primBounds = vec4(start_Pos, start_Pos); // minx, miny, maxx, maxy
    for (int i = 1; i < gl_in.length(); ++i) 
    {
      vec2 window_Pos = getWindowPos(gl_in[i].gl_Position, segment);
      primBounds.x = min(primBounds.x, window_Pos.x);
      primBounds.y = min(primBounds.y, window_Pos.y);
      primBounds.z = max(primBounds.x, window_Pos.x);
      primBounds.w = max(primBounds.y, window_Pos.y);
    }
    // we should only emit the primitive if its bounding box intersects the current viewport
//    if (checkIntersection(primBounds, mapBounds)) 
    {
      sendPrimitive(segment);
    }

  }
}

0(3) : error C0207: ARB_compatibility is not supported in GLSL version 440. Use compatibility profile.
Shader compile failed12dViewerd.exe has triggered a breakpoint.

Thanks, would you please also add the exact hardware configurations of the two systems?
That information is required to be able to setup a matching reproducer.

  1. Operating system version and bitness.
  2. Graphics hardware. (All installed GPUs.)
  3. Graphics driver version.
  4. Display Control Panel settings for screen resolution, monitor configs, and driver settings.

Under Windows the resulting text file after NVIDIA Control Panel -> Help -> System Information -> Save contains the information for 1 to 3.

If it’s the same machine just booting the different OSes, 2., 3., 4. are only needed once if the settings are identical.

I am just dual booting with the same driver installed in Windows 7 and Windows 8.1. It is a 3 monitor system 2 Benq G2420HD and a Benq GL2440H setup as a continuous screen all at 1920 x 1080. I have the default driver setting from the install.

NVIDIA System Information report created on: 01/10/2015 12:11:26
System name: GRUNT81

[Display]
Operating System:	Windows 8.1 Pro, 64-bit
DirectX version:	11.0 
GPU processor:		GeForce GTX 770
Driver version:		340.52
Direct3D API version:	11.1
Direct3D feature level:	11_0
CUDA Cores:		1536 
Core clock:		1137 MHz 
Memory data rate:	7010 MHz
Memory interface:	256-bit 
Memory bandwidth:	224.32 GB/s
Total available graphics memory:	16379 MB
Dedicated video memory:	4096 MB GDDR5
System video memory:	0 MB
Shared system memory:	12283 MB
Video BIOS version:	80.04.BC.00.0F
IRQ:			35
Bus:			PCI Express x16 Gen2
Device Id:		10DE 1184 36061458
Part Number:		2005 0000

[Components]

NvUpdt.dll		10.4.0.4		NVIDIA Update
nvui.dll		8.17.13.4052		NVIDIA User Experience Driver Component
nvxdsync.exe		8.17.13.4052		NVIDIA User Experience Driver Component
nvxdplcy.dll		8.17.13.4052		NVIDIA User Experience Driver Component
nvxdbat.dll		8.17.13.4052		NVIDIA User Experience Driver Component
nvxdapix.dll		8.17.13.4052		NVIDIA User Experience Driver Component
NVCPL.DLL		8.17.13.4052		NVIDIA User Experience Driver Component
nvCplUIR.dll		7.8.760.0		NVIDIA Control Panel
nvCplUI.exe		7.8.760.0		NVIDIA Control Panel
nvWSSR.dll		6.14.13.4052		NVIDIA Workstation Server
nvWSS.dll		6.14.13.4052		NVIDIA Workstation Server
nvViTvSR.dll		6.14.13.4052		NVIDIA Video Server
nvViTvS.dll		6.14.13.4052		NVIDIA Video Server
NVSTVIEW.EXE		7.17.13.4052		NVIDIA 3D Vision Photo Viewer
NVSTTEST.EXE		7.17.13.4052		NVIDIA 3D Vision Test Application
NVSTRES.DLL		7.17.13.4052		NVIDIA 3D Vision Module
nvDispSR.dll		6.14.13.4052		NVIDIA Display Server
NVMCTRAY.DLL		8.17.13.4052		NVIDIA Media Center Library
nvDispS.dll		6.14.13.4052		NVIDIA Display Server
NVCUDA.DLL		8.17.13.4052		NVIDIA CUDA 6.5.12 driver
nvGameSR.dll		6.14.13.4052		NVIDIA 3D Settings Server
nvGameS.dll		6.14.13.4052		NVIDIA 3D Settings Server

The system is a dual Xeon X5650 with 24GB