summaryrefslogtreecommitdiff
path: root/src/gpu/effects/rotating_cube_effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/rotating_cube_effect.cc')
-rw-r--r--src/gpu/effects/rotating_cube_effect.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpu/effects/rotating_cube_effect.cc b/src/gpu/effects/rotating_cube_effect.cc
index b4f3d3e..7f590c5 100644
--- a/src/gpu/effects/rotating_cube_effect.cc
+++ b/src/gpu/effects/rotating_cube_effect.cc
@@ -63,12 +63,12 @@ void RotatingCubeEffect::init(MainSequence* demo) {
ShaderComposer::CompositionMap composition_map;
composition_map["render/scene_query_mode"] = "render/scene_query_linear";
- std::string composed_shader = ShaderComposer::Get().Compose(
+ composed_shader_ = ShaderComposer::Get().Compose(
{}, std::string(shader_code, shader_size), composition_map);
WGPUShaderSourceWGSL wgsl_src = {};
wgsl_src.chain.sType = WGPUSType_ShaderSourceWGSL;
- wgsl_src.code = str_view(composed_shader.c_str());
+ wgsl_src.code = str_view(composed_shader_.c_str());
WGPUShaderModuleDescriptor shader_desc = {};
shader_desc.nextInChain = &wgsl_src.chain;
@@ -105,18 +105,16 @@ void RotatingCubeEffect::init(MainSequence* demo) {
pipeline_ = wgpuDeviceCreateRenderPipeline(ctx_.device, &pipeline_desc);
wgpuShaderModuleRelease(shader_module);
- WGPUTextureView dummy_sky = noise_view_;
const WGPUBindGroupEntry entries_0[] = {
{.binding = 0, .buffer = uniform_buffer_.buffer, .size = sizeof(Uniforms)},
{.binding = 1, .buffer = object_buffer_.buffer, .size = sizeof(ObjectData)},
{.binding = 3, .textureView = noise_view_},
{.binding = 4, .sampler = noise_sampler_},
- {.binding = 5, .textureView = dummy_sky},
};
const WGPUBindGroupDescriptor bg_desc_0 = {
.layout = wgpuRenderPipelineGetBindGroupLayout(pipeline_, 0),
- .entryCount = 5,
+ .entryCount = 4,
.entries = entries_0,
};
bind_group_0_ = wgpuDeviceCreateBindGroup(ctx_.device, &bg_desc_0);