File: samplerlessTextureFunctions.frag

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (46 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#version 450 core

layout(binding = 1) uniform texture2D tex2D;
layout(binding = 1) uniform texture2DMS texMS;
layout(binding = 0) uniform textureBuffer buf;

void testBad()
{
    vec4 tex2DFetch = texelFetch(tex2D, ivec2(0, 0), 0);
    vec4 texMSFetch = texelFetch(texMS, ivec2(0, 0), 0);

    // Allowed by KHR_vulkan_glsl without the extension. All others should
    // error.
    vec4 bufFetch = texelFetch(buf, 0);

    vec4 tex2DFetchOffset = texelFetchOffset(tex2D, ivec2(0, 0), 0, ivec2(0, 0));

    ivec2 tex2DSize = textureSize(tex2D, 0);
    ivec2 texMSSize = textureSize(texMS);
    int bufSize = textureSize(buf);

    int tex2DLevels = textureQueryLevels(tex2D);

    int texMSSamples = textureSamples(texMS);
}

#extension GL_EXT_samplerless_texture_functions : enable

void main()
{
    // These should all succeed.

    vec4 tex2DFetch = texelFetch(tex2D, ivec2(0, 0), 0);
    vec4 texMSFetch = texelFetch(texMS, ivec2(0, 0), 0);
    vec4 bufFetch = texelFetch(buf, 0);

    vec4 tex2DFetchOffset = texelFetchOffset(tex2D, ivec2(0, 0), 0, ivec2(0, 0));

    ivec2 tex2DSize = textureSize(tex2D, 0);
    ivec2 texMSSize = textureSize(texMS);
    int bufSize = textureSize(buf);

    int tex2DLevels = textureQueryLevels(tex2D);

    int texMSSamples = textureSamples(texMS);
}