#include "dawn/native/opengl/ShaderModuleGL.h"
#include <sstream>
#include <utility>
#include "absl/container/flat_hash_map.h"
#include "dawn/native/BindGroupLayoutInternal.h"
#include "dawn/native/CacheRequest.h"
#include "dawn/native/Pipeline.h"
#include "dawn/native/TintUtils.h"
#include "dawn/native/opengl/BindGroupLayoutGL.h"
#include "dawn/native/opengl/BindingPoint.h"
#include "dawn/native/opengl/DeviceGL.h"
#include "dawn/native/opengl/PipelineLayoutGL.h"
#include "dawn/platform/DawnPlatform.h"
#include "dawn/platform/tracing/TraceEvent.h"
#include "src/tint/api/common/binding_point.h"
namespace dawn::native {
namespace {
GLenum GLShaderType(SingleShaderStage stage) { … }
tint::glsl::writer::Version::Standard ToTintGLStandard(opengl::OpenGLVersion::Standard standard) { … }
BindingMap;
opengl::CombinedSampler* AppendCombinedSampler(opengl::CombinedSamplerInfo* info,
tint::BindingPoint texture,
tint::BindingPoint sampler,
tint::BindingPoint placeholderBindingPoint) { … }
InterstageLocationAndName;
#define GLSL_COMPILATION_REQUEST_MEMBERS …
DAWN_MAKE_CACHE_REQUEST(…);
#undef GLSL_COMPILATION_REQUEST_MEMBERS
#define GLSL_COMPILATION_MEMBERS …
DAWN_SERIALIZABLE(…){};
#undef GLSL_COMPILATION_MEMBERS
}
}
namespace dawn::native::opengl {
namespace {
CombinedSamplerInfo generateCombinedSamplerInfo(tint::inspector::Inspector& inspector,
const std::string& entryPoint,
tint::glsl::writer::Bindings& bindings,
BindingMap externalTextureExpansionMap,
bool* needsPlaceholderSampler
) { … }
bool generateTextureBuiltinFromUniformData(tint::inspector::Inspector& inspector,
const std::string& entryPoint,
const PipelineLayout* layout,
BindingPointToFunctionAndOffset* bindingPointToData,
tint::glsl::writer::Bindings& bindings) { … }
}
std::string GetBindingName(BindGroupIndex group, BindingNumber bindingNumber) { … }
bool operator<(const BindingLocation& a, const BindingLocation& b) { … }
bool operator<(const CombinedSampler& a, const CombinedSampler& b) { … }
std::string CombinedSampler::GetName() const { … }
ResultOrError<Ref<ShaderModule>> ShaderModule::Create(
Device* device,
const UnpackedPtr<ShaderModuleDescriptor>& descriptor,
const std::vector<tint::wgsl::Extension>& internalExtensions,
ShaderModuleParseResult* parseResult,
OwnedCompilationMessages* compilationMessages) { … }
ShaderModule::ShaderModule(Device* device,
const UnpackedPtr<ShaderModuleDescriptor>& descriptor,
std::vector<tint::wgsl::Extension> internalExtensions)
: … { … }
MaybeError ShaderModule::Initialize(ShaderModuleParseResult* parseResult,
OwnedCompilationMessages* compilationMessages) { … }
std::pair<tint::glsl::writer::Bindings, BindingMap> generateBindingInfo(
SingleShaderStage stage,
const PipelineLayout* layout,
const BindingInfoArray& moduleBindingInfo,
GLSLCompilationRequest& req) { … }
ResultOrError<GLuint> ShaderModule::CompileShader(
const OpenGLFunctions& gl,
const ProgrammableStage& programmableStage,
SingleShaderStage stage,
bool usesVertexIndex,
bool usesInstanceIndex,
bool usesFragDepth,
CombinedSamplerInfo* combinedSamplers,
const PipelineLayout* layout,
bool* needsPlaceholderSampler,
bool* needsTextureBuiltinUniformBuffer,
BindingPointToFunctionAndOffset* bindingPointToData) const { … }
}