[Impeller] Document what some of this shader metadata is. (flutter/engine#48647)
ext_res_0 ?!! its just `binding` but for Metal.
This commit is contained in:
@@ -79,10 +79,20 @@ struct ShaderMetadata {
|
||||
std::vector<ShaderStructMemberMetadata> members;
|
||||
};
|
||||
|
||||
/// @brief Metadata required to bind a buffer.
|
||||
///
|
||||
/// OpenGL binding requires the usage of the separate shader metadata struct.
|
||||
struct ShaderUniformSlot {
|
||||
/// @brief The name of the uniform slot.
|
||||
const char* name;
|
||||
|
||||
/// @brief `ext_res_0` is the Metal binding value.
|
||||
size_t ext_res_0;
|
||||
|
||||
/// @brief The Vulkan descriptor set index.
|
||||
size_t set;
|
||||
|
||||
/// @brief The Vulkan binding value.
|
||||
size_t binding;
|
||||
};
|
||||
|
||||
@@ -127,11 +137,25 @@ struct ShaderStageBufferLayout {
|
||||
}
|
||||
};
|
||||
|
||||
/// @brief Metadata required to bind a texture and sampler.
|
||||
///
|
||||
/// OpenGL binding requires the usage of the separate shader metadata struct.
|
||||
struct SampledImageSlot {
|
||||
/// @brief The name of the texture slot.
|
||||
const char* name;
|
||||
|
||||
/// @brief This value is `ext_res_0`, the Metal binding value for the texture.
|
||||
size_t texture_index;
|
||||
|
||||
/// @brief This value is `ext_res_1`, the Metal binding value for the sampler.
|
||||
///
|
||||
/// Since only combined texture and samplers are used, this index is unused.
|
||||
size_t sampler_index;
|
||||
|
||||
/// @brief The Vulkan binding value for a combined texture and sampler.
|
||||
size_t binding;
|
||||
|
||||
/// @brief The Vulkan descriptor set index.
|
||||
size_t set;
|
||||
|
||||
constexpr bool HasTexture() const { return texture_index < 32u; }
|
||||
|
||||
Reference in New Issue
Block a user