Commit Graph

270 Commits

Author SHA1 Message Date
Yun Hsiao Wu e5deaed8d9 GFX Vulkan backend (#2414)
* vk: init directories

* vk: context creation

* vk: swapchain draft

* vk: move swapchain to window

* vk: acquire - submit - present

* vk: begin/end render pass

* vk: clear op works!

* vk: validation errors cleared

* vk: first triangle!

...no uniform buffers though

* vk: update msvc project
2020-05-06 11:42:15 +08:00
coulsonwang d69858f020 update metal stencil descriptor (#2408) 2020-04-27 17:13:13 +08:00
coulsonwang 90dc449626 Fix metal texture (#2386)
* fix update metal texture

* fix resize metal texture

* update review

* use toMTLTextureType

* add gfx status
2020-04-27 11:37:15 +08:00
coulsonwang 9f6ec3c58d add copyBufferToTexture and updateBuffer (#2384)
* add copyBufferToTexture and updateBuffer

* use usage and flag to update buffer

* revert TRANSFER_SRC and TRANSFER_DST  modify

* fix indirects

# Conflicts:
#	cocos/renderer/gfx-metal/MTLBuffer.mm

* reset buffer when malloc failed

* revert commit#a6544ec

* update review
2020-04-27 09:53:39 +08:00
coulsonwang b78d9bf8ac set features according to Metal feature set table (#2383)
* set features according to Metal feature set table

* remove duplicate code

* add metal feature set for iOS

* update reivew

* use String instead of const char*
2020-04-27 09:51:55 +08:00
Yun Hsiao Wu 16faa76fcf fix depth texture view format (#2404)
* windows build gles2 too by default

* fix depth texture view format

* fix ci
2020-04-26 17:25:42 +08:00
minggo 2082c30ea4 fix crash if enter background on Android (#2401)
* fix crash if enter background on Android

* break if recreate window error
2020-04-24 16:56:35 +08:00
coulsonwang 3166eef09d add indirect info (#2399)
* add indirect info

* add normalized MTLVertexFormat

* fix indirects

* fix vertex format
2020-04-23 17:53:57 +08:00
minggo b02ef0bac1 add minClipZ and projectionSignY for device (#2379) 2020-04-20 16:58:57 +08:00
coulsonwang 1e63144a48 support instancing (#2382)
* support instancing

* fix stride

* emplace_back when need
2020-04-20 11:29:58 +08:00
coulsonwang f4b4301977 fix texture and sampler binding (#2377) 2020-04-15 13:47:41 +08:00
coulsonwang 385a97ac6e convert RGB32F to MTLPixelFormatRGBA32Float (#2373)
* convert RGB32F to MTLPixelFormatRGBA32Float

* move format comvertor to utils
2020-04-15 10:00:49 +08:00
minggo da59100a21 Metal command buffer improve (#2376)
* set depth bias

* support setting blend constants

* support setting depth bounds

* add some error log
2020-04-14 18:43:02 +08:00
coulsonwang 5b12ecc9db fix incorrectly update PSO (#2370) 2020-04-14 18:34:47 +08:00
minggo 2d90a8c16c check correct pointer address to avoid crash (#2372) 2020-04-14 15:41:34 +08:00
Arnold 79fc8353d1 3dgfx add CI & cmake (#2350)
* use-cmake

* revert: enable gles3 for android

* compile with cmake only
2020-04-14 13:58:45 +08:00
coulsonwang 7453ba4a2c fix incorrect index offset (#2368) 2020-04-13 18:29:42 +08:00
minggo c590172f76 fix some issues: (#2367)
- present drawable in View to prevent rendering warning in metal
- fix draw elements offset
- fix pipeline state
2020-04-13 12:10:18 +08:00
minggo 11d8db66fd Metal implement device present (#2366)
* fix issue that pipeline state is not bound correctly

* implement CCMTLDevice::present()
2020-04-10 14:44:26 +08:00
minggo 188efebd52 fix issue that pipeline state is not bound correctly (#2364) 2020-04-10 11:39:37 +08:00
minggo 870641ce93 fix crash that buffer is not bound (#2363)
* fix crash that buffer is not bound

* bind state in correct logic
2020-04-10 11:10:02 +08:00
Yun Hsiao Wu 318c28c1f0 numInstances binding (#2359) 2020-04-09 18:32:25 +08:00
minggo dd1ea9420d use one command buffer for a queue submit (#2357) 2020-04-08 16:45:13 +08:00
minggo 9e7717c1c3 improve metal implementation (#2354) 2020-04-07 15:52:01 +08:00
Yun Hsiao Wu 8b33c034f5 fix window cmopile error (#2328) 2020-03-25 09:28:41 +08:00
minggo 1b696d8504 use gles3 for all platforms (#2327) 2020-03-24 17:26:21 +08:00
minggo d573a5f2f5 android support GLES3 (#2324) 2020-03-24 15:02:19 +08:00
minggo dd1054d45d use GLES3 on iOS (#2316)
* use GLES3 on iOS

* add GLSL300 version define

Co-authored-by: coulsonwang <coulsonwang@126.com>
2020-03-24 14:35:04 +08:00
Yun Hsiao Wu 1025336e71 fix texture multiple upload (#2315) 2020-03-23 09:58:34 +08:00
coulsonwang 28780c7305 fix glClear issue (#2317) 2020-03-23 09:51:16 +08:00
Yun Hsiao Wu 6cba0e85a5 more consistent gfx format (#2314)
* minor

* more consistent gfx format
2020-03-20 11:37:12 +08:00
coulsonwang fab59fdff0 fix particle issue (#2308)
* fix particle issue

* keep GFXIndirectBuffer

* revert GFXIndirectBuffer
2020-03-19 18:28:04 +08:00
Yun Hsiao Wu 366f76acec should update cache when binding array buffer (#2284)
* fix tri/dc count

* fix array buffer cache

* fix VAO routine

* fix windows pointer lock

* gfx instance count

* fix SDL window event handler

* fix profiler interface

* fix GL resource deletion

* fix state cache
2020-03-18 17:25:35 +08:00
coulsonwang 3e69292f25 fix stencil cache issue (#2290) 2020-03-18 15:19:04 +08:00
Arnold ce1cd53386 [gfx] win32 adaptation (#2270)
* update for windows

* update ref location

* update external

* revert debug info

* fix include order

* fix template

* fix buffer

* remove CCStdC-win32*
2020-03-18 11:35:40 +08:00
Arnold 90400c0beb [3d-gfx] GFXObject add virtual destructor (#2285)
* add virtual destructor

* remove empty row
2020-03-17 18:38:29 +08:00
minggo 925a0a2d32 add GFXObject (#2276) 2020-03-16 14:26:55 +08:00
minggo 60bcebefd6 Manual bind gfx input assember functions (#2267)
* add missing function

* manual binding some functions
2020-03-11 18:24:56 +08:00
coulsonwang 5dcf10c53d fix texture mipmap width and height (#2260)
* fix texture mipmap width and height

* fix
2020-03-10 15:53:03 +08:00
minggo d694a4297a fix gles3 viewport setting (#2263) 2020-03-10 15:50:05 +08:00
minggo 90a50812f5 fix wrong logic of setting viewport (#2259) 2020-03-10 13:58:49 +08:00
minggo 292b87d4f7 Ios adapt (#2257)
* use correct OpenGL ES SDK

* make sure View is created
2020-03-09 17:39:00 +08:00
minggo b220ff2c5a Window handler type (#2251)
* change window handler type to uintptr_t

* convert uintptr_t to JS
2020-03-09 11:51:46 +08:00
minggo f88dc441c9 use uintptr_t for window handler (#2249) 2020-03-09 11:32:25 +08:00
minggo fa511447e3 Android issue (#2247)
* change window handler to uintptr_t

* fix compiling error
2020-03-09 11:21:07 +08:00
coulsonwang f1b2a02599 Rename getter (#2243)
* rename getter attribute

* fix
2020-03-06 15:02:54 +08:00
minggo 3b7c5db424 Mac compiling running issue (#2241)
* fix compiling error

* fix crash on mac
2020-03-06 11:22:21 +08:00
pandamicro 398ae74079 Fix gfx binding issues (#2227)
* Add GLES2Window binding

* Add GFXBuffer update binding

* Fix array operation issue in manual binding

* Add GFXCommandAllocator binding

* Remove skip of getter function bindings

* Add js_gfx_GFXPipelineLayout_get_layouts binding

* Manual bind GFXBlendState targets getter

* Make GFXCommandBuffer::beginRenderPass bindable

* remove count usage

* fix

* Fix CommandBuffer::execute issues

* Add getter setter bindings

* Open setPreferredFramesPerSecond binding with empty impl

Co-authored-by: coulsonwang <coulsonwang@126.com>
2020-03-06 09:52:47 +08:00
minggo d768451c0b Mac support gles (#2229)
* mac support gles

* update external version

* macos supports gles
2020-03-05 12:14:59 +08:00
coulsonwang 65cc5be5b2 rename to GFXDataArray (#2218) 2020-03-03 09:35:41 +08:00