mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-04 05:08:20 +02:00
gl: Reduce complexity of radial fragment shaders.
This shaves 1 Mesa IR instruction, and 6 Gen4 ISA instructions.
This commit is contained in:
parent
89bdc2f8d5
commit
8da843e996
1 changed files with 2 additions and 8 deletions
|
|
@ -776,10 +776,7 @@ static const char *fs_source_radial_gradient =
|
|||
" det = max (det, 0.0);\n"
|
||||
" \n"
|
||||
" float sqrt_det = sqrt (det);\n"
|
||||
" /* This complicated bit of logic acts as\n"
|
||||
" * \"if (A < 0.0) sqrt_det = -sqrt_det\", without the branch.\n"
|
||||
" */\n"
|
||||
" sqrt_det *= 1.0 + 2.0 * sign (min (A, 0.0));\n"
|
||||
" sqrt_det *= sign(A);\n"
|
||||
" \n"
|
||||
" float t = (-B + sqrt_det) / (2.0 * A);\n"
|
||||
" t = (t - source_first_offset) / (source_last_offset - source_first_offset);\n"
|
||||
|
|
@ -857,10 +854,7 @@ static const char *fs_mask_radial_gradient =
|
|||
" det = max (det, 0.0);\n"
|
||||
" \n"
|
||||
" float sqrt_det = sqrt (det);\n"
|
||||
" /* This complicated bit of logic acts as\n"
|
||||
" * \"if (A < 0.0) sqrt_det = -sqrt_det\", without the branch.\n"
|
||||
" */\n"
|
||||
" sqrt_det *= 1.0 + 2.0 * sign (min (A, 0.0));\n"
|
||||
" sqrt_det *= sign(A);\n"
|
||||
" \n"
|
||||
" float t = (-B + sqrt_det) / (2.0 * A);\n"
|
||||
" t = (t - mask_first_offset) / (mask_last_offset - mask_first_offset);\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue