19 bool usePushConstants)
21 , fUsePushConstants(usePushConstants) {
27 for (
const auto& uniformInfo : uniforms.
items()) {
30 uniformInfo.fVariable.getArrayCount() > 0);
32 uniform.fArrayCount = uniformInfo.fVariable.getArrayCount();
35 uniform.
fOffset = uniformInfo.fOffsets[memLayout];
36 uniform.
fType = uniformInfo.fVariable.getType();
44 return std::make_pair(
nullptr,
true);
46 if (fUsePushConstants) {
49 fUniformBuffer =
nullptr;
57 if (!fUniformBuffer) {
58 return std::make_pair(
nullptr,
false);
64 return std::make_pair(fUniformBuffer,
true);
69 const int32_t v[])
const {
70 if (fUsePushConstants) {
74 SkASSERT(arrayCount <= uni.fArrayCount ||
79 memcpy(
buffer, v, arrayCount *
sizeof(int32_t));
87 const float v[])
const {
88 if (fUsePushConstants) {
92 SkASSERT(arrayCount <= uni.fArrayCount ||
97 memcpy(
buffer, v, arrayCount *
sizeof(
float));
105 const int32_t v[])
const {
106 if (fUsePushConstants) {
110 SkASSERT(arrayCount <= uni.fArrayCount ||
115 memcpy(
buffer, v, arrayCount * 2 *
sizeof(int32_t));
123 const float v[])
const {
124 if (fUsePushConstants) {
128 SkASSERT(arrayCount <= uni.fArrayCount ||
133 memcpy(
buffer, v, arrayCount * 2 *
sizeof(
float));
141 const float m[])
const {
142 if (fUsePushConstants) {
147 SkASSERT(arrayCount <= uni.fArrayCount ||
153 static_assert(
sizeof(
float) == 4);
155 memcpy(
buffer,
m, arrayCount * 2 * 2 *
sizeof(
float));
@ kDynamic_GrAccessPattern
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
GrDirectContext * getContext()
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType, GrAccessPattern, ZeroInit)
VkShaderStageFlags getPushConstantStageFlags() const
void pushConstants(const GrVkGpu *gpu, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *values)
const GrVkCaps & vkCaps() const
std::pair< sk_sp< GrGpuBuffer >, bool > uploadUniforms(GrVkGpu *gpu, VkPipelineLayout, GrVkCommandBuffer *commandBuffer)
void set1fv(UniformHandle, int arrayCount, const float v[]) const override
void set2fv(UniformHandle, int arrayCount, const float v[]) const override
void setMatrix2fv(UniformHandle, int arrayCount, const float matrices[]) const override
void set1iv(UniformHandle, int arrayCount, const int32_t v[]) const override
void set2iv(UniformHandle, int arrayCount, const int32_t v[]) const override
GrVkPipelineStateDataManager(const UniformInfoArray &, uint32_t uniformSize, bool usePushConstants)
void reset(T *ptr=nullptr)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer