Commit 6373574b by John Kessenich

Front-end: Fix: Cubemap arrays only use 3-component coord when accessed as an image.

4 components are needed when used a texture, but not an image, which multiplies layers and faces into the same coordinate. This fixes it from using 4 everywhere, to only using 4 for textures and 3 for images.
parent 3cd0024e
...@@ -265,6 +265,10 @@ uniform writeonly imageCubeArray CA1; ...@@ -265,6 +265,10 @@ uniform writeonly imageCubeArray CA1;
uniform writeonly iimageCubeArray CA2; uniform writeonly iimageCubeArray CA2;
uniform writeonly uimageCubeArray CA3; uniform writeonly uimageCubeArray CA3;
layout(rgba16f) uniform readonly imageCubeArray rCA1;
layout(rgba32i) uniform readonly iimageCubeArray rCA2;
layout(r32ui) uniform readonly uimageCubeArray rCA3;
#ifdef GL_OES_texture_cube_map_array #ifdef GL_OES_texture_cube_map_array
uniform samplerCubeArray CA4; uniform samplerCubeArray CA4;
uniform samplerCubeArrayShadow CA5; uniform samplerCubeArrayShadow CA5;
...@@ -304,6 +308,14 @@ void CAT() ...@@ -304,6 +308,14 @@ void CAT()
highp ivec3 s1 = imageSize(CA1); highp ivec3 s1 = imageSize(CA1);
highp ivec3 s2 = imageSize(CA2); highp ivec3 s2 = imageSize(CA2);
highp ivec3 s3 = imageSize(CA3); highp ivec3 s3 = imageSize(CA3);
imageStore(CA1, s3, vec4(1));
imageStore(CA2, s3, ivec4(1));
imageStore(CA3, s3, uvec4(1));
highp vec4 cl1 = imageLoad(rCA1, s3);
highp ivec4 cl2 = imageLoad(rCA2, s3);
highp uvec4 cl3 = imageLoad(rCA3, s3);
} }
uniform sampler2DMSArray bad2DMS; // ERROR, reserved uniform sampler2DMSArray bad2DMS; // ERROR, reserved
......
...@@ -51,8 +51,8 @@ void main() ...@@ -51,8 +51,8 @@ void main()
imageStore(i3D, ic3D, v); imageStore(i3D, ic3D, v);
v += imageLoad(iCube, ic3D); v += imageLoad(iCube, ic3D);
imageStore(iCube, ic3D, v); imageStore(iCube, ic3D, v);
v += imageLoad(iCubeArray, ic4D); v += imageLoad(iCubeArray, ic3D);
imageStore(iCubeArray, ic4D, v); imageStore(iCubeArray, ic3D, v);
v += imageLoad(i2DRect, ic2D); v += imageLoad(i2DRect, ic2D);
imageStore(i2DRect, ic2D, v); imageStore(i2DRect, ic2D, v);
v += imageLoad(i1DArray, ic2D); v += imageLoad(i1DArray, ic2D);
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits. // For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run). // For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "3.0.776" #define GLSLANG_REVISION "3.0.777"
#define GLSLANG_DATE "30-Sep-2015" #define GLSLANG_DATE "01-Oct-2015"
...@@ -2024,7 +2024,11 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi ...@@ -2024,7 +2024,11 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi
// //
void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile)
{ {
int dims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); int dims = dimMap[sampler.dim];
// most things with an array add a dimension, except for cubemaps
if (sampler.arrayed && sampler.dim != EsdCube)
++dims;
TString imageParams = typeName; TString imageParams = typeName;
if (dims == 1) if (dims == 1)
imageParams.append(", int"); imageParams.append(", int");
......
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