Skip to content

Experimental HLSL shaders - cbuffer Time not bound #8935

@softmonkey

Description

@softmonkey

Environment

Platform ServicePack Version VersionString
Win32NT 10.0.19042.0 Microsoft Windows NT 10.0.19042.0

Steps to reproduce

  1. Write a simple HLSL shader that uses Time such as:
  // The original retro pixel shader
  Texture2D shaderTexture;
  SamplerState samplerState;
  
  cbuffer PixelShaderSettings {
    float  Time;
    float  Scale;
    float2 Resolution;
    float4 Background;
  };
  
  float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET
  {
    // Read the color value at the current texture coordinate (tex)
    //  float4 is tuple of 4 floats, rgba
    float4 color = shaderTexture.Sample(samplerState, tex);
    
    // Vertical scroll
    tex.y+= Time;
    color.rg = tex * 0.5f;
    
    // Return the final color
    return color;
  }

2, Add it to your profile config

Expected behavior

I am expecting the example shader to scroll vertically. Time is useful for a number of effects.

Actual behavior

Shader is compiling fine, so suspect an error in the binding.
See TODO terminal/blob/main/src/renderer/dx/DxRenderer.cpp, DxEngine::_ComputePixelShaderSettings()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-RenderingText rendering, emoji, complex glyph & font-fallback issuesHelp WantedWe encourage anyone to jump in on these.Issue-TaskIt's a feature request, but it doesn't really need a major design.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.good first issueThis is a fix that might be easier for someone to do as a first contribution

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions