Some projects need more than 8bit RGBA offscreens, this patch adds the ability to accept color format and defaults to RGBA8 so existing code should not be affected
current formats allowed by patch:
- RGBA8 (default)
- RGBA16
- RGBA16F
- RGBA32F
Differential D13650
gpu.types.GPUOffScreen: accept format argument to set internal color attachment texture format Authored by Iyad Ahmed (iyadahmed2001) on Dec 22 2021, 10:17 AM.
Details Some projects need more than 8bit RGBA offscreens, this patch adds the ability to accept color format and defaults to RGBA8 so existing code should not be affected current formats allowed by patch:
Diff Detail
Event TimelineComment Actions I realized what the patch does might be already achievable via Comment Actions I would expose more supported formats for it to be useful. I would add support for: Other formats may have side effects on the drawing pipeline. Comment Actions Thanks for the patch, looks good to me. Comment Actions No I still can't apply the patch. $ arc patch D13650 INFO Base commit is not in local repository; trying to fetch. fatal: Needed a single revision fatal: Unable to find current revision in submodule path 'release/datafiles/locale' Created and checked out branch arcpatch-D13650. Checking patch source/blender/python/gpu/gpu_py_offscreen.c... error: while searching for: /** \name GPUOffScreen Common Utilities? * \{ */? ? static int pygpu_offscreen_valid_check(BPyGPUOffScreen *py_ofs)? {? if (UNLIKELY(py_ofs->ofs == NULL)) {? error: patch failed: source/blender/python/gpu/gpu_py_offscreen.c:65 error: while searching for: ? GPUOffScreen *ofs = NULL;? int width, height;? char err_out[256];? ? static const char *_keywords[] = {"width", "height", NULL};? static _PyArg_Parser _parser = {"ii:GPUOffScreen.__new__", _keywords, 0};? if (!_PyArg_ParseTupleAndKeywordsFast(args, kwds, &_parser, &width, &height)) {? return NULL;? }? ? if (GPU_context_active_get()) {? ofs = GPU_offscreen_create(width, height, true, GPU_RGBA8, err_out);? }? else {? STRNCPY(err_out, "No active GPU context found");? error: patch failed: source/blender/python/gpu/gpu_py_offscreen.c:219 error: while searching for: };? ? PyDoc_STRVAR(pygpu_offscreen__tp_doc,? ".. class:: GPUOffScreen(width, height)\n"? "\n"? " This object gives access to off screen buffers.\n"? "\n"? " :arg width: Horizontal dimension of the buffer.\n"? " :type width: int\n"? " :arg height: Vertical dimension of the buffer.\n"? " :type height: int\n");? PyTypeObject BPyGPUOffScreen_Type = {? PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUOffScreen",? .tp_basicsize = sizeof(BPyGPUOffScreen),? error: patch failed: source/blender/python/gpu/gpu_py_offscreen.c:456 Applying patch source/blender/python/gpu/gpu_py_offscreen.c with 3 rejects... Rejected hunk #1. Rejected hunk #2. Rejected hunk #3. Patch Failed! Usage Exception: Unable to apply patch! I will try manually. |