<commit_before>// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_TEXTURE_H
#define VSNRAY_TEXTURE_H 1

#include <visionaray/detail/macros.h>

#ifdef __CUDACC__
#include "detail/cuda_texture.h"
#endif

#include "detail/prefilter.h"
#include "detail/sampler1d.h"
#include "detail/sampler2d.h"
#include "detail/sampler3d.h"
#include "detail/texture1d.h"
#include "detail/texture2d.h"
#include "detail/texture3d.h"


namespace visionaray
{

template <typename Tex, typename FloatT>
inline auto tex1D(Tex const& tex, FloatT const& coord)
    -> decltype( detail::tex1D(tex, coord) )
{
    static_assert(Tex::dimensions == 1, "Incompatible texture type");

    return detail::tex1D( tex, coord );
}


template <typename Tex, typename FloatT>
inline auto tex2D(Tex const& tex, vector<2, FloatT> const& coord)
    -> decltype( detail::tex2D(tex, coord) )
{
    static_assert(Tex::dimensions == 2, "Incompatible texture type");

    return detail::tex2D( tex, coord );
}


template <typename Tex, typename FloatT>
inline auto tex3D(Tex const& tex, vector<3, FloatT> const& coord)
    -> decltype( detail::tex3D(tex, coord) )
{
    static_assert(Tex::dimensions == 3, "Incompatible texture type");

    return detail::tex3D( tex, coord );
}


#ifdef __CUDACC__

template <
    typename T,
    cudaTextureReadMode ReadMode = cudaTextureReadMode(detail::tex_read_mode_from_type<T>::value)
    ><commit_msg>Assert that texture coords are normalized on CPU<commit_after>// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_TEXTURE_H
#define VSNRAY_TEXTURE_H 1

#include <visionaray/detail/macros.h>

#ifdef __CUDACC__
#include "detail/cuda_texture.h"
#endif

#include "detail/prefilter.h"
#include "detail/sampler1d.h"
#include "detail/sampler2d.h"
#include "detail/sampler3d.h"
#include "detail/texture1d.h"
#include "detail/texture2d.h"
#include "detail/texture3d.h"


namespace visionaray
{

template <typename Tex, typename FloatT>
inline auto tex1D(Tex const& tex, FloatT const& coord)
    -> decltype( detail::tex1D(tex, coord) )
{
    static_assert(Tex::dimensions == 1, "Incompatible texture type");

    assert(tex.get_normalized_coords() && "Unnormalized coordinates on CPU not implemented yet");

    return detail::tex1D( tex, coord );
}


template <typename Tex, typename FloatT>
inline auto tex2D(Tex const& tex, vector<2, FloatT> const& coord)
    -> decltype( detail::tex2D(tex, coord) )
{
    static_assert(Tex::dimensions == 2, "Incompatible texture type");

    assert(tex.get_normalized_coords() && "Unnormalized coordinates on CPU not implemented yet");

    return detail::tex2D( tex, coord );
}


template <typename Tex, typename FloatT>
inline auto tex3D(Tex const& tex, vector<3, FloatT> const& coord)
    -> decltype( detail::tex3D(tex, coord) )
{
    static_assert(Tex::dimensions == 3, "Incompatible texture type");

    assert(tex.get_normalized_coords() && "Unnormalized coordinates on CPU not implemented yet");

    return detail::tex3D( tex, coord );
}


#ifdef __CUDACC__

template <
    typename T,
    cudaTextureReadMode ReadMode = cudaTextureReadMode(detail::tex_read_mode_from_type<T>::value)
    >
{'fraction_non_alphanumeric': 0.12285012285012285, 'fraction_numerical': 0.012899262899262898, 'mean_word_length': 4.9761467889908255, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6702264', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1085, 'n_words': 291}