*
*/
+#include "glsl_types.h"
#include "vtn_private.h"
#include "nir/nir_vla.h"
#include "nir/nir_control_flow.h"
case SpvOpImageSparseSampleImplicitLod:
case SpvOpImageSampleDrefImplicitLod:
case SpvOpImageSparseSampleDrefImplicitLod:
+ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_BUF &&
+ sampler_dim != GLSL_SAMPLER_DIM_MS &&
+ sampler_dim != GLSL_SAMPLER_DIM_SUBPASS_MS);
+ texop = nir_texop_tex;
+ break;
+
case SpvOpImageSampleProjImplicitLod:
case SpvOpImageSampleProjDrefImplicitLod:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_RECT);
+ vtn_assert(!is_array);
texop = nir_texop_tex;
break;
case SpvOpImageSparseSampleExplicitLod:
case SpvOpImageSampleDrefExplicitLod:
case SpvOpImageSparseSampleDrefExplicitLod:
+ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_BUF &&
+ sampler_dim != GLSL_SAMPLER_DIM_MS &&
+ sampler_dim != GLSL_SAMPLER_DIM_SUBPASS_MS);
+ texop = nir_texop_txl;
+ break;
+
case SpvOpImageSampleProjExplicitLod:
case SpvOpImageSampleProjDrefExplicitLod:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_RECT);
+ vtn_assert(!is_array);
texop = nir_texop_txl;
break;
case SpvOpImageFetch:
case SpvOpImageSparseFetch:
+ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_CUBE);
if (sampler_dim == GLSL_SAMPLER_DIM_MS) {
texop = nir_texop_txf_ms;
} else {
case SpvOpImageSparseGather:
case SpvOpImageDrefGather:
case SpvOpImageSparseDrefGather:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_CUBE ||
+ sampler_dim == GLSL_SAMPLER_DIM_RECT);
texop = nir_texop_tg4;
break;
case SpvOpImageQuerySizeLod:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_CUBE);
+ texop = nir_texop_txs;
+ dest_type = nir_type_int32;
+ break;
+
case SpvOpImageQuerySize:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_CUBE ||
+ sampler_dim == GLSL_SAMPLER_DIM_RECT ||
+ sampler_dim == GLSL_SAMPLER_DIM_MS ||
+ sampler_dim == GLSL_SAMPLER_DIM_BUF);
texop = nir_texop_txs;
dest_type = nir_type_int32;
break;
case SpvOpImageQueryLod:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_CUBE);
texop = nir_texop_lod;
dest_type = nir_type_float32;
break;
case SpvOpImageQueryLevels:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D ||
+ sampler_dim == GLSL_SAMPLER_DIM_2D ||
+ sampler_dim == GLSL_SAMPLER_DIM_3D ||
+ sampler_dim == GLSL_SAMPLER_DIM_CUBE);
texop = nir_texop_query_levels;
dest_type = nir_type_int32;
break;
case SpvOpImageQuerySamples:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS);
texop = nir_texop_texture_samples;
dest_type = nir_type_int32;
break;
case SpvOpFragmentFetchAMD:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS ||
+ sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS);
texop = nir_texop_fragment_fetch_amd;
break;
case SpvOpFragmentMaskFetchAMD:
+ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS ||
+ sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS);
texop = nir_texop_fragment_mask_fetch_amd;
dest_type = nir_type_uint32;
break;