* some preliminary work to test/benchmark bindless texture in the future (glsl was not yet updated)
Bindless texture allow to get a GPU texture pointer and then set it directly
to the shader as a basic uniform.
=> no more texture unit selection/validation
=> no more texture validation neither texture hash lookup
3rdparty: update gl header to the latest gl4.4
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5720 96395faa-99c1-11dd-bbfe-3dabce05a288
Card that support gs:
remain only a gs to generate sprite from a line. Even dummy gs are costly for the GPU.
Card that don't support gs:
remove useless copy of color for line and triangle primitives
Note for dx: opengl 3.2 (maybe not gles) supports both flat interpolation
convention (GL_FIRST_VERTEX_CONVENTION or GL_LAST_VERTEX_CONVENTION). It might
be possible to shuffle vertex index to put the last vertex in first position.
- buff[0] = head + 0;
- buff[1] = head + 1;
- buff[2] = head + 2;
+ buff[0] = head + 2;
+ buff[1] = head + 1;
+ buff[2] = head + 0;
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5718 96395faa-99c1-11dd-bbfe-3dabce05a288
The idea was to replace shader program swith by pointer function calls inside
shaders. At least parameters that are often changed between draw call. So far
I only ported atst and colclip. Unfortunately code is "slower" (on GSdx standalone).
For the moment keep the code but disabled.
If I understand well the validation of program is done in the "driver thread"
but the additional call are done in the overloaded MTGS thread. Apitrace
profiling shows faster GPU draw calls. Another possibility is that the driver still
need to validate the draw call because of others state change.
Here some stats on colin3 (90 frames):
without subroutine: UseProgram 125246
with subroutine: UseProgram 2906, subroutine 125945 => 3605 extra calls overhead (not
all parameters are ported to subroutine)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5715 96395faa-99c1-11dd-bbfe-3dabce05a288
Note: I think we can do the same on DX11
Perf wise: on colin mcrae 3 it reduces shader prog setup from 3005 to 2086 each frames. It saves 2 ms of CPU processing (27->29fps)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5714 96395faa-99c1-11dd-bbfe-3dabce05a288
* move most of gl states into a separate namespace. Extend it to depth/stencil/blend micro state
=> save 10,000 opengl call by frame for colin mcrae 3
* Only setup blend state of first drawbuffer
* Don't request anymore a debug context on dev/release build
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5713 96395faa-99c1-11dd-bbfe-3dabce05a288
* preliminary work for GL4.4 extensions (ARB_clear_texture & ARB_multi_bind). Disabled until I got a 4.4 driver
Note: I plan also to use ARB_buffer_storage
* compute texture gl option in the constructor (avoid a couple of swith case)
* redo texture unit management. Unit 0-2 for shaders, Unit 3 for texture operations. MultiBind will allow to bind
shader input without disturbing texture binding points.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5711 96395faa-99c1-11dd-bbfe-3dabce05a288
* add a non-working hack: UserHacks_DateGL4, goal was to replace UserHacks_AlphaStencil
+ Detection of good/bad samples is based on primitive ID variable. However I'm not sure
the behavior is always the same between draw call...Anyway let's keep a copy of the current
work
* Dump integer texture into text csv
* add gl4.2 ARB_shader_image_load_store extension (needed by UserHacks_DateGL4)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5707 96395faa-99c1-11dd-bbfe-3dabce05a288
* allow to switch renderer with F9
* skip first frame in stat of the replayer
* drop msaa. Fxaa and internal resolution will do the job
* move texture attachment from texture object into device object (allow to keep sanely the state)
* split the write buffer and attachment setup
* completely split sampler and texture input setup
* redo GSDeviceOGL::CopyOffscreen to avoid an extra copy.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5704 96395faa-99c1-11dd-bbfe-3dabce05a288
* use gles header file, disable opengl code (mainly GLX, ARB_sso, geometry shader)
* Define properly the function pointer, GLES use basic linking whereas GL must get the symbol dynamically
* cmake: properly search and set libglesv2.so
* don't use dual source blending => HW renderer work (only miss unimportant FBA)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5701 96395faa-99c1-11dd-bbfe-3dabce05a288
* remove the possibility to compile shader from file. Some people loads older shaders...
The feature might be readded later
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5697 96395faa-99c1-11dd-bbfe-3dabce05a288
* Separate state and shader compilation into separate function
* replace various hash_map by basic array
* Compact VertexScale and offset into a single vec4
* add the new option "ogl_vertex_subdata": subdata is faster on FGLRX, test are welcome on Nvidia drivers
0 => use map/unmap
1 => use subdata
replay: add "linux_replay" option and compute some nice stat (mean, standard deviation)
cmake: recreate shader header at build time
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5682 96395faa-99c1-11dd-bbfe-3dabce05a288
* Don't write color during stencil. Keep the old method to ease debug
* Realign date shader on DX
* keep stencil ref to 1. Reduce stencil management burder
* Fix texture pitch (was in pixels but need bytes). Fix Bleach Blade Battlers 2. Thanks Miseru for your trace
Remember note:
fxaa -> not yet implemented
msaa -> not implemented (I might drop it actually)
8 bit texture -> not yet implemented
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5657 96395faa-99c1-11dd-bbfe-3dabce05a288
* factorize sample object creation
* remember frame buffer attachment state
* Use a basic context on EGL. Allow to use Mesa 9.1 on AMD GPU.
* precompile vertex and geometry shader to avoid benchmark polution on replay
* Try harder to detect FGLRX driver on window
* various clean
Remain to fix the coordinate system for upscaling
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5651 96395faa-99c1-11dd-bbfe-3dabce05a288
* clean texture management & use different texture unit for various texture operation
* separate sampler and texture setup
* Always disable GL_SCISSOR_TEST before any cleaning to be sure the all pixels are reset
* properly set upscale_multiplier in the linux gui (was mixed with msaa). Unfortunately it is still broken...
* Fix EGL with GSopen1
* Use stdcall for function definition in the replay (avoid segmentation fault)
* Directly use gl_Position in shader instead of an extra user defined variable
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5648 96395faa-99c1-11dd-bbfe-3dabce05a288
* remove an old&useles dummy geometry shader (was used to workaround amd bug)
* use a basic X11 window for GSopen1
* redo the replayer: it is now based on dlopen rather than standard static/dynamic library. AMD driver doesn't play nicely with the later...
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5639 96395faa-99c1-11dd-bbfe-3dabce05a288
* replace both DISABLE_GL41_SSO and DISABLE_GL42 macro with a dynamic check based on the extension support
* glsl2h: use static instead of extern
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5636 96395faa-99c1-11dd-bbfe-3dabce05a288
* add a perl script to convert shader to char*
* By default use *.glsl file (handy to do some trials).
Only drawback, glsl2h need to be manually called at the moment
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5632 96395faa-99c1-11dd-bbfe-3dabce05a288
* workaround AMD driver bleding issue (got at least a nice rendering in GoW)
* would run on the opensource driver when they support geometry shader
Stil got some crash on the driver. Arg!!!
FGLRX user if you want to do some trials
uncomment #define DISABLE_GL41_SSO in GSdx/config.h
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5630 96395faa-99c1-11dd-bbfe-3dabce05a288
* Use bigger index for Uniform buffer to avoid any collision with sampler.
* add a new config to disable openGL 4.2 requirement. Would be done at runtime later.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5620 96395faa-99c1-11dd-bbfe-3dabce05a288
* port KrossX patch from r5556 to openGL
* add a basic gui entry, would love an additional description
* also add the pointsampler hack but don't activate it yet
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5570 96395faa-99c1-11dd-bbfe-3dabce05a288
* Update project files
* basic compilation fix: include stdafx, s/uint/uint32/
* add selection of the opengl renderer/device in gsopen
Remain to fix opengl function declaration/initialization
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5505 96395faa-99c1-11dd-bbfe-3dabce05a288
* move all remaining glx into the dedicated GLwin object
* rework a bit WGL to separate opengl context and window creation (like linux actually)
gsdx: Allow to control vsync. Not sure I used the good extension.
cmake:
* check that EGL opengl context creation
* Shut up gcc warning when force inline might not work...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5437 96395faa-99c1-11dd-bbfe-3dabce05a288
* add some dummy shader. Can be modify inside the debugger apitrace
* glclear* commands` seem to depend on scissor test and depth mask. Allow full write for the depth buffer
* texture debug, try to output some nice colors for the depth buffers
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5365 96395faa-99c1-11dd-bbfe-3dabce05a288
* Keep the state of the draw buffer (save few opengl call)
* AMD fix the shader unloading (12.2 and above). So disable the workaround
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5137 96395faa-99c1-11dd-bbfe-3dabce05a288
* Use the new map interface/separate texture coordinate inside shader
* support new format on texture
Note: it is quite instable with various crashes and GL error but at least it compiles now :p
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5094 96395faa-99c1-11dd-bbfe-3dabce05a288
* implement some missing shader for DATE, invert coordinate like strech rectangle
* Use glCopyImageSubDataNV nvidia extension to copy image (you need latest AMD drivers)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5086 96395faa-99c1-11dd-bbfe-3dabce05a288
* fix bad setup issue for constant blend factor
* Use a read framebuffer to read back the texture (less disruptive)
* cmake separate the loader to the main plugins
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5064 96395faa-99c1-11dd-bbfe-3dabce05a288
* add some define to enable/disable SDL so we could build gsdx without SDL
* debug: dump data based on frame count rather from draw count
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5044 96395faa-99c1-11dd-bbfe-3dabce05a288
* move all vertex buffer stuff into the class
* Bypass FIFO2 because of multithread issue with OGL(temporary workaround until we found a nicer solutions)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5035 96395faa-99c1-11dd-bbfe-3dabce05a288
* invert the index of fragment output. Seem to work better on Nvidia (strangely no impact for AMD)
* opengl support pitch too, so remove useless copy to an fbo
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5034 96395faa-99c1-11dd-bbfe-3dabce05a288
* Fix the Geomtry shader to output 2 triangles for quad primitive (ie 2R rendering)
- There is an AMD driver bug on geomtry shader input interface (well could be the spec too). Tell me if it still working on nvidia
* Add a workaroung to a previous AMD bug. It is impossible to unattach a shader so destroy the full shader pipeline...
* Be more strict on FBO management. Would optimize it later
* use a texture insted of a render buffer for depth-stencil management.
* add more dumping capabilities (in particular depth buffer)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5033 96395faa-99c1-11dd-bbfe-3dabce05a288
* fix vertex shader for HW renderer :) Remains the fragment part...
* add some dumping infrastucture (DUMP_START and DUMP_LENGTH)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5030 96395faa-99c1-11dd-bbfe-3dabce05a288
* rewrite the vertex management with a nice GSVertexBufferState object
* extend GSUniformBufferOGL to use a better object interface
* properly delete texture
* manage buffer with glMap* instead of glBufferSubData
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4990 96395faa-99c1-11dd-bbfe-3dabce05a288
* Enable interlace feature. (note I'm well aware that interlace crashes with SDL)
* remove useless callback debug function
* handle the y axis differently. Move vertex to follow right-hand system (render everything in reverse) then flip the y-axis for the screen rendering
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4987 96395faa-99c1-11dd-bbfe-3dabce05a288
* improve vertex management with a vertex array. Decorrelate vertex from strech rec and others func (later for the HW renderer)
* fix the crash on nvidia when closing the window
* clean some texture management code
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4985 96395faa-99c1-11dd-bbfe-3dabce05a288
* add a callback for GLERROR. Allow to breakpoint on GSDeviceOGL::DebugCallback (gdb is completely lost on amd driver, hope it is better on nvidia)
* Add some empty glsl convert to shutup some useless debugging error
* request an advance opengl context without pre 3.0 feature.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4983 96395faa-99c1-11dd-bbfe-3dabce05a288
* flip y-axis in merge stage
* default to xlib window managment (the dynamic switch between sdl and xlib crashi but SDL will probably dropped later)
* improve management of FBO, draw buffer
* try to fix some issue with glClearBuffer but spec is not clear.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4982 96395faa-99c1-11dd-bbfe-3dabce05a288
* implement the saving of texture (take bmp SW code)
* fix the missing "enable attribute code" and the typo in glsl. It works now !!!
* rework a little texture to pack texture into a temporay buffer when src pitch != dst pitch
* try to replace sdl with pure xlib (not yet enabled by default but it seems to work)
Note there still a minor issue, coordinate are different between DX and OGL (upper-left vs lower-left) so the image is inversed.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4981 96395faa-99c1-11dd-bbfe-3dabce05a288
* implement shader code (subset that seem to be used in SW mode)
* some hack to fix some alignment issue with GSVertexPT1 structure
* Lots of various opengl fixes. Remaining unsupported GL feature are inside SDL.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4974 96395faa-99c1-11dd-bbfe-3dabce05a288
* Properly allocate/delete opengl object
* Request a debug context in SDL, add some code to log opengl error
* Fix context creation. For the moment only request ogl4.1 (AMD does not support yet 4.2 and it needs libglew1.7 too...)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4973 96395faa-99c1-11dd-bbfe-3dabce05a288
* make a rough implementation of most of the opengl device interface. Only a savestate nothing to expect yet.
* depend of libglew 1.6 (normally 1.7 but I manually defined the only missing function)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4971 96395faa-99c1-11dd-bbfe-3dabce05a288
Current goal is to implement the SW render with pure opengl instead of SDL.
I plan to use OpenGL4.2 capability (the latest actually) => need libglew1.7 and a Dx11 capable GPU/drivers.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4970 96395faa-99c1-11dd-bbfe-3dabce05a288
GSdx: Removed OpenGL "support". Nobody showed any interest in getting this working.
GSdx: Removed PS1 GPU support. pcsx2 does not use this and it is unmaintained, likely broken, and frequently confuses intellisense.
GSDumpGUI: Use the correct export for the library name, was using the PS1 version.
If any of the above code is needed in the future, we have this wonderful technology called version control.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2754 96395faa-99c1-11dd-bbfe-3dabce05a288
- trying the dx10.1-only "gather" shader instruction for palletized lookups ("8-bit texture" mode), saves 4 instructions which isn't much but still... (not tested, don't have ati)
- may fix the intel gma "no output" bug (don't have gma either :P)
- and the usual small code optimizations
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1549 96395faa-99c1-11dd-bbfe-3dabce05a288