platform/upstream/Vulkan-LoaderAndValidationLayers.git
9 years agoWin: Can now use "static inline" on Windows (i.e. no code mods).
Ian Elliott [Wed, 18 Feb 2015 19:38:04 +0000 (12:38 -0700)]
Win: Can now use "static inline" on Windows (i.e. no code mods).

9 years agoloader: Windows now uses registry + env's (diff names)
Ian Elliott [Tue, 17 Feb 2015 17:33:47 +0000 (10:33 -0700)]
loader: Windows now uses registry + env's (diff names)

The loader on Windows now looks in the Windows Registry + in environment
variables for the following (Note the new names--"LIB" was dropped):

- XGL_DRIVERS_PATH
- XGL_LAYERS_PATH
- XGL_LAYER_NAMES

Linux still retains the "LIB" at the start of the environment variable names.

If both are used, they are concatenated into a semi-colon-delimited list.

A generic loader_get_registry_and_env() func is used to perform this (only for
Windows, since Linux doesn't have a registry).

9 years agoWin: Build Glave replay on Windows (REQUIRES NEW CMAKE COMMAND).
David Pinedo [Tue, 10 Feb 2015 22:02:08 +0000 (15:02 -0700)]
Win: Build Glave replay on Windows (REQUIRES NEW CMAKE COMMAND).

Starting with this commit, building XGL on Windows requires explicitly stating
whether a "Release" or "Debug" build is desired when doing the initial cmake
command.  This is documented in the "Build.md" file.

Linux trace of cube plays to completion on windows!

Changes to the null driver:
    advertise support for both WIN WSI and X11 WSI
    added support for xglCreateBufferView
    and added a logging capability (turned off by default)

Still have some issues:
    - x11 support emulation/replacement
    - Windows null driver creates a bad device queue
    - Need to copy libraries to dir containing the .exe

Glave ext libs are now put in same dir as glvreplay64.exe...

This change only affects Windows -- on Linux the libs and
the glave replay progs were already in the same dir.

Also added a line to BUILD.md regarding the need to have XGL.dll
in PATH.

9 years agoRedo the way Glave settings are obtained.
Ian Elliott [Wed, 18 Feb 2015 22:35:00 +0000 (15:35 -0700)]
Redo the way Glave settings are obtained.

9 years agonulldrv: Creation of the nulldrv, for use on Windows.
David Pinedo [Tue, 3 Feb 2015 01:02:40 +0000 (18:02 -0700)]
nulldrv: Creation of the nulldrv, for use on Windows.

Since the sample Intel driver hasn't been ported to Windows, this nulldrv is
being used to bootstrap Windows support.  It can also provide a hint to new
IHV's for how to set the magic number.

9 years agolayers: Updated mem_tracker for new header changes.
Mark Lobodzinski [Wed, 18 Feb 2015 22:38:17 +0000 (16:38 -0600)]
layers:  Updated mem_tracker for new header changes.

Brought mem-tracker up to header rev 47. Worked over tests and
demos to remove errors.

9 years agointel: silence a compiler warning
Chia-I Wu [Wed, 18 Feb 2015 17:30:50 +0000 (10:30 -0700)]
intel: silence a compiler warning

Silence

  warning: ‘buf_format’ may be used uninitialized in this function

9 years agointel: rework command buffer waiting
Chia-I Wu [Tue, 17 Feb 2015 21:29:01 +0000 (14:29 -0700)]
intel: rework command buffer waiting

When a bo is submitted, we need the submission sequence number which we can
wait for.  However, the kernel does not return the seqno.  We have to keep the
bo around and wait for the bo.  This fixes

  xglQueueSubmit(..., cmd, ...);
  xglDeviceWaitIdle(...);
  xglDestroyObject(..., cmd);
  xglDeviceWaitIdle(...);

where the second wait waited for a destroyed cmd buffer.

9 years agointel: rework xglQueueSubmit()
Chia-I Wu [Tue, 17 Feb 2015 21:11:29 +0000 (14:11 -0700)]
intel: rework xglQueueSubmit()

cmdBufferCount is usually large.  Add queue_submit_cmd_debug() and
queue_submit_cmd() depending on whether INTEL_DEBUG is set to reduce
branching.  Error handling is also improved such that xglQueueSubmit() appears
more atomic to callers.

9 years agoicd: add likely()/unlikely()
Chia-I Wu [Tue, 17 Feb 2015 21:20:58 +0000 (14:20 -0700)]
icd: add likely()/unlikely()

They will be expanded to __builtin_expect(...) on gcc.

9 years agotests: Fix cut-and-paste error in QuadWithIndexedVertexFetch test.
Mark Lobodzinski [Mon, 16 Feb 2015 20:24:23 +0000 (14:24 -0600)]
tests:  Fix cut-and-paste error in QuadWithIndexedVertexFetch test.

Looks like the wrong memory barrier was set.

9 years agocompiler: fix "fireflies" over water in dota2 with BIL
GregF [Tue, 17 Feb 2015 23:25:34 +0000 (16:25 -0700)]
compiler: fix "fireflies" over water in dota2 with BIL

A shader with an initialized global array was causing an llvm
code sequence the glassy backend translator had not yet seen. In
particular, a store of the array constant through a local pointer
into alloca space made it into Bottom IR. Loads and stores are not
normally seen in Bottom IR. Fixed emitIRStore to deal properly with
these stores.

9 years agoWin: MUST USE "STATIC_INLINE" instead of "static inline"
Ian Elliott [Tue, 17 Feb 2015 23:44:44 +0000 (16:44 -0700)]
Win: MUST USE "STATIC_INLINE" instead of "static inline"

9 years agoloader: Enable env extensions as well as app.
Courtney Goeltzenleuchter [Tue, 17 Feb 2015 21:21:21 +0000 (14:21 -0700)]
loader: Enable env extensions as well as app.

9 years agotests: Fix XGLTriangleTest to not bind VBO since it doesn't use one
Tobin Ehlis [Tue, 17 Feb 2015 23:30:46 +0000 (16:30 -0700)]
tests: Fix XGLTriangleTest to not bind VBO since it doesn't use one

9 years agocompiler: Disable faceforward decomposition, backend handles it
Cody Northrop [Tue, 17 Feb 2015 21:06:35 +0000 (14:06 -0700)]
compiler: Disable faceforward decomposition, backend handles it

9 years agoRevert "compiler: Allow texture unit bindings to also set sampler index"
Cody Northrop [Fri, 13 Feb 2015 16:08:43 +0000 (09:08 -0700)]
Revert "compiler: Allow texture unit bindings to also set sampler index"

This reverts commit c33ac9267a70115c29f97eb20966de4c9aed6938.

9 years agoRevert "compiler: If XGL is being used, assign buffer bindings directly from the...
Cody Northrop [Fri, 13 Feb 2015 16:08:41 +0000 (09:08 -0700)]
Revert "compiler: If XGL is being used, assign buffer bindings directly from the shader"

This reverts commit 2bec741ece71b9a5deffd31227e2c7a434dfa2cd.

9 years agocompiler: Support layout(set=,binding=)
Cody Northrop [Fri, 13 Feb 2015 18:53:09 +0000 (11:53 -0700)]
compiler: Support layout(set=,binding=)

This change allows shaders to specify set and binding.
The values come from BottomIR as packed 32-bit values:
16 high bits for set, 16 low bits for binding.
We allow them to remain together through the backend, then
split apart during resource map creation.

To facilitate this change, we also switched to using the
resource mapping tracked by the compiler, rather than
forcing bindings to match the descriptor set layout, which
was a short term solution.  This results in greatly reduced
binding table size.

9 years agocompiler: Bump Mesa SamplerUnits to 32 bits
Cody Northrop [Fri, 13 Feb 2015 18:50:41 +0000 (11:50 -0700)]
compiler: Bump Mesa SamplerUnits to 32 bits

This will facilitate packing set and binding through the stack.

9 years agocmake: support clang as the compiler
Chia-I Wu [Tue, 17 Feb 2015 16:55:34 +0000 (09:55 -0700)]
cmake: support clang as the compiler

One can use clang by running cmake like

 $ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

9 years agointel: fix a compile error with clang
Chia-I Wu [Tue, 17 Feb 2015 16:55:13 +0000 (09:55 -0700)]
intel: fix a compile error with clang

sizeof(ir_texture::lod_info) is considered invalid by clang because lod_info
is not a static member.

9 years agointel: fix the param type of img_type_to_view_type()
Chia-I Wu [Tue, 17 Feb 2015 16:51:00 +0000 (09:51 -0700)]
intel: fix the param type of img_type_to_view_type()

It should be XGL_IMAGE_TYPE, not XGL_IMAGE_VIEW_TYPE.

9 years agointel: fix stencil refs for stencil clears
Chia-I Wu [Tue, 17 Feb 2015 16:48:37 +0000 (09:48 -0700)]
intel: fix stencil refs for stencil clears

This was overlooked in the prior fix.

9 years agolayers: Fix compilation error on ObjectTracker and Generic layer
Jon Ashburn [Tue, 17 Feb 2015 18:03:12 +0000 (11:03 -0700)]
layers: Fix compilation error on ObjectTracker and Generic layer

9 years agointel: Add colorAttachmentCount
Courtney Goeltzenleuchter [Tue, 10 Feb 2015 21:06:25 +0000 (14:06 -0700)]
intel: Add colorAttachmentCount

bug #13268
header revision: r29554
Add colorAttachmentCount to CREATE_RENDER_PASS_INFO to aid tracing tools.

9 years agointel: Remove unnecessary dualBlendMode enable
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 21:14:45 +0000 (14:14 -0700)]
intel: Remove unnecessary dualBlendMode enable

bug #12925
header version: r29511
Can determine dualBlendModeEnable from blend information provided.
Integrate review feedback.

9 years agointel: Remove scissor enable and scissor count
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 21:13:34 +0000 (14:13 -0700)]
intel: Remove scissor enable and scissor count

bug #12925
header version: r29511
Remove separate scissor enable and scissor count. Scissor always
enabled and must always provide scissor rect for every viewport.

9 years agoAdd detail on cloning repo
Courtney Goeltzenleuchter [Fri, 13 Feb 2015 16:30:42 +0000 (09:30 -0700)]
Add detail on cloning repo

9 years agoglave: Fix layer settings typo.
Jeremy Hayes [Mon, 16 Feb 2015 18:22:42 +0000 (11:22 -0700)]
glave: Fix layer settings typo.

9 years agoglave: Add ObjectTracker layer.
Jon Ashburn [Mon, 16 Feb 2015 17:01:05 +0000 (10:01 -0700)]
glave: Add ObjectTracker layer.

Also remove MemTracker layer for now since it is not currently built.

9 years agolayers: Have DrawState and MemTracker use the common code for reporting
Jon Ashburn [Mon, 16 Feb 2015 15:46:53 +0000 (08:46 -0700)]
layers: Have DrawState and MemTracker use the common code for reporting

9 years agolayers: Add settings controls for the generated layers. Includes ParamChecker, Object...
Jon Ashburn [Mon, 16 Feb 2015 15:26:50 +0000 (08:26 -0700)]
layers: Add settings controls for the generated layers. Includes ParamChecker, ObjectTracker and Generic. Adds the controls for ReportingLevel, ReportingAction and log filename for these layers. Place the common callback code in a header these layers can include.

9 years agointel: fix stencil refs
Chia-I Wu [Mon, 16 Feb 2015 22:34:45 +0000 (15:34 -0700)]
intel: fix stencil refs

9 years agolayers: Add simple txt print of CmdBuffer contents
Tobin Ehlis [Fri, 13 Feb 2015 20:30:07 +0000 (13:30 -0700)]
layers: Add simple txt print of CmdBuffer contents

9 years agolayers: Track DrawState on a per-cmd-buffer basis
Tobin Ehlis [Fri, 13 Feb 2015 17:26:14 +0000 (10:26 -0700)]
layers: Track DrawState on a per-cmd-buffer basis

9 years agoloader: Change sample code to not include a pointer.
Ian Elliott [Fri, 13 Feb 2015 23:51:05 +0000 (16:51 -0700)]
loader: Change sample code to not include a pointer.

It could imply that the ICD needs to allocate space for it.  The pointer is
really to be owned by the loader.

9 years agoloader: Fix and enhance README.md.
Ian Elliott [Fri, 13 Feb 2015 18:23:05 +0000 (11:23 -0700)]
loader: Fix and enhance README.md.

Several adjustments were made, including:

1) Add some MS Windows-related information.  For example, the loader is
   "XGL.dll" on Windows, and "libSGL.so" on Linux.  Also, the separator
   character is given, for each OS, for the PATH environment variables.

2) Add some addition information about dispatching.

3) Add example code for setting the magic value in the ICD.

4) Fix the numbering that looked fine in the "mardown" website, but not on
   GitHub.

5) Try to improve grammar, punctuation, etc.

9 years agoEliminate "-Wsign-compare" warnings on Linux ...
Ian Elliott [Fri, 13 Feb 2015 21:29:21 +0000 (14:29 -0700)]
Eliminate "-Wsign-compare" warnings on Linux ...

With these being newly enabled for the loader, layers, and demos (and it turns
out, for the icd/common directory), it is appropriate to fix them.

9 years agoEnable additional Linux warnings, for loader/layers/demos.
Ian Elliott [Fri, 13 Feb 2015 21:04:01 +0000 (14:04 -0700)]
Enable additional Linux warnings, for loader/layers/demos.

The intention is for Linux developers to catch more problems (real or
annoyance) before porting to Windows.

The new warnings are:

-Wpointer-arith
-Wsign-compare

These are not used for the Intel sample driver (mostly because the Intel
compiler from Mesa3D generates lots of these warnings, which code we don't want
to modify), nor for the tests.

Not sure how this affects Glave on Linux.

9 years agoglave: Replay for UpdateDescriptor handle multiple replays
Jon Ashburn [Fri, 13 Feb 2015 18:25:53 +0000 (11:25 -0700)]
glave: Replay for UpdateDescriptor handle multiple replays

The local chain copy had embedded pointers into the original chain. So
multiple replays/remaps weren't working.  Simplify code to just save a queue
of the actaul objects that need to be remapped  and restore them  after making
the call to xglUpdateDescriptors().

9 years agoMinor fix/enhancement to BUILD.md.
Ian Elliott [Fri, 13 Feb 2015 17:57:55 +0000 (10:57 -0700)]
Minor fix/enhancement to BUILD.md.

1) Point CMake to www.cmake.org insead of www.python.org.

2) Give a couple of helpful pointers for ICD developers.

9 years agoWin: Attempt to keep from using Linux functions.
Ian Elliott [Fri, 13 Feb 2015 00:08:34 +0000 (17:08 -0700)]
Win: Attempt to keep from using Linux functions.

This is a hopefully-temporary solution to prevent some of the problems of
people breaking the Windows build while developing on Linux (or vice-versa).

This uses macros of the names of Linux/Windows-specific functions in order to
catch people who use those functions directly, instead of using the
platform-compatibility-layer functions.

In order to avoid problems with the layers #include'ing "loader_platform.h"
before they #include system files (which can mess them up), I #include
"loader_platform.h" twice.  The 2nd time, it #define's the hopefully-temporary
macros.

Note: For some reason, we can't #define LoadLibrary().  It generates warnings
on Windows.

9 years agoLinux: Add back the "C99" comment within "loader_platform.h"
Ian Elliott [Thu, 12 Feb 2015 23:44:56 +0000 (16:44 -0700)]
Linux: Add back the "C99" comment within "loader_platform.h"

9 years agoicd: add loader magic word to verify ICD is compatible
Courtney Goeltzenleuchter [Wed, 11 Feb 2015 01:40:14 +0000 (18:40 -0700)]
icd: add loader magic word to verify ICD is compatible

We wanted a more explicit way to determine if the driver
ICD being loaded is providing compatible objects. To do
that we check for a magic dword value at the beginning
of the object. Non-compliant ICDs will assert in the loader
or the loader's dispatch functions if an object does
not have the correct value.
Dispatch checks are debug only.

9 years agoWin/icd: Move STATIC_INLINE macro, and use for magic funcs.
Ian Elliott [Thu, 12 Feb 2015 20:20:10 +0000 (13:20 -0700)]
Win/icd: Move STATIC_INLINE macro, and use for magic funcs.

The STATIC_INLINE macro is now in "xglPlatform.h".  It is also now being used
by the *_loader_magic_value() functions.  This allows it to be compiled on
Windows.

9 years agoglave: Unregister debug callback on DestroyInstance()
Jon Ashburn [Thu, 12 Feb 2015 19:37:46 +0000 (12:37 -0700)]
glave: Unregister debug callback on DestroyInstance()

9 years agoicd: Fix removing callback from global list
Jon Ashburn [Thu, 12 Feb 2015 19:36:37 +0000 (12:36 -0700)]
icd: Fix removing callback from global list

Callback wasn't getting actually removed from the list.

9 years agoglave: Handle null pointers in stringify of entrypoint parameters
Jon Ashburn [Thu, 12 Feb 2015 17:38:36 +0000 (10:38 -0700)]
glave: Handle null pointers in stringify of entrypoint parameters

Also add "*" for those pointers that are dereferenced.

9 years agoUpdate BUILD.md
Jens Owen [Thu, 12 Feb 2015 22:38:13 +0000 (15:38 -0700)]
Update BUILD.md

Update to build steps from Mike Sartain

9 years agointel: fix mulitple descriptor sets/regions
Chia-I Wu [Thu, 12 Feb 2015 17:15:42 +0000 (10:15 -0700)]
intel: fix mulitple descriptor sets/regions

Without adding set->pool_begin to the offsets provided by rmap, we always read
from the beginning of the descriptor pool.  Replace the error-prone
intel_desc_pool_read_*() by intel_desc_set_read_*() to get automatic
offsetting.

9 years agointel: fix -Wmaybe-uninitialized warnings
Chia-I Wu [Wed, 11 Feb 2015 20:19:39 +0000 (13:19 -0700)]
intel: fix -Wmaybe-uninitialized warnings

9 years agointel: fix -Wunused-(but-set-)variable warnings
Chia-I Wu [Wed, 11 Feb 2015 20:44:50 +0000 (13:44 -0700)]
intel: fix -Wunused-(but-set-)variable warnings

9 years agoicd: add U_ASSERT_ONLY
Chia-I Wu [Wed, 11 Feb 2015 20:23:57 +0000 (13:23 -0700)]
icd: add U_ASSERT_ONLY

It can be applied to variables that are only used in assert().

9 years agointel: add INTEL_DEBUG=hang
Chia-I Wu [Wed, 11 Feb 2015 18:27:06 +0000 (11:27 -0700)]
intel: add INTEL_DEBUG=hang

When enabled, make command buffer submission synchronous and decode the
command buffer that hangs the GPU.

9 years agointel: add intel_winsys_read_reset_stats()
Chia-I Wu [Wed, 11 Feb 2015 18:26:44 +0000 (11:26 -0700)]
intel: add intel_winsys_read_reset_stats()

It can be used to read how many active and pending batch buffers are discarded
so far due to GPU resets.

9 years agointel: do not submit invalid command buffers
Chia-I Wu [Wed, 11 Feb 2015 18:23:52 +0000 (11:23 -0700)]
intel: do not submit invalid command buffers

We do not know what are in an invalid command buffer and we should not submit
it to GPU.

9 years agointel: add cmd_fail() to signal command buffer errors
Chia-I Wu [Tue, 10 Feb 2015 18:04:44 +0000 (11:04 -0700)]
intel: add cmd_fail() to signal command buffer errors

The main purpose is have a place to set breakpoing on on command buffer
errors.

9 years agointel: always emit "post" WAs
Chia-I Wu [Wed, 11 Feb 2015 18:19:34 +0000 (11:19 -0700)]
intel: always emit "post" WAs

For workaround PIPE_CONTROLs that are needed "after" commands, they should
never be skipped.

9 years agointel: set up mappable and total aperture sizes
Chia-I Wu [Wed, 11 Feb 2015 18:10:14 +0000 (11:10 -0700)]
intel: set up mappable and total aperture sizes

The mappable size is usually 256MB.  This is the amount of memories that can
be simultaneously mapped.  The total size is usually 2GB.  This is the amount
of memories that can be referenced in a command buffer.  The real limit
imposed by intel_winsys_can_submit_bo() is lower: 3/4 the total size minus fb
and etc.

These are set up but not used.  Not sure if we want to expose a separate heap
for mappable memories.

9 years agointel: use the same PCB alloc setup for normal and meta paths
Chia-I Wu [Thu, 5 Feb 2015 18:14:01 +0000 (11:14 -0700)]
intel: use the same PCB alloc setup for normal and meta paths

Eventually, we will set up PCB alloc once per command buffer.  Let both paths
agree with each other for now.

9 years agointel: double PCB alloc on GT3
Chia-I Wu [Wed, 11 Feb 2015 18:04:05 +0000 (11:04 -0700)]
intel: double PCB alloc on GT3

The available space is doubled on GT3.

9 years agointel: set up dummy drawing rect when unused in meta
Chia-I Wu [Wed, 28 Jan 2015 16:35:56 +0000 (00:35 +0800)]
intel: set up dummy drawing rect when unused in meta

We do not want it to have misleading values when analysizing the batch buffer
dumps.

9 years agointel: do not emit 3DSTATE_SBE on Gen6
Chia-I Wu [Wed, 28 Jan 2015 16:34:24 +0000 (00:34 +0800)]
intel: do not emit 3DSTATE_SBE on Gen6

The commands in intel_pipeline are copied into the batch buffer directly.  We
should not have 3DSTATE_SBE in it on Gen6.

9 years agoWin: "layers_config.cpp" must #include "loader_platform.h"
Ian Elliott [Thu, 12 Feb 2015 18:36:03 +0000 (11:36 -0700)]
Win: "layers_config.cpp" must #include "loader_platform.h"

9 years agoWin: Build both "layer_utils.lib" and "layer_utils.dll".
Ian Elliott [Thu, 12 Feb 2015 18:36:44 +0000 (11:36 -0700)]
Win: Build both "layer_utils.lib" and "layer_utils.dll".

9 years agointel: increase max_batch_buffer_size to 150K dwords
Mike Stroyan [Mon, 9 Feb 2015 20:08:26 +0000 (13:08 -0700)]
intel: increase max_batch_buffer_size to 150K dwords

Increasing the max batch buffer size allows more relocations per command buffer.

9 years agointel: suppress PIPE_CONTROL with 0 flags
Mike Stroyan [Sat, 31 Jan 2015 00:21:08 +0000 (17:21 -0700)]
intel: suppress PIPE_CONTROL with 0 flags

9 years agointel: use surface base offset for meta surfaces
Mike Stroyan [Tue, 10 Feb 2015 22:09:23 +0000 (15:09 -0700)]
intel: use surface base offset for meta surfaces

Subtract off surface base address from surface offsets in meta surface states.

9 years agointel: honor 64KB limit of BINDING_TABLE_STATEs
Chia-I Wu [Mon, 9 Feb 2015 20:17:47 +0000 (04:17 +0800)]
intel: honor 64KB limit of BINDING_TABLE_STATEs

The higher 16 bits of binding table offset in 3DSTATE_BINDING_TABLE_POINTERS_x
must be 0.  BINDING_TABLE_STATEs must reside in the first 64KB of Surface
State Base Address as programmed by STATE_BASE_ADDRESS.

In this commit, we update Surface State Base Address when there is a chance to
exceed the limit.

9 years agointel: allocate a separate surface state bo
Chia-I Wu [Mon, 9 Feb 2015 20:07:40 +0000 (04:07 +0800)]
intel: allocate a separate surface state bo

Add INTEL_CMD_WRITER_SURFACE to intel_cmd, and write BINDING_TABLE_STATEs and
SURFACE_STATEs to the new writer.  Fix cmd_batch_state_base_address() up for
the separation.

9 years agointel: BINDING_TABLE_STATEs are in surface state bo
Chia-I Wu [Mon, 9 Feb 2015 20:07:29 +0000 (04:07 +0800)]
intel: BINDING_TABLE_STATEs are in surface state bo

Logically, we want to write BINDING_TABLE_STATEs with cmd_surface_write()
instead of cmd_state_write().  They are the same now, but we are going to
change that.

9 years agointel: refactor cmd_batch_begin()
Chia-I Wu [Mon, 9 Feb 2015 20:11:31 +0000 (04:11 +0800)]
intel: refactor cmd_batch_begin()

Add cmd_batch_state_base_address() and call it from cmd_batch_begin().

9 years agointel: Initialize bool to prevent using bad format data
Cody Northrop [Tue, 10 Feb 2015 16:28:30 +0000 (09:28 -0700)]
intel: Initialize bool to prevent using bad format data

9 years agoglvdebug: Fix UI interactions when a ProxyModel is being used on the API Call Tree.
Peter Lohrmann [Thu, 12 Feb 2015 02:54:58 +0000 (18:54 -0800)]
glvdebug: Fix UI interactions when a ProxyModel is being used on the API Call Tree.

* Selecting a timeline item now correctly selects Call Tree Item, and vice-versa.
* Navigating by draw call now supports ProxyModels.
* Navigating by search results now supports ProxyModels.
* Pressing [Enter] after typing in a search string does NOT yet search correctly when a ProxyModel is used.
** It will always turn the search text box red, as if it didn't not find the string, even though the string may actually exist in the tree.
** However, typing in the search text box DOES properly highlight the matching fields. Just pressing [Enter] doesn't work as expected.

9 years agoglvdebug_xgl: Fix potential crash in QGroupFramesProxyModel.
Peter Lohrmann [Thu, 12 Feb 2015 02:53:58 +0000 (18:53 -0800)]
glvdebug_xgl: Fix potential crash in QGroupFramesProxyModel.

* Crash would occur if row was outside of valid range.

9 years agoglvreplay_xgl: Fix unregistering of debug message callback.
Peter Lohrmann [Wed, 11 Feb 2015 21:56:35 +0000 (13:56 -0800)]
glvreplay_xgl: Fix unregistering of debug message callback.

* This now returns successfully, however loading & replaying a new trace file will still result in a crash.

9 years agoglvdebug: Hide the unused State tab.
Peter Lohrmann [Wed, 11 Feb 2015 21:39:10 +0000 (13:39 -0800)]
glvdebug: Hide the unused State tab.

* We currently don't support any content for this tab, so removing it.
* The tabWidget must be created with a tab, so it can't go away completely, but at least it allows us to remove the one tab.

9 years agoglvdebug: Add highlight and shadow around timeline items.
Peter Lohrmann [Tue, 10 Feb 2015 23:21:13 +0000 (15:21 -0800)]
glvdebug: Add highlight and shadow around timeline items.

* This makes it easier to distinguish between items that are right next to one another.
* Also fix the black border that is drawn around the current item, it was overlapping the left-most pixel of the item.

9 years agoglvdebug: Timeline optimizations.
Peter Lohrmann [Tue, 10 Feb 2015 22:01:55 +0000 (14:01 -0800)]
glvdebug: Timeline optimizations.

* Improve rendering performance by calculating a per-thread drawing mask, to prevent drawing multiple timeline items to the same pixel.
** If any of the pixels covered by the item have not been drawn to before, then the item will be drawn. This avoids small items from hiding longer items.
** In a trace with 819115 items, this mask removed 817911 items, resulting in only 1204 being drawn, with no loss of quality in the timeline.

* Improve performance of IndexAt() by first checking if the point is within the area that timeline items are drawn.

9 years agoglvdebug: Improve zooming of timeline.
Peter Lohrmann [Tue, 10 Feb 2015 20:48:17 +0000 (12:48 -0800)]
glvdebug: Improve zooming of timeline.

* Timeline zoom is now smoothed using cos()
* Zooming will now happen centered on the mouse position.

9 years agoglvdebug: Removed draw state diagram while not paused.
Jeremy Hayes [Tue, 10 Feb 2015 16:36:46 +0000 (09:36 -0700)]
glvdebug: Removed draw state diagram while not paused.

9 years agoglvdebug: Major changes to the Timeline.
Peter Lohrmann [Tue, 10 Feb 2015 00:00:57 +0000 (16:00 -0800)]
glvdebug: Major changes to the Timeline.

* The timeline can now be zoomed and scrolled.
* Timeline items are drawn with a gradient to help distinguish items that are next to each other (this still needs some improvement).
* All the timeline rectangles are now pre-built, and only the rects that are within the viewport are drawn.
* If the timeline is zoomed in, clicking in the call tree with scroll to and center the selected item in the timeline.
* Rendering of the timeline is interactive depending on the number of items in view. However when the entire timeline is visible there are lots of rects being drawn to the same pixel; this leaves lots of room for optimization.

9 years agoglvdebug: Timeline now supports ItemDelegates, and other rendering improvements.
Peter Lohrmann [Thu, 5 Feb 2015 00:21:34 +0000 (16:21 -0800)]
glvdebug: Timeline now supports ItemDelegates, and other rendering improvements.

* Timeline items are now drawn with a default QAbstractItemDelegate. Supporting delegates means we can have more interesting rendering options down the road (ie, colors based on things other than duration cost).
* Cleaned up extraneous (and confusing) calls to translate the painter, and also removed unnecessary calls save() and restore() the painter state.
* The timeline marker is now positioned centered under the item rect, which makes it look much cleaner than before.
* The timeline marker is now a little larger and has an antialiased dark gray border instead of an aliased black border.

9 years agoglvdebug: Timeline Improvements.
Peter Lohrmann [Wed, 4 Feb 2015 20:59:22 +0000 (12:59 -0800)]
glvdebug: Timeline Improvements.

* Draw black outline around current timeline item
* Current timeline item is controlled by setCurrentIndex() as provided by QAbstractItemView.
* Clicking on a timeline item selects it as the current index.
* Selecting a timeline item also selects the corresponding index in the tree view.
** Caveat: does not yet work with proxy models on the tree view.
* Current timeline item marker (arrow) is drawn in yellow rather than a funky gradient.
* Optimized finding of current timeline item (don't search for the index, just ask for it!)
* Misc code clean up in timeline and glvdebug.

9 years agoglvdebug: Replaced system calls with Qt.
Jeremy Hayes [Wed, 4 Feb 2015 18:52:14 +0000 (11:52 -0700)]
glvdebug: Replaced system calls with Qt.

    Replaced "access" call with QFileInfo.
    Replaced "system" call with QProcess.

9 years agoAdd draw state diagram on pause events.
Jeremy Hayes [Thu, 29 Jan 2015 20:03:36 +0000 (13:03 -0700)]
Add draw state diagram on pause events.

    Add a Qt image viewer.
    Use Qt image viewer to view draw state diagram.
    Dump DOT files in appropriate entry points.

Conflicts:
layers/draw_state.c

9 years agoglvdebug: Update TODO
Peter Lohrmann [Wed, 4 Feb 2015 03:13:37 +0000 (19:13 -0800)]
glvdebug: Update TODO

* Added new timeline enhancements - per-thread timelines, and tooltips
* API Call tree can be grouped by thread id

9 years agoglvdebug: Timeline now supports tooltips.
Peter Lohrmann [Wed, 4 Feb 2015 03:05:45 +0000 (19:05 -0800)]
glvdebug: Timeline now supports tooltips.

* Hovering the mouse cursor over a timeline item now displays a tool tip that shows the call index, and entrypoint name & parameters.
* Currently the tooltip has a black background and looks like a window that failed to render, but as far as I can tell that is the default support for tooltips. We can probably spice it up a bit in the future.
* This change also implements several virtual methods of QAbstractItemView; I'm not convinced that they all work properly, but I'm sure additional testing and usage will help solidify things.

9 years agoglvdebug: Initial support for per-thread timelines.
Peter Lohrmann [Wed, 4 Feb 2015 00:47:13 +0000 (16:47 -0800)]
glvdebug: Initial support for per-thread timelines.

* This supports all the previous functionality, except that now a separate timeline is drawn for each thread, and the thread Id is displayed on the timeline.
* When the current API call changes, the timeline will update, and the marker will indicate which thread the call is on.
* The new implementation inherits from QAbstractItemView, so it will give us much more interaction in the future, including selecting timeline items and displaying tooltips.
* The new implementation also directly uses the glvdebug_QTraceFileModel, and thus removes the need for the glvdebug_timelineitem and glvdebug_timelinemodel. This saves time when loading and also ensures that the API call tree and timeline are reflecting the same underlying data.

Caveats:
* When more than 4-5 threads are being used, the layout of the thread Id text, timeline items, and current API call marker starts to overlap and look bad. This will be revisited.
* The current view will not properly support a ProxyModel, so enabling or disabling the GroupFramesProxyModel and GroupThreadsProxyModel will have no affect on the timeline.

9 years agoglvdebug: Fix bugs in QGroupThreadsProxyModel
Peter Lohrmann [Fri, 30 Jan 2015 01:32:44 +0000 (17:32 -0800)]
glvdebug: Fix bugs in QGroupThreadsProxyModel

* The 'Thread #' columns now only show contents if the associated API call (or group node) is for that specific thread id.
* Fix bug that was causing the last child of a thread node to be associated with the incorrect group - which caused some thread nodes to appear empty.

9 years agoglvdebug: Hide the 'Thread Id' column if the QGroupThreadsProxyModel is being used.
Peter Lohrmann [Wed, 28 Jan 2015 22:43:59 +0000 (14:43 -0800)]
glvdebug: Hide the 'Thread Id' column if the QGroupThreadsProxyModel is being used.

9 years agoglvdebug: Refactor column index logic in QGroupThreadsProxyModel.
Peter Lohrmann [Wed, 28 Jan 2015 21:49:24 +0000 (13:49 -0800)]
glvdebug: Refactor column index logic in QGroupThreadsProxyModel.

* Centralize where the column index comparison happens to make reading the code easier.
* Also a helper function for coverting a proxy column index into a 'thread #' column index.

9 years agoglvdebug: GroupThreadsProxyModel improvements.
Peter Lohrmann [Wed, 28 Jan 2015 19:51:46 +0000 (11:51 -0800)]
glvdebug: GroupThreadsProxyModel improvements.

* Simplify threadId look-up by finding the key from the value.
* The 'Thread #' column now shows the thread Id for the thread group nodes, this will help with visualizing thread execution when all nodes are collapsed.

9 years agoglvdebug: Improve resizing of columns in the API Call tree.
Peter Lohrmann [Tue, 27 Jan 2015 23:27:34 +0000 (15:27 -0800)]
glvdebug: Improve resizing of columns in the API Call tree.

* The API Call column is still giving 55% of the widget.
* The remaining 45% of space is divided equally among the remaining visible columns. This greatly improves visibility if a ProxyModel is being used which adds (or removes) columns.

9 years agoglvdebug_xgl: Initial support for grouping calls by thread Id
Peter Lohrmann [Tue, 27 Jan 2015 22:47:17 +0000 (14:47 -0800)]
glvdebug_xgl: Initial support for grouping calls by thread Id

* Creates a parent node each time the thread id between consecutive calls changes.
* Adds an additional column for each Thread Id to make it easier to see where API calls are being executed.

9 years agoglvdebug: Improve replay highlighting of api calls on stop / finish.
Peter Lohrmann [Tue, 27 Jan 2015 20:45:06 +0000 (12:45 -0800)]
glvdebug: Improve replay highlighting of api calls on stop / finish.

* Fix a bug where the 'play to here' context menu option was not working correctly if a proxy model was used on the treeView.
* Reset the 'play to here' indicator after the api call is reached, otherwise subsequent 'play' would continue to pause on the 'play to here' call.
* Previously there was a sense of incompletion when the replay finished because the tree view would not update to reflect the new location. The treeView now highlights the final API call when the replay is finished.
* Previously when the replay was stopped, the treeView was not updated to a new location. Since stopping the replay also resets it back to the beginning of the trace, the first API call is now selected.
* Pausing continues to select the API call that was paused on.

9 years agoglave: Update supported features in TODO list
Peter Lohrmann [Tue, 27 Jan 2015 01:22:36 +0000 (17:22 -0800)]
glave: Update supported features in TODO list

* Now able to group API calls based on frame boundary

9 years agoglvdebug_xgl: Pausing the replay now correctly selects and scrolls to the API Call...
Peter Lohrmann [Tue, 27 Jan 2015 01:09:27 +0000 (17:09 -0800)]
glvdebug_xgl: Pausing the replay now correctly selects and scrolls to the API Call when the GroupFramesProxyModel is being used.

* Override the match(..) method so that it remaps from source matches to proxy indexes.
* There might be a problem with the index(..) and parent(..) implementations because I have to force the column of the match's index and parent to be 0.

9 years agoglvdebug_xgl: qgroupframesproxymodel now supports displaying additional columns.
Peter Lohrmann [Mon, 26 Jan 2015 20:48:26 +0000 (12:48 -0800)]
glvdebug_xgl: qgroupframesproxymodel now supports displaying additional columns.

* Now that the table has an 'Index' column, pausing the replay will highlight the correct row. HOWEVER, the treeview is not scrolling to the line as expected.
* Currently rows are not hidden when a proxy model is being used.