Skip to content

Commit 7e7ab3a

Browse files
removed deferred
1 parent d2b6462 commit 7e7ab3a

12 files changed

Lines changed: 250 additions & 1891 deletions

assets/core/scenes/scene-helmet.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"bPhysicsDebugDraw": false,
1010
"bDrawAllBoundingBoxes": false,
1111
"bFrustumCulling": true,
12-
"bMSAA": false,
12+
"bMSAA": true,
1313
"szIndexBufferSize": 32000000,
1414
"szVertexBufferSize": 32000000,
1515
"szDataBufferSize": 32000000,
@@ -45,7 +45,7 @@
4545
"renderer": {
4646
"lighting": {
4747
"tFlags": [
48-
"_____PL_RENDERER_LIGHTING_FLAGS_IMAGE_BASED",
48+
"PL_RENDERER_LIGHTING_FLAGS_IMAGE_BASED",
4949
"PL_RENDERER_LIGHTING_FLAGS_NORMAL_MAPPING",
5050
"PL_RENDERER_LIGHTING_FLAGS_PUNCTUAL_LIGHTS"
5151
]
@@ -105,7 +105,7 @@
105105
},
106106
"probes": [
107107
{
108-
"active": false,
108+
"active": true,
109109
"tPosition": [0.0, 5.0, 0.0],
110110
"fRange": 30.0,
111111
"uResolution": 128,

extensions/pl_draw_ext.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4922,8 +4922,6 @@ pl__get_2d_pipeline(uint32_t uMSAASampleCount, const plRenderAttachmentFormatInf
49224922
.tAlphaOp = PL_BLEND_OP_ADD
49234923
}
49244924
},
4925-
.auColorAttachmentIndices = {0},
4926-
.uColorAttachmentCount = 1,
49274925
.atBindGroupLayouts = {
49284926
{
49294927
.atSamplerBindings = {
@@ -4979,8 +4977,6 @@ pl__get_2d_pipeline(uint32_t uMSAASampleCount, const plRenderAttachmentFormatInf
49794977
.tAlphaOp = PL_BLEND_OP_ADD
49804978
}
49814979
},
4982-
.auColorAttachmentIndices = {0},
4983-
.uColorAttachmentCount = 1,
49844980
.atBindGroupLayouts = {
49854981
{
49864982
.atSamplerBindings = {

extensions/pl_graphics_ext.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,6 @@ pl_load_graphics_ext(plApiRegistryI* ptApiRegistry, bool bReload)
966966
.set_roles = pl_graphics_set_roles,
967967
.reset_roles = pl_graphics_reset_roles,
968968
.change_texture_role = pl_graphics_change_texture_role,
969-
.set_attachment_mapping = pl_graphics_set_attachment_mapping,
970969
.end_render_pass = pl_graphics_end_render_pass,
971970
.begin_compute_pass = pl_graphics_begin_compute_pass,
972971
.end_compute_pass = pl_graphics_end_compute_pass,

extensions/pl_graphics_ext.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,6 @@ typedef struct _plGraphicsI
612612
void (*set_roles) (plCommandBuffer*, const plPassResources*);
613613
void (*end_render_pass) (plCommandBuffer*);
614614
void (*change_texture_role)(plCommandBuffer*, plTextureHandle, plPassResourceRole, plPassResourceAccess, plPassResourceRole, plPassResourceAccess);
615-
void (*set_attachment_mapping)(plCommandBuffer*, uint32_t uCount, const uint32_t* puColorAttachmentIndices);
616-
617615
// render encoder: draw stream (preferred system)
618616
// Notes:
619617
// - call reset_draw_stream(...) with the maximum number of possible calls to
@@ -1131,11 +1129,6 @@ typedef struct _plShaderDesc
11311129

11321130
// new
11331131
plRenderAttachmentFormatInfo tRenderAttachmentFormatInfo;
1134-
uint32_t uColorAttachmentCount;
1135-
uint32_t uColorInputAttachmentCount;
1136-
uint32_t auColorAttachmentIndices[PL_MAX_RENDER_TARGETS];
1137-
uint32_t auColorInputAttachmentIndices[PL_MAX_RENDER_TARGETS];
1138-
uint32_t uDepthInputAttachmentIndex;
11391132

11401133
// [INTERNAL]
11411134
uint32_t _uVertexConstantCount;
@@ -1161,6 +1154,7 @@ typedef struct _plRenderAttachment
11611154
plStoreOp tStoreOp;
11621155
plTextureUsage tUsage;
11631156
plTextureHandle tTexture;
1157+
plTextureHandle tResolveTexture;
11641158
plVec4 tClearColor;
11651159
float fClearZ;
11661160
uint32_t uClearStencil;
@@ -1431,8 +1425,7 @@ enum _plTextureUsage
14311425
PL_TEXTURE_USAGE_COLOR_ATTACHMENT = 1 << 1,
14321426
PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT = 1 << 2,
14331427
PL_TEXTURE_USAGE_PRESENT = 1 << 3,
1434-
PL_TEXTURE_USAGE_INPUT_ATTACHMENT = 1 << 4,
1435-
PL_TEXTURE_USAGE_STORAGE = 1 << 5
1428+
PL_TEXTURE_USAGE_STORAGE = 1 << 4
14361429
};
14371430

14381431
enum _plBufferUsage
@@ -1536,8 +1529,7 @@ enum _plPassResourceRole
15361529
PL_PASS_RESOURCE_ROLE_STORAGE = 1 << 1, // storage texture/buffer read/write
15371530
PL_PASS_RESOURCE_ROLE_ATTACHMENT = 1 << 2, // render target/depth
15381531
PL_PASS_RESOURCE_ROLE_TRANSFER = 1 << 3, // copy/mipmap
1539-
PL_PASS_RESOURCE_ROLE_PRESENT = 1 << 4,
1540-
PL_PASS_RESOURCE_ROLE_INPUT_ATTACHMENT = 1 << 5,
1532+
PL_PASS_RESOURCE_ROLE_PRESENT = 1 << 4
15411533
};
15421534

15431535
enum _plCullMode

extensions/pl_graphics_metal.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,7 @@
894894
ptTextureDescriptor.sampleCount = ptDesc->tSampleCount == 0 ? 1 : ptDesc->tSampleCount;
895895

896896
if(tDesc.tUsage & PL_TEXTURE_USAGE_SAMPLED)
897-
ptTextureDescriptor.usage |= MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite;
898-
if(tDesc.tUsage & PL_TEXTURE_USAGE_INPUT_ATTACHMENT)
899-
ptTextureDescriptor.usage |= MTLTextureUsageShaderRead;
897+
ptTextureDescriptor.usage |= MTLTextureUsageShaderRead | MTLTextureUsageShaderWrite;
900898
if(tDesc.tUsage & PL_TEXTURE_USAGE_COLOR_ATTACHMENT)
901899
ptTextureDescriptor.usage |= MTLTextureUsageRenderTarget;
902900
if(tDesc.tUsage & PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT)
@@ -1098,7 +1096,7 @@
10981096
MTLResourceID* pptDestination = (MTLResourceID*)&pulDescriptorStart[ptUpdate->uSlot + ptUpdate->uIndex];
10991097
*pptDestination = ptMetalTexture->tTexture.gpuResourceID;
11001098

1101-
int iCommonBits = ptTexture->tDesc.tUsage & (PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT | PL_TEXTURE_USAGE_COLOR_ATTACHMENT |PL_TEXTURE_USAGE_INPUT_ATTACHMENT | PL_TEXTURE_USAGE_STORAGE);
1099+
int iCommonBits = ptTexture->tDesc.tUsage & (PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT | PL_TEXTURE_USAGE_COLOR_ATTACHMENT | PL_TEXTURE_USAGE_STORAGE);
11021100
if(iCommonBits)
11031101
{
11041102
pl_sb_push(ptBindGroup->_sbtTextures, ptUpdate->tTexture);

0 commit comments

Comments
 (0)