KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.98k stars 823 forks source link

<textureOffset + Bias> error compilation #1770

Open HerveRV opened 5 years ago

HerveRV commented 5 years ago

(i run compilation shader with a .bat file, using "glslangValidator" program)

From nVidia VkRay SDK, rt_11_box.rchit.txt

exemple 11 : 11_DifferentVertexFormats

file : rt_11_box.rchit

line 97 :

original line :

const vec3 albedo = texture(textures[nonuniformEXT(texArrayOffset)], texcoords).rgb;

->

Compilation make no error, ok

new test line : (i use textureOffset)

const vec3 albedo = textureOffset(textures[nonuniformEXT(texArrayOffset)], texcoords, ivec2(0,0)).rgb;

->

Compilation make no error, ok

my error test line : (i add 0.0 as Bias)

const vec3 albedo = textureOffset(textures[nonuniformEXT(texArrayOffset)], texcoords, ivec2(0,0), 0.0).rgb;

->

ERROR: U:\Programmation\Vulkan\VkRayTutorials_2019_01_24\Source\Shaders\rt_11_box.rchit:99: 'textureOffset' : no matching overloaded function found

ERROR: U:\Programmation\Vulkan\VkRayTutorials_2019_01_24\Source\Shaders\rt_11_box.rchit:99: 'const' : non-matching or non-convertible constant type for const initializer

ERROR: U:\Programmation\Vulkan\VkRayTutorials_2019_01_24\Source\Shaders\rt_11_box.rchit:99: '' : compilation terminated

ERROR: 3 compilation errors. No code generated.

HerveRV commented 5 years ago

in https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html

i found : gvec4 textureOffset(gsampler2D sampler, vec2 P, ivec2 offset [, float bias] )