mirror of
https://github.com/Eragon-Brisingr/UShaderLab.git
synced 2026-09-15 14:54:36 +00:00
56 lines
3.4 KiB
Plaintext
56 lines
3.4 KiB
Plaintext
// Copyright UShaderLab. All Rights Reserved.
|
|
//
|
|
// IDE-only (SHADERLAB_IDE) stubs for the engine's material texture-sampling intrinsics
|
|
// (Texture2DSample family, in Common.ush). A `.usl` body samples textures with plain HLSL,
|
|
// e.g. `Texture2DSample(Tex, TexSampler, uv)`, which reaches the real engine symbols only inside
|
|
// the generated Custom node. shader-validator can't see the material environment, so without these
|
|
// stubs those calls show "undeclared". The real shader compiler never defines SHADERLAB_IDE, so it
|
|
// uses the engine's true functions and this whole file is empty at compile time — no redefinition.
|
|
//
|
|
// This file is auto-included into every Custom node (via ShaderLabUEFunctions.ush), hence the hard
|
|
// SHADERLAB_IDE guard is essential.
|
|
|
|
#pragma once
|
|
|
|
#ifdef SHADERLAB_IDE
|
|
|
|
// Hide the engine's MaterialFloat alias from authors: under the IDE it degrades to plain float so
|
|
// completion/type-checking only ever surface `float`. (Guarded so a stray engine include can't clash.)
|
|
#ifndef MaterialFloat
|
|
#define MaterialFloat float
|
|
#define MaterialFloat2 float2
|
|
#define MaterialFloat3 float3
|
|
#define MaterialFloat4 float4
|
|
#endif
|
|
|
|
// --- Texture2D ---
|
|
float4 Texture2DSample(Texture2D Tex, SamplerState Sampler, float2 UV) { return (float4)0; }
|
|
float Texture2DSample_A8(Texture2D Tex, SamplerState Sampler, float2 UV) { return 0; }
|
|
float4 Texture2DSampleLevel(Texture2D Tex, SamplerState Sampler, float2 UV, float Mip) { return (float4)0; }
|
|
float4 Texture2DSampleBias(Texture2D Tex, SamplerState Sampler, float2 UV, float MipBias) { return (float4)0; }
|
|
float4 Texture2DSampleGrad(Texture2D Tex, SamplerState Sampler, float2 UV, float2 DDX, float2 DDY) { return (float4)0; }
|
|
|
|
// --- Texture3D (volume) ---
|
|
float4 Texture3DSample(Texture3D Tex, SamplerState Sampler, float3 UV) { return (float4)0; }
|
|
float4 Texture3DSampleLevel(Texture3D Tex, SamplerState Sampler, float3 UV, float Mip) { return (float4)0; }
|
|
float4 Texture3DSampleBias(Texture3D Tex, SamplerState Sampler, float3 UV, float MipBias) { return (float4)0; }
|
|
float4 Texture3DSampleGrad(Texture3D Tex, SamplerState Sampler, float3 UV, float3 DDX, float3 DDY) { return (float4)0; }
|
|
|
|
// --- TextureCube ---
|
|
float4 TextureCubeSample(TextureCube Tex, SamplerState Sampler, float3 UV) { return (float4)0; }
|
|
float4 TextureCubeSampleLevel(TextureCube Tex, SamplerState Sampler, float3 UV, float Mip) { return (float4)0; }
|
|
float4 TextureCubeSampleBias(TextureCube Tex, SamplerState Sampler, float3 UV, float MipBias) { return (float4)0; }
|
|
float4 TextureCubeSampleGrad(TextureCube Tex, SamplerState Sampler, float3 UV, float3 DDX, float3 DDY) { return (float4)0; }
|
|
|
|
// --- Texture2DArray (third component = slice index) ---
|
|
float4 Texture2DArraySample(Texture2DArray Tex, SamplerState Sampler, float3 UV) { return (float4)0; }
|
|
float4 Texture2DArraySampleLevel(Texture2DArray Tex, SamplerState Sampler, float3 UV, float Mip) { return (float4)0; }
|
|
float4 Texture2DArraySampleBias(Texture2DArray Tex, SamplerState Sampler, float3 UV, float MipBias) { return (float4)0; }
|
|
float4 Texture2DArraySampleGrad(Texture2DArray Tex, SamplerState Sampler, float3 UV, float2 DDX, float2 DDY) { return (float4)0; }
|
|
|
|
// --- TextureCubeArray (fourth component = slice index) ---
|
|
float4 TextureCubeArraySample(TextureCubeArray Tex, SamplerState Sampler, float4 UV) { return (float4)0; }
|
|
float4 TextureCubeArraySampleLevel(TextureCubeArray Tex, SamplerState Sampler, float4 UV, float Mip) { return (float4)0; }
|
|
|
|
#endif // SHADERLAB_IDE
|