@@ -257,25 +257,25 @@ void RAS_Shader::DeleteShader()
257257void RAS_Shader::AppendUniformInfos (std::string type, std::string name)
258258{
259259 if (type == " float" ) {
260- m_constantUniforms.push_back (UniformConstant ({Type::FLOAT , name}));
260+ m_constantUniforms.push_back (UniformConstant ({Type::float_t , name}));
261261 }
262262 else if (type == " int" ) {
263- m_constantUniforms.push_back (UniformConstant ({Type::INT , name}));
263+ m_constantUniforms.push_back (UniformConstant ({Type::int_t , name}));
264264 }
265265 else if (type == " vec2" ) {
266- m_constantUniforms.push_back (UniformConstant ({Type::VEC2 , name}));
266+ m_constantUniforms.push_back (UniformConstant ({Type::float2_t , name}));
267267 }
268268 else if (type == " vec3" ) {
269- m_constantUniforms.push_back (UniformConstant ({Type::VEC3 , name}));
269+ m_constantUniforms.push_back (UniformConstant ({Type::float3_t , name}));
270270 }
271271 else if (type == " vec4" ) {
272- m_constantUniforms.push_back (UniformConstant ({Type::VEC4 , name}));
272+ m_constantUniforms.push_back (UniformConstant ({Type::float4_t , name}));
273273 }
274274 else if (type == " mat3" ) {
275- m_constantUniforms.push_back (UniformConstant ({Type::MAT3 , name}));
275+ m_constantUniforms.push_back (UniformConstant ({Type::float3x3_t , name}));
276276 }
277277 else if (type == " mat4" ) {
278- m_constantUniforms.push_back (UniformConstant ({Type::MAT4 , name}));
278+ m_constantUniforms.push_back (UniformConstant ({Type::float4x4_t , name}));
279279 }
280280 else if (type == " sampler2D" ) {
281281 if (m_samplerUniforms.size () > 7 ) {
@@ -336,55 +336,55 @@ static std::optional<blender::StringRefNull> c_str_to_stringref_opt(const char *
336336static int constant_type_size (Type type)
337337{
338338 switch (type) {
339- case Type::BOOL :
340- case Type::FLOAT :
341- case Type::INT :
342- case Type::UINT :
343- case Type::UCHAR4 :
344- case Type::CHAR4 :
345- case Type::VEC3_101010I2 :
346- case Type::USHORT2 :
347- case Type::SHORT2 :
339+ case Type::bool_t :
340+ case Type::float_t :
341+ case Type::int_t :
342+ case Type::uint_t :
343+ case Type::uchar4_t :
344+ case Type::char4_t :
345+ case Type::float3_10_10_10_2_t :
346+ case Type::ushort2_t :
347+ case Type::short2_t :
348348 return 4 ;
349349 break ;
350- case Type::USHORT3 :
351- case Type::SHORT3 :
350+ case Type::ushort3_t :
351+ case Type::short3_t :
352352 return 6 ;
353353 break ;
354- case Type::VEC2 :
355- case Type::UVEC2 :
356- case Type::IVEC2 :
357- case Type::USHORT4 :
358- case Type::SHORT4 :
354+ case Type::float2_t :
355+ case Type::uint2_t :
356+ case Type::int2_t :
357+ case Type::ushort4_t :
358+ case Type::short4_t :
359359 return 8 ;
360360 break ;
361- case Type::VEC3 :
362- case Type::UVEC3 :
363- case Type::IVEC3 :
361+ case Type::float3_t :
362+ case Type::uint3_t :
363+ case Type::int3_t :
364364 return 12 ;
365365 break ;
366- case Type::VEC4 :
367- case Type::UVEC4 :
368- case Type::IVEC4 :
366+ case Type::float4_t :
367+ case Type::uint4_t :
368+ case Type::int4_t :
369369 return 16 ;
370370 break ;
371- case Type::MAT3 :
371+ case Type::float3x3_t :
372372 return 36 + 3 * 4 ;
373- case Type::MAT4 :
373+ case Type::float4x4_t :
374374 return 64 ;
375375 break ;
376- case Type::UCHAR :
377- case Type::CHAR :
376+ case Type::uchar_t :
377+ case Type::char_t :
378378 return 1 ;
379379 break ;
380- case Type::UCHAR2 :
381- case Type::CHAR2 :
382- case Type::USHORT :
383- case Type::SHORT :
380+ case Type::uchar2_t :
381+ case Type::char2_t :
382+ case Type::ushort_t :
383+ case Type::short_t :
384384 return 2 ;
385385 break ;
386- case Type::UCHAR3 :
387- case Type::CHAR3 :
386+ case Type::uchar3_t :
387+ case Type::char3_t :
388388 return 3 ;
389389 break ;
390390 }
@@ -431,13 +431,13 @@ bool RAS_Shader::LinkProgram()
431431 geom = GetParsedProgram (GEOMETRY_PROGRAM);
432432
433433 StageInterfaceInfo iface (" s_Interface" , " " );
434- iface.smooth (Type::VEC4 , " bgl_TexCoord" );
434+ iface.smooth (Type::float4_t , " bgl_TexCoord" );
435435
436436 ShaderCreateInfo info (" s_Display" );
437- info.push_constant (Type::FLOAT , " bgl_RenderedTextureWidth" );
438- info.push_constant (Type::FLOAT , " bgl_RenderedTextureHeight" );
437+ info.push_constant (Type::float_t , " bgl_RenderedTextureWidth" );
438+ info.push_constant (Type::float_t , " bgl_RenderedTextureHeight" );
439439 if (GPU_backend_get_type () == GPU_BACKEND_OPENGL) {
440- info.push_constant (Type::VEC2 , " bgl_TextureCoordinateOffset" , 9 );
440+ info.push_constant (Type::float2_t , " bgl_TextureCoordinateOffset" , 9 );
441441 }
442442 for (std::pair<int , std::string> &sampler : m_samplerUniforms) {
443443 info.sampler (sampler.first , ImageType::FLOAT_2D, sampler.second );
@@ -448,7 +448,7 @@ bool RAS_Shader::LinkProgram()
448448 info.push_constant (constant.type , constant.name );
449449 }
450450 info.vertex_out (iface);
451- info.fragment_out (0 , Type::VEC4 , " fragColor" );
451+ info.fragment_out (0 , Type::float4_t , " fragColor" );
452452 info.vertex_source (" common_colormanagement_lib.glsl" );
453453 info.fragment_source (" common_colormanagement_lib.glsl" );
454454 info.vertex_source_generated = vert;
0 commit comments