diff --git a/Samples/Media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl b/Samples/Media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl index f3930a6a98f..a6702974136 100644 --- a/Samples/Media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl +++ b/Samples/Media/Hlms/Common/GLSL/CrossPlatformSettings_piece_all.glsl @@ -125,6 +125,8 @@ #define midf3x3_c mat3 #define midf4x4_c mat4 + #define midf_tex + #define toMidf3x3( x ) mat3( x ) #define buildMidf3x3( row0, row1, row2 ) mat3( row0, row1, row2 ) @@ -152,6 +154,8 @@ #define midf3x3_c f16mat3x3 #define midf4x4_c f16mat4x4 + #define midf_tex mediump + #define toMidf3x3( x ) f16mat3x3( x ) #define buildMidf3x3( row0, row1, row2 ) f16mat3x3( row0, row1, row2 ) @@ -190,6 +194,8 @@ #define midf3x3_c mat3 #define midf4x4_c mat4 + #define midf_tex mediump + #define toMidf3x3( x ) mat3( x ) #define buildMidf3x3( row0, row1, row2 ) mat3( row0, row1, row2 ) diff --git a/Samples/Media/Hlms/Pbs/Any/AreaLights_piece_ps.any b/Samples/Media/Hlms/Pbs/Any/AreaLights_piece_ps.any index 791075e1ed5..794cebbcaca 100644 --- a/Samples/Media/Hlms/Pbs/Any/AreaLights_piece_ps.any +++ b/Samples/Media/Hlms/Pbs/Any/AreaLights_piece_ps.any @@ -8,7 +8,7 @@ uniform sampler2DArray areaLightMasks; @end @property( syntax == glslvk ) - layout( ogre_t@value(areaLightMasks) ) uniform texture2DArray areaLightMasks; + layout( ogre_t@value(areaLightMasks) ) midf_tex uniform texture2DArray areaLightMasks; layout( ogre_s@value(areaLightMasks) ) uniform sampler areaLightMasksSampler; @end @property( syntax == hlsl ) diff --git a/Samples/Media/Hlms/Pbs/Any/Main/200.Textures_piece_ps.any b/Samples/Media/Hlms/Pbs/Any/Main/200.Textures_piece_ps.any index 29bdc8f5840..0ffb347360a 100644 --- a/Samples/Media/Hlms/Pbs/Any/Main/200.Textures_piece_ps.any +++ b/Samples/Media/Hlms/Pbs/Any/Main/200.Textures_piece_ps.any @@ -7,8 +7,8 @@ uniform sampler2DArray ltcMatrix; @end @property( syntax == glslvk ) - layout( ogre_t@value(ltcMatrix) ) uniform texture2DArray ltcMatrix; - layout( ogre_s@value(ltcMatrix) ) uniform sampler ltcSampler; + layout( ogre_t@value(ltcMatrix) ) midf_tex uniform texture2DArray ltcMatrix; + layout( ogre_s@value(ltcMatrix) ) midf_tex uniform sampler ltcSampler; @end @property( syntax == hlsl ) Texture2DArray ltcMatrix : register(t@value(ltcMatrix)); diff --git a/Samples/Media/Hlms/Pbs/GLSL/Forward3D_piece_ps.glsl b/Samples/Media/Hlms/Pbs/GLSL/Forward3D_piece_ps.glsl index 27d4a0563bf..aae9c0cde7b 100644 --- a/Samples/Media/Hlms/Pbs/GLSL/Forward3D_piece_ps.glsl +++ b/Samples/Media/Hlms/Pbs/GLSL/Forward3D_piece_ps.glsl @@ -5,13 +5,13 @@ @property( syntax == glslvk ) layout( ogre_s@value(decalsSampler) ) uniform sampler decalsSampler; @end - @property( hlms_decals_diffuse )vulkan_layout( ogre_t@value(decalsDiffuseTex) ) uniform texture2DArray decalsDiffuseTex;@end - @property( hlms_decals_normals )vulkan_layout( ogre_t@value(decalsNormalsTex) ) uniform texture2DArray decalsNormalsTex;@end + @property( hlms_decals_diffuse )vulkan_layout( ogre_t@value(decalsDiffuseTex) ) midf_tex uniform texture2DArray decalsDiffuseTex;@end + @property( hlms_decals_normals )vulkan_layout( ogre_t@value(decalsNormalsTex) ) midf_tex uniform texture2DArray decalsNormalsTex;@end @property( hlms_decals_diffuse == hlms_decals_emissive ) #define decalsEmissiveTex decalsDiffuseTex @end @property( hlms_decals_emissive && hlms_decals_diffuse != hlms_decals_emissive ) - vulkan_layout( ogre_t@value(decalsEmissiveTex) ) uniform texture2DArray decalsEmissiveTex; + vulkan_layout( ogre_t@value(decalsEmissiveTex) ) midf_tex uniform texture2DArray decalsEmissiveTex; @end @end @end diff --git a/Samples/Media/Hlms/Pbs/GLSL/PixelShader_ps.glsl b/Samples/Media/Hlms/Pbs/GLSL/PixelShader_ps.glsl index 296a2290f6f..b2c3e75199e 100644 --- a/Samples/Media/Hlms/Pbs/GLSL/PixelShader_ps.glsl +++ b/Samples/Media/Hlms/Pbs/GLSL/PixelShader_ps.glsl @@ -49,8 +49,8 @@ layout(std140) uniform; vulkan_layout( ogre_t@value(depthTextureNoMsaa) ) uniform texture2D depthTextureNoMsaa; @end @end - vulkan_layout( ogre_t@value(refractionMap) ) uniform texture2D refractionMap; - vulkan( layout( ogre_s@value(refractionMap) ) uniform sampler refractionMapSampler ); + vulkan_layout( ogre_t@value(refractionMap) ) midf_tex uniform texture2D refractionMap; + vulkan( layout( ogre_s@value(refractionMap) ) uniform sampler refractionMapSampler ); @end @insertpiece( DeclPlanarReflTextures ) @@ -82,21 +82,21 @@ vulkan_layout( location = 0 ) in block ReadOnlyBufferF( @value(f3dLightList), float4, f3dLightList ); @end @property( irradiance_volumes ) - vulkan_layout( ogre_t@value(irradianceVolume) ) uniform texture3D irradianceVolume; - vulkan( layout( ogre_s@value(irradianceVolume) )uniform sampler irradianceVolumeSampler ); + vulkan_layout( ogre_t@value(irradianceVolume) ) midf_tex uniform texture3D irradianceVolume; + vulkan( layout( ogre_s@value(irradianceVolume) )uniform sampler irradianceVolumeSampler ); @end @foreach( num_textures, n ) - vulkan_layout( ogre_t@value(textureMaps@n) ) uniform texture2DArray textureMaps@n;@end + vulkan_layout( ogre_t@value(textureMaps@n) ) midf_tex uniform texture2DArray textureMaps@n;@end @property( use_envprobe_map ) @property( !hlms_enable_cubemaps_auto ) - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform textureCube texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform textureCube texEnvProbeMap; @else @property( !hlms_cubemaps_use_dpm ) - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform textureCubeArray texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform textureCubeArray texEnvProbeMap; @else - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform texture2DArray texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform texture2DArray texEnvProbeMap; @insertpiece( DeclDualParaboloidFunc ) @end @end @@ -140,7 +140,7 @@ void main() @property( alpha_test ) @foreach( num_textures, n ) - vulkan_layout( ogre_t@value(textureMaps@n) ) uniform texture2DArray textureMaps@n;@end + vulkan_layout( ogre_t@value(textureMaps@n) ) midf_tex uniform texture2DArray textureMaps@n;@end @property( syntax == glslvk ) @foreach( num_samplers, n ) diff --git a/Samples/Media/Hlms/Terra/GLSL/PixelShader_ps.glsl b/Samples/Media/Hlms/Terra/GLSL/PixelShader_ps.glsl index a6d26cdd2e8..7df903db081 100644 --- a/Samples/Media/Hlms/Terra/GLSL/PixelShader_ps.glsl +++ b/Samples/Media/Hlms/Terra/GLSL/PixelShader_ps.glsl @@ -67,8 +67,8 @@ in block in vec4 gl_FragCoord; @end -vulkan_layout( ogre_t@value(terrainNormals) ) uniform texture2D terrainNormals; -vulkan_layout( ogre_t@value(terrainShadows) ) uniform texture2D terrainShadows; +vulkan_layout( ogre_t@value(terrainNormals) ) midf_tex uniform texture2D terrainNormals; +vulkan_layout( ogre_t@value(terrainShadows) ) midf_tex uniform texture2D terrainShadows; vulkan( layout( ogre_s@value(terrainNormals) ) uniform sampler samplerStateTerra ); @property( hlms_forwardplus ) @@ -76,21 +76,21 @@ vulkan( layout( ogre_s@value(terrainNormals) ) uniform sampler samplerStateTerra ReadOnlyBufferF( @value(f3dLightList), float4, f3dLightList ); @end @property( irradiance_volumes ) - vulkan_layout( ogre_t@value(irradianceVolume) ) uniform texture3D irradianceVolume; - vulkan( layout( ogre_s@value(irradianceVolume) )uniform sampler irradianceVolumeSampler ); + vulkan_layout( ogre_t@value(irradianceVolume) ) midf_tex uniform texture3D irradianceVolume; + vulkan( layout( ogre_s@value(irradianceVolume) )uniform sampler irradianceVolumeSampler ); @end @foreach( num_textures, n ) - vulkan_layout( ogre_t@value(textureMaps@n) ) uniform texture2DArray textureMaps@n;@end + vulkan_layout( ogre_t@value(textureMaps@n) ) midf_tex uniform texture2DArray textureMaps@n;@end @property( use_envprobe_map ) @property( !hlms_enable_cubemaps_auto ) - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform textureCube texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform textureCube texEnvProbeMap; @else @property( !hlms_cubemaps_use_dpm ) - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform textureCubeArray texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform textureCubeArray texEnvProbeMap; @else - vulkan_layout( ogre_t@value(texEnvProbeMap) ) uniform texture2DArray texEnvProbeMap; + vulkan_layout( ogre_t@value(texEnvProbeMap) ) midf_tex uniform texture2DArray texEnvProbeMap; @insertpiece( DeclDualParaboloidFunc ) @end @end diff --git a/Samples/Media/Hlms/Unlit/GLSL/PixelShader_ps.glsl b/Samples/Media/Hlms/Unlit/GLSL/PixelShader_ps.glsl index 281731137ee..38f47c9525d 100644 --- a/Samples/Media/Hlms/Unlit/GLSL/PixelShader_ps.glsl +++ b/Samples/Media/Hlms/Unlit/GLSL/PixelShader_ps.glsl @@ -28,17 +28,17 @@ layout(location = FRAG_COLOR, index = 0) out midf outColour; @property( syntax != glslvk ) @foreach( num_textures, n ) @property( is_texture@n_array ) - uniform sampler2DArray textureMapsArray@n; + midf_tex uniform sampler2DArray textureMapsArray@n; @else - uniform sampler2D textureMaps@n; + midf_tex uniform sampler2D textureMaps@n; @end @end @else @foreach( num_textures, n ) @property( is_texture@n_array ) - layout( ogre_t@value(textureMapsArray@n) ) uniform texture2DArray textureMapsArray@n; + layout( ogre_t@value(textureMapsArray@n) ) midf_tex uniform texture2DArray textureMapsArray@n; @else - layout( ogre_t@value(textureMaps@n) ) uniform texture2D textureMaps@n; + layout( ogre_t@value(textureMaps@n) ) midf_tex uniform texture2D textureMaps@n; @end @end @end