Vulkan-Hpp
SeparateImageSampler.cpp File Reference
#include "../utils/geometries.hpp"
#include "../utils/math.hpp"
#include "../utils/shaders.hpp"
#include "../utils/utils.hpp"
#include "SPIRV/GlslangToSpv.h"
#include <iostream>
#include <thread>

Go to the source code of this file.

Functions

int main (int, char **)
 

Variables

const std::string fragmentShaderTextTS_T_C
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 68 of file SeparateImageSampler.cpp.

Variable Documentation

◆ fragmentShaderTextTS_T_C

const std::string fragmentShaderTextTS_T_C
Initial value:
= R"(
#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (set = 0, binding = 1) uniform texture2D tex;
layout (set = 0, binding = 2) uniform sampler samp;
layout (location = 0) in vec2 inTexCoords;
layout (location = 0) out vec4 outColor;
void main()
{
// Combine the selected texture with sampler as a parameter
vec4 resColor = texture(sampler2D(tex, samp), inTexCoords);
// Create a border to see the cube more easily
if ((inTexCoords.x < 0.01f) || (0.99f < inTexCoords.x)
|| (inTexCoords.y < 0.01f) || (0.99f < inTexCoords.y))
{
resColor *= vec4(0.1f, 0.1f, 0.1f, 1.0f);
}
outColor = resColor;
}
)"

Definition at line 39 of file SeparateImageSampler.cpp.