From fbc9c1e040c2adb06273707a89d9dc2e660a6fd3 Mon Sep 17 00:00:00 2001 From: Bence Parajdi Date: Mon, 29 Jul 2024 14:20:44 +0200 Subject: [PATCH] move texture fetching docs to conceptual --- docs/index.md | 2 +- docs/sphinx/_toc.yml.in | 4 ++-- .../texture_fetching.rst | 18 ++++-------------- 3 files changed, 7 insertions(+), 17 deletions(-) rename docs/{how-to => understand}/texture_fetching.rst (66%) diff --git a/docs/index.md b/docs/index.md index b03a2b0b3f..8cd90f2124 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,6 +33,7 @@ On non-AMD platforms, like NVIDIA, HIP provides header files required to support * {doc}`./understand/programming_model_reference` * {doc}`./understand/hardware_implementation` * {doc}`./understand/amd_clr` +* [Texture Fetching](./understand/texture_fetching) ::: @@ -46,7 +47,6 @@ On non-AMD platforms, like NVIDIA, HIP provides header files required to support * [Debugging with HIP](./how-to/debugging) * {doc}`./how-to/logging` * [Unified Memory](./how-to/unified_memory) -* [Texture Fetching](./how-to/texture_fetching) * {doc}`./how-to/faq` ::: diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index 4c9d5fab64..3237bb9e2a 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -19,6 +19,8 @@ subtrees: - file: understand/programming_model_reference - file: understand/hardware_implementation - file: understand/amd_clr + - file: understand/texture_fetching + title: Texture Fetching - caption: How to entries: @@ -31,8 +33,6 @@ subtrees: - file: how-to/logging - file: how-to/unified_memory title: Unified Memory - - file: how-to/texture_fetching - title: Texture Fetching - file: how-to/faq - caption: Reference diff --git a/docs/how-to/texture_fetching.rst b/docs/understand/texture_fetching.rst similarity index 66% rename from docs/how-to/texture_fetching.rst rename to docs/understand/texture_fetching.rst index 9102604cbf..94232d2907 100644 --- a/docs/how-to/texture_fetching.rst +++ b/docs/understand/texture_fetching.rst @@ -7,23 +7,15 @@ Texture Fetching ******************************************************************************* -Textures are more than just a buffer, that is interpreted as 1D, 2D or 3D array. Because -of its legacy as a graphics functionality, textures are indexed with floats. This can -happen two different ways, either the index will be in the range of [0..size-1] or in -[0..1]. The difference is mathematically just a division, so for the explanations on this -page, we'll use the [0..size-1] indices. +Textures are more than just a buffer, that is interpreted as 1D, 2D or 3D array. Because of its legacy as a graphics functionality, textures are indexed with floats. This can happen two different ways, either the index will be in the range of [0..size-1] or in [0..1]. The difference is mathematically just a division, so for the explanations on this page, we'll use the [0..size-1] indices. -Using float indices isn't trivial. You as a developer, have to decide what happens, when -the index is a fraction. There is no rule for how to choose between filtering methods, as -it is very dependent of the application. +Using float indices isn't trivial. You as a developer, have to decide what happens, when the index is a fraction. There is no rule for how to choose between filtering methods, as it is very dependent of the application. .. _texture_fetching_nearest: Nearest point sampling =============================================================================== -In this mode the ``tex(x) = T[floor(x)]`` and similarly for 2D and 3D variants. In -practice this will not interpolate between neighboring values, which results in a -pixelated look. +In this mode the ``tex(x) = T[floor(x)]`` and similarly for 2D and 3D variants. In practice this will not interpolate between neighboring values, which results in a pixelated look. .. _texture_fetching_linear: Linear filtering @@ -35,6 +27,4 @@ Linear filtering method simply does a linear interpolation between values. * For two dimensional textures it is ``tex(x,y) = (1-α)(1-β)T[i,j] + α(1-β)T[i+1,j] + (1-α)βT[i,j+1] + αβT[i+1,j+1]`` * For three dimensional textures it is ``tex(x,y,z) = (1-α)(1-β)(1-γ)T[i,j,k] + α(1-β)(1-γ)T[i+1,j,k] + (1-α)β(1-γ)T[i,j+1,k] + αβ(1-γ)T[i+1,j+1,k] + (1-α)(1-β)γT[i,j,k+1] + α(1-β)γT[i+1,j,k+1] + (1-α)βγT[i,j+1,k+1] + αβγT[i+1,j+1,k+1]`` -Where ``i = round(x')``, ``α = frac(x')``, ``x' = x - 0.5``, ``j = round(y')``, -``β = frac(y')``, ``y' = y - 0.5``, ``k = round(z')``, ``γ = frac(z')`` and -``z' = z - 0.5`` \ No newline at end of file +Where ``i = round(x')``, ``α = frac(x')``, ``x' = x - 0.5``, ``j = round(y')``, ``β = frac(y')``, ``y' = y - 0.5``, ``k = round(z')``, ``γ = frac(z')`` and ``z' = z - 0.5`` \ No newline at end of file