diff --git a/cmd/embed/main.go b/cmd/embed/main.go index e4551a1164..c853184ebb 100644 --- a/cmd/embed/main.go +++ b/cmd/embed/main.go @@ -181,7 +181,7 @@ func run(ctx context.Context) error { fmt.Fprintf(b, "const %s_file = `%s`\n", entry.name, entry.filename) fmt.Fprintf(b, "const %s_utf8 = %v\n", entry.name, validUTF8) fmt.Fprintf(b, "const %s = `%s`\n", entry.name, encoded) - log.I(ctx, "Embed %s from %s\n", entry.name, entry.path) + log.D(ctx, "Embed %s from %s\n", entry.name, entry.path) } // reformat the output result, err := imports.Process("", b.Bytes(), nil) diff --git a/gapis/api/gles/undefined_framebuffer.go b/gapis/api/gles/undefined_framebuffer.go index a3fa895dcb..dd2c943d7b 100644 --- a/gapis/api/gles/undefined_framebuffer.go +++ b/gapis/api/gles/undefined_framebuffer.go @@ -63,8 +63,11 @@ func undefinedFramebuffer(ctx context.Context, device *device.Instance) transfor func drawUndefinedFramebuffer(ctx context.Context, id api.CmdID, cmd api.Cmd, device *device.Instance, s *api.GlobalState, c *Context, out transform.Writer) error { const ( aScreenCoordsLocation AttributeLocation = 0 + aScreenCoords = "aScreenCoords" vertexShaderSource string = ` + #version 100 + precision highp float; attribute vec2 aScreenCoords; varying vec2 uv; @@ -74,6 +77,8 @@ func drawUndefinedFramebuffer(ctx context.Context, id api.CmdID, cmd api.Cmd, de gl_Position = vec4(aScreenCoords.xy, 0., 1.); }` fragmentShaderSource string = ` + #version 100 + precision highp float; varying vec2 uv; @@ -102,13 +107,20 @@ func drawUndefinedFramebuffer(ctx context.Context, id api.CmdID, cmd api.Cmd, de programID := t.makeProgram(ctx, vertexShaderSource, fragmentShaderSource) - tmp0 := t.AllocData(ctx, "aScreenCoords") + tmp0 := t.AllocData(ctx, aScreenCoords) out.MutateAndWrite(ctx, dID, cb.GlBindAttribLocation(programID, aScreenCoordsLocation, tmp0.Ptr()). AddRead(tmp0.Data())) tmp0.Free() out.MutateAndWrite(ctx, dID, api.WithExtras(cb.GlLinkProgram(programID), &LinkProgramExtra{ - LinkStatus: GLboolean_GL_TRUE, - ActiveResources: &ActiveProgramResources{}, + LinkStatus: GLboolean_GL_TRUE, + ActiveResources: &ActiveProgramResources{ + ProgramInputs: NewU32ːProgramResourceʳᵐ().Add(0, &ProgramResource{ + Type: GLenum_GL_FLOAT_VEC2, + Name: aScreenCoords, + ArraySize: 1, + Locations: NewU32ːGLintᵐ().Add(0, 0), + }), + }, })) t.glUseProgram(ctx, programID) diff --git a/gapis/api/test/test.go b/gapis/api/test/test.go index 97893fcfdd..c2235c3f70 100644 --- a/gapis/api/test/test.go +++ b/gapis/api/test/test.go @@ -17,7 +17,6 @@ package test import ( "context" - "github.com/google/gapid/core/image" "github.com/google/gapid/core/math/interval" "github.com/google/gapid/gapis/api" "github.com/google/gapid/gapis/service/path" @@ -30,7 +29,7 @@ func (API) GetFramebufferAttachmentInfo( after []uint64, state *api.GlobalState, thread uint64, - attachment api.FramebufferAttachment) (api.FramebufferAttachmentInfo, err error) { + attachment api.FramebufferAttachment) (api.FramebufferAttachmentInfo, error) { return api.FramebufferAttachmentInfo{}, nil } diff --git a/gapis/api/testcmd/cmds.go b/gapis/api/testcmd/cmds.go index e8eeaa459b..2de1021f42 100644 --- a/gapis/api/testcmd/cmds.go +++ b/gapis/api/testcmd/cmds.go @@ -22,7 +22,6 @@ import ( "github.com/google/gapid/core/data" "github.com/google/gapid/core/data/deep" "github.com/google/gapid/core/data/protoconv" - "github.com/google/gapid/core/image" "github.com/google/gapid/core/os/device" "github.com/google/gapid/gapil/constset" "github.com/google/gapid/gapis/api" @@ -213,7 +212,7 @@ func (API) GetFramebufferAttachmentInfo( after []uint64, state *api.GlobalState, thread uint64, - attachment api.FramebufferAttachment) (api.FramebufferAttachmentInfo, err error) { + attachment api.FramebufferAttachment) (api.FramebufferAttachmentInfo, error) { return api.FramebufferAttachmentInfo{}, nil } func (API) Context(*api.GlobalState, uint64) api.Context { return nil } diff --git a/test/integration/replay/gles/gles_test.go b/test/integration/replay/gles/gles_test.go index 5991d8dd93..c4fea61912 100644 --- a/test/integration/replay/gles/gles_test.go +++ b/test/integration/replay/gles/gles_test.go @@ -693,6 +693,22 @@ func TestResizeRenderer(t *testing.T) { maybeExportCapture(ctx, "resize_renderer", capture) } +// TestNewContextUndefined checks that a new context is filled with the +// undefined framebuffer pattern. +func TestNewContextUndefined(t *testing.T) { + ctx, f := newFixture(log.Testing(t)) + + cmds, _, _ := f.initContext(ctx, 64, 64, true) + makeCurrent := api.CmdID(len(cmds) - 1) + + intent := replay.Intent{ + Capture: f.storeCapture(ctx, cmds), + Device: path.NewDevice(f.device.Instance().Id.ID()), + } + + checkColorBuffer(ctx, intent, f.mgr, 64, 64, 0.0, "undef-fb", makeCurrent, nil) +} + // TestPreserveBuffersOnSwap checks that when the preserveBuffersOnSwap flag is // set, the backbuffer is preserved between calls to eglSwapBuffers(). func TestPreserveBuffersOnSwap(t *testing.T) { diff --git a/test/integration/replay/gles/reference/undef-fb.png b/test/integration/replay/gles/reference/undef-fb.png new file mode 100644 index 0000000000..1e6d1b3c2e Binary files /dev/null and b/test/integration/replay/gles/reference/undef-fb.png differ