class ShaderProgram

Defined at line 30 of file ../../src/ui/lib/escher/vk/shader_program.h

ShaderProgram encapsulates a set of ShaderModules, which are used to generate

vk::Pipelines. This is done in collaboration with CommandBuffer; different

pipelines may be required depending on the current CommandBuffer state.

ShaderProgram listens for changes in the ShaderModules; whenever new SPIR-V

is available, all existing pipelines are invalidated and will be lazily

regenerated upon demand.

Public Members

static const ResourceTypeInfo kTypeInfo

Public Methods

ShaderProgramPtr NewGraphics (ResourceRecycler * resource_recycler, std::vector<ShaderModulePtr> shader_modules)

Graphics program.

Defined at line 21 of file ../../src/ui/lib/escher/vk/shader_program.cc

ShaderProgramPtr NewCompute (ResourceRecycler * resource_recycler, ShaderModulePtr shader_module)

Compute program.

Defined at line 27 of file ../../src/ui/lib/escher/vk/shader_program.cc

const ResourceTypeInfo & type_info ()

Defined at line 33 of file ../../src/ui/lib/escher/vk/shader_program.h

void ~ShaderProgram ()

Defined at line 52 of file ../../src/ui/lib/escher/vk/shader_program.cc

size_t stashed_graphics_pipeline_count ()

Defined at line 66 of file ../../src/ui/lib/escher/vk/shader_program.h

PipelineLayoutPtr ObtainPipelineLayout (impl::PipelineLayoutCache * pipeline_layout_cache, const SamplerPtr & immutable_sampler)

Return the pipeline layout for this program, operating with the optional

immutable sampler passed in (pass the null vk::Sampler handle to opt-out).

TODO(https://fxbug.dev/42152423): This code-flow assumes that ShaderPrograms source from, at

most, a single sampler. This is a blocking bug for implementing, e.g.,

https://fxbug.dev/42151968.

Defined at line 84 of file ../../src/ui/lib/escher/vk/shader_program.cc

const ShaderModulePtr & GetModuleForStage (ShaderStage stage)

Inline function definitions.

Defined at line 93 of file ../../src/ui/lib/escher/vk/shader_program.h

vk::Pipeline FindPipeline (Hash hash)

Simple HashMap lookup and insertion.

Defined at line 98 of file ../../src/ui/lib/escher/vk/shader_program.h

void StashPipeline (Hash hash, vk::Pipeline pipeline)

Defined at line 103 of file ../../src/ui/lib/escher/vk/shader_program.h

Friends

class VulkanTester