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.
This commit is contained in:
parent
3cd0024ea8
commit
6373574b13
6 changed files with 940 additions and 833 deletions
|
|
@ -2024,7 +2024,11 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi
|
|||
//
|
||||
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;
|
||||
if (dims == 1)
|
||||
imageParams.append(", int");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue