|
@@ -2417,7 +2417,6 @@ static void METAL_BindGraphicsPipeline(
|
|
|
{
|
|
{
|
|
|
@autoreleasepool {
|
|
@autoreleasepool {
|
|
|
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
|
|
MetalCommandBuffer *metalCommandBuffer = (MetalCommandBuffer *)commandBuffer;
|
|
|
- MetalGraphicsPipeline *previousPipeline = metalCommandBuffer->graphics_pipeline;
|
|
|
|
|
MetalGraphicsPipeline *pipeline = (MetalGraphicsPipeline *)graphicsPipeline;
|
|
MetalGraphicsPipeline *pipeline = (MetalGraphicsPipeline *)graphicsPipeline;
|
|
|
SDL_GPURasterizerState *rast = &pipeline->rasterizerState;
|
|
SDL_GPURasterizerState *rast = &pipeline->rasterizerState;
|
|
|
Uint32 i;
|
|
Uint32 i;
|
|
@@ -2444,6 +2443,14 @@ static void METAL_BindGraphicsPipeline(
|
|
|
setDepthStencilState:pipeline->depth_stencil_state];
|
|
setDepthStencilState:pipeline->depth_stencil_state];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Mark that bindings are needed
|
|
|
|
|
+ metalCommandBuffer->needVertexSamplerBind = true;
|
|
|
|
|
+ metalCommandBuffer->needVertexStorageTextureBind = true;
|
|
|
|
|
+ metalCommandBuffer->needVertexStorageBufferBind = true;
|
|
|
|
|
+ metalCommandBuffer->needFragmentSamplerBind = true;
|
|
|
|
|
+ metalCommandBuffer->needFragmentStorageTextureBind = true;
|
|
|
|
|
+ metalCommandBuffer->needFragmentStorageBufferBind = true;
|
|
|
|
|
+
|
|
|
for (i = 0; i < MAX_UNIFORM_BUFFERS_PER_STAGE; i += 1) {
|
|
for (i = 0; i < MAX_UNIFORM_BUFFERS_PER_STAGE; i += 1) {
|
|
|
metalCommandBuffer->needVertexUniformBufferBind[i] = true;
|
|
metalCommandBuffer->needVertexUniformBufferBind[i] = true;
|
|
|
metalCommandBuffer->needFragmentUniformBufferBind[i] = true;
|
|
metalCommandBuffer->needFragmentUniformBufferBind[i] = true;
|
|
@@ -2462,17 +2469,6 @@ static void METAL_BindGraphicsPipeline(
|
|
|
metalCommandBuffer);
|
|
metalCommandBuffer);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (previousPipeline && previousPipeline != pipeline) {
|
|
|
|
|
- // if the number of uniform buffers has changed, the storage buffers will move as well
|
|
|
|
|
- // and need a rebind at their new locations
|
|
|
|
|
- if (previousPipeline->header.num_vertex_uniform_buffers != pipeline->header.num_vertex_uniform_buffers) {
|
|
|
|
|
- metalCommandBuffer->needVertexStorageBufferBind = true;
|
|
|
|
|
- }
|
|
|
|
|
- if (previousPipeline->header.num_fragment_uniform_buffers != pipeline->header.num_fragment_uniform_buffers) {
|
|
|
|
|
- metalCommandBuffer->needFragmentStorageBufferBind = true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3188,6 +3184,10 @@ static void METAL_BindComputePipeline(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ metalCommandBuffer->needComputeSamplerBind = true;
|
|
|
|
|
+ metalCommandBuffer->needComputeReadOnlyStorageTextureBind = true;
|
|
|
|
|
+ metalCommandBuffer->needComputeReadOnlyStorageBufferBind = true;
|
|
|
|
|
+
|
|
|
// Bind write-only resources
|
|
// Bind write-only resources
|
|
|
if (pipeline->header.numReadWriteStorageTextures > 0) {
|
|
if (pipeline->header.numReadWriteStorageTextures > 0) {
|
|
|
[metalCommandBuffer->computeEncoder setTextures:metalCommandBuffer->computeReadWriteTextures
|
|
[metalCommandBuffer->computeEncoder setTextures:metalCommandBuffer->computeReadWriteTextures
|