From 056641efc23b346ff0bbddba508a45ff5368506e Mon Sep 17 00:00:00 2001 From: liuwenfeng Date: Thu, 12 Jun 2025 20:41:50 +0800 Subject: [PATCH 1/2] remove hard-coded urls Signed-off-by: liuwenfeng --- src/compiler/glsl/bc1.glsl | 28 ---------------------------- src/compiler/glsl/bc4.glsl | 3 --- 2 files changed, 31 deletions(-) diff --git a/src/compiler/glsl/bc1.glsl b/src/compiler/glsl/bc1.glsl index 251635d7b69..089e285c69e 100644 --- a/src/compiler/glsl/bc1.glsl +++ b/src/compiler/glsl/bc1.glsl @@ -57,25 +57,6 @@ float3 rgb565to888( float rgb565 ) retVal.x = floor( rgb565 / 2048.0f ); retVal.y = floor( mod( rgb565, 2048.0f ) / 32.0f ); retVal.z = floor( mod( rgb565, 32.0f ) ); - - // This is the correct 565 to 888 conversion: - // rgb = floor( rgb * ( 255.0f / float3( 31.0f, 63.0f, 31.0f ) ) + 0.5f ) - // - // However stb_dxt follows a different one: - // rb = floor( rb * ( 256 / 32 + 8 / 32 ) ); - // g = floor( g * ( 256 / 64 + 4 / 64 ) ); - // - // I'm not sure exactly why but it's possible this is how the S3TC specifies it should be decoded - // It's quite possible this is the reason: - // http://www.ludicon.com/castano/blog/2009/03/gpu-dxt-decompression/ - // - // Or maybe it's just because it's cheap to do with integer shifts. - // Anyway, we follow stb_dxt's conversion just in case - // (gives almost the same result, with 1 or -1 of difference for a very few values) - // - // Perhaps when we make 888 -> 565 -> 888 it doesn't matter - // because they end up mapping to the original number - return floor( retVal * float3( 8.25f, 4.0625f, 8.25f ) ); } @@ -219,15 +200,6 @@ uint MatchColorsBlock( const uint srcPixelsBlock[16], float3 colour[4] ) for( int i = 0; i < 4; ++i ) stops[i] = dot( colour[i], dir ); - - // think of the colors as arranged on a line; project point onto that line, then choose - // next color out of available ones. we compute the crossover points for "best color in top - // half"/"best in bottom half" and then the same inside that subinterval. - // - // relying on this 1d approximation isn't always optimal in terms of euclidean distance, - // but it's very close and a lot faster. - // http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html - float c0Point = trunc( ( stops[1] + stops[3] ) * 0.5f ); float halfPoint = trunc( ( stops[3] + stops[2] ) * 0.5f ); float c3Point = trunc( ( stops[2] + stops[0] ) * 0.5f ); diff --git a/src/compiler/glsl/bc4.glsl b/src/compiler/glsl/bc4.glsl index 2486fa4ae0c..85ad0314466 100644 --- a/src/compiler/glsl/bc4.glsl +++ b/src/compiler/glsl/bc4.glsl @@ -101,9 +101,6 @@ void main() maxVal = max( g_minMaxValues[minMaxIdxBase + i].y, maxVal ); } - // determine bias and emit color indices - // given the choice of maxVal/minVal, these indices are optimal: - // http://fgiesen.wordpress.com/2009/12/15/dxt5-alpha-block-index-determination/ float dist = maxVal - minVal; float dist4 = dist * 4.0f; float dist2 = dist * 2.0f; -- Gitee From df591b802a3a3dd288582dfa209a5377483a94ac Mon Sep 17 00:00:00 2001 From: liuwenfeng Date: Fri, 13 Jun 2025 08:49:07 +0000 Subject: [PATCH 2/2] modify oat Signed-off-by: liuwenfeng --- OAT.xml | 2 +- dependency_inputs.gni | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/OAT.xml b/OAT.xml index 1ae8aad29ce..ec686c79aac 100644 --- a/OAT.xml +++ b/OAT.xml @@ -87,7 +87,7 @@ Note:If the text contains special characters, please escape them according to th - + diff --git a/dependency_inputs.gni b/dependency_inputs.gni index e6c8f63f396..4ae09dc436f 100644 --- a/dependency_inputs.gni +++ b/dependency_inputs.gni @@ -1534,10 +1534,8 @@ declare_args() { "./src/etnaviv/drm-shim/meson.build", "./src/etnaviv/hwdb/etna_hwdb.h", "./src/etnaviv/hwdb/hwdb.h.py", - "./src/etnaviv/hwdb/st/gc_feature_database.h", "./src/etnaviv/hwdb/etna_hwdb.c", "./src/etnaviv/hwdb/meson.build", - "./src/etnaviv/hwdb/nxp/gc_feature_database.h", "./src/etnaviv/common/etna_core_info.h", "./src/etnaviv/common/meson.build", "./src/etnaviv/common/scripts/parse_huffman.py", -- Gitee